summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/fbdev/msm/mdss_hdmi_panel.c18
-rw-r--r--drivers/video/fbdev/msm/mdss_hdmi_panel.h11
-rw-r--r--drivers/video/fbdev/msm/mdss_hdmi_tx.c4
3 files changed, 31 insertions, 2 deletions
diff --git a/drivers/video/fbdev/msm/mdss_hdmi_panel.c b/drivers/video/fbdev/msm/mdss_hdmi_panel.c
index be83753389a6..7fecb08f9667 100644
--- a/drivers/video/fbdev/msm/mdss_hdmi_panel.c
+++ b/drivers/video/fbdev/msm/mdss_hdmi_panel.c
@@ -630,13 +630,29 @@ end:
return rc;
}
+static inline int get_bitdepth(enum hdmi_deep_color_depth bitdepth)
+{
+ switch (bitdepth) {
+ case HDMI_DEEP_COLOR_DEPTH_24BPP:
+ return 24;
+ case HDMI_DEEP_COLOR_DEPTH_30BPP:
+ return 30;
+ case HDMI_DEEP_COLOR_DEPTH_36BPP:
+ return 36;
+ default:
+ return 0;
+ }
+}
+
static int hdmi_panel_setup_dc(struct hdmi_panel *panel)
{
u32 hdmi_ctrl_reg;
u32 vbi_pkt_reg;
int rc = 0;
- pr_debug("Deep Color: %s\n", panel->data->dc_enable ? "ON" : "OFF");
+ pr_debug("Deep Color: %s, bitdepth = %d\n",
+ panel->data->dc_enable ? "ON" : "OFF",
+ get_bitdepth(panel->data->bitdepth));
/* enable deep color if supported */
if (panel->data->dc_enable) {
diff --git a/drivers/video/fbdev/msm/mdss_hdmi_panel.h b/drivers/video/fbdev/msm/mdss_hdmi_panel.h
index cb40f0cad55e..e485822f8af0 100644
--- a/drivers/video/fbdev/msm/mdss_hdmi_panel.h
+++ b/drivers/video/fbdev/msm/mdss_hdmi_panel.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -16,6 +16,13 @@
#include "mdss_panel.h"
#include "mdss_hdmi_util.h"
+enum hdmi_deep_color_depth {
+ HDMI_DEEP_COLOR_DEPTH_24BPP,
+ HDMI_DEEP_COLOR_DEPTH_30BPP,
+ HDMI_DEEP_COLOR_DEPTH_36BPP,
+ HDMI_DEEP_COLOR_DEPTH_RESERVED,
+};
+
/**
* struct hdmi_panel_data - panel related data information
*
@@ -29,6 +36,7 @@
* @is_it_content: set to true if content is IT
* @scrambler: set to true if scrambler needs to be enabled
* @dc_enable: set to true if deep color is enabled
+ * @bitdepth: set the output bitdepth like 24/30 bpp
*/
struct hdmi_panel_data {
struct mdss_panel_info *pinfo;
@@ -41,6 +49,7 @@ struct hdmi_panel_data {
bool is_it_content;
bool scrambler;
bool dc_enable;
+ enum hdmi_deep_color_depth bitdepth;
};
/**
diff --git a/drivers/video/fbdev/msm/mdss_hdmi_tx.c b/drivers/video/fbdev/msm/mdss_hdmi_tx.c
index 86d15f385838..5c06e0636349 100644
--- a/drivers/video/fbdev/msm/mdss_hdmi_tx.c
+++ b/drivers/video/fbdev/msm/mdss_hdmi_tx.c
@@ -3403,6 +3403,10 @@ static int hdmi_tx_power_on(struct hdmi_tx_ctrl *hdmi_ctrl)
hdmi_ctrl->panel.scrambler = hdmi_edid_get_sink_scrambler_support(
edata);
hdmi_ctrl->panel.dc_enable = hdmi_tx_dc_support(hdmi_ctrl);
+ if (hdmi_ctrl->panel.dc_enable)
+ hdmi_ctrl->panel.bitdepth = HDMI_DEEP_COLOR_DEPTH_30BPP;
+ else
+ hdmi_ctrl->panel.bitdepth = HDMI_DEEP_COLOR_DEPTH_24BPP;
if (hdmi_ctrl->panel_ops.on)
hdmi_ctrl->panel_ops.on(pdata);