aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinod Koul <vkoul@kernel.org>2020-03-04 11:22:14 +0530
committerVinod Koul <vkoul@kernel.org>2022-04-13 19:24:08 +0530
commit1d7d98ad564f1ec69e7525e07418918d90f247a1 (patch)
tree935e604ebe489ad92b4fd1bae1065b8cadc84213
parentf49dcfca8a283e278d8fbd0c344258a5eae4d952 (diff)
drm: panel: sw43408: Add DSC support
Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r--drivers/gpu/drm/panel/panel-lg-sw43408.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/gpu/drm/panel/panel-lg-sw43408.c b/drivers/gpu/drm/panel/panel-lg-sw43408.c
index e6192df05a7c..319455d71f2e 100644
--- a/drivers/gpu/drm/panel/panel-lg-sw43408.c
+++ b/drivers/gpu/drm/panel/panel-lg-sw43408.c
@@ -20,6 +20,7 @@
#include <drm/drm_modes.h>
#include <drm/drm_panel.h>
#include <drm/drm_print.h>
+#include <drm/drm_dsc.h>
#include <video/mipi_display.h>
@@ -397,6 +398,7 @@ poweroff:
static int lg_panel_enable(struct drm_panel *panel)
{
struct panel_info *pinfo = to_panel_info(panel);
+ struct drm_dsc_picture_parameter_set pps;
int ret;
if (pinfo->enabled)
@@ -408,6 +410,20 @@ static int lg_panel_enable(struct drm_panel *panel)
return ret;
}
+ if (panel->dsc) {
+ /* this panel uses DSC so send the pps */
+ drm_dsc_pps_payload_pack(&pps, panel->dsc);
+ print_hex_dump(KERN_DEBUG, "DSC params:", DUMP_PREFIX_NONE,
+ 16, 1, &pps, sizeof(pps), false);
+
+ //ret = mipi_dsi_picture_parameter_set(pinfo->link, &pps);
+ //if (ret < 0) {
+ // DRM_DEV_ERROR(panel->dev,
+ // "failed to set pps: %d\n", ret);
+ // return ret;
+ //}
+ }
+
pinfo->enabled = true;
return 0;
@@ -655,6 +671,7 @@ static int panel_probe(struct mipi_dsi_device *dsi)
{
struct panel_info *pinfo;
const struct panel_desc *desc;
+ struct drm_dsc_config *dsc;
int err;
pinfo = devm_kzalloc(&dsi->dev, sizeof(*pinfo), GFP_KERNEL);
@@ -674,7 +691,27 @@ static int panel_probe(struct mipi_dsi_device *dsi)
if (err < 0)
return err;
+ /* The panel is DSC panel only, set the dsc params */
+ dsc = devm_kzalloc(&dsi->dev, sizeof(*dsc), GFP_KERNEL);
+ if (!dsc)
+ return -ENOMEM;
+
+ dsc->dsc_version_major = 0x1;
+ dsc->dsc_version_minor = 0x1;
+
+ dsc->slice_height = 16;
+ dsc->slice_width = 540;
+ dsc->slice_count = 1;
+ dsc->bits_per_component = 8;
+ dsc->bits_per_pixel = 8;
+ dsc->block_pred_enable = true;
+
+ pinfo->base.dsc = dsc;
+
err = mipi_dsi_attach(dsi);
+ if (err < 0)
+ return err;
+
return err;
}