summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUma Shankar <uma.shankar@intel.com>2020-12-01 02:17:33 +0530
committerUma Shankar <uma.shankar@intel.com>2020-12-02 01:29:52 +0530
commitc5044aee4039671d72ddcfdb38ea0a3b32effab4 (patch)
tree18fbcfac21448ba98da67e2ac3f9bd245625ca5a
parent84ab44b757d59e50584c0ca86890dd139f9daed0 (diff)
drm/i915/display: Enable HDR for Parade based lspcon
Enable HDR for LSPCON based on Parade along with MCA. v2: Added a helper for status reg as suggested by Ville. v3: Removed a redundant variable, added Ville's RB. Signed-off-by: Uma Shankar <uma.shankar@intel.com> Signed-off-by: Vipin Anand <vipin.anand@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20201130204738.2443-11-uma.shankar@intel.com
-rw-r--r--drivers/gpu/drm/i915/display/intel_lspcon.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_lspcon.c b/drivers/gpu/drm/i915/display/intel_lspcon.c
index cb768a1ae4c9..592c19deba00 100644
--- a/drivers/gpu/drm/i915/display/intel_lspcon.c
+++ b/drivers/gpu/drm/i915/display/intel_lspcon.c
@@ -36,6 +36,7 @@
#define LSPCON_VENDOR_MCA_OUI 0x0060AD
#define DPCD_MCA_LSPCON_HDR_STATUS 0x70003
+#define DPCD_PARADE_LSPCON_HDR_STATUS 0x00511
/* AUX addresses to write MCA AVI IF */
#define LSPCON_MCA_AVI_IF_WRITE_OFFSET 0x5C0
@@ -106,6 +107,14 @@ static bool lspcon_detect_vendor(struct intel_lspcon *lspcon)
return true;
}
+static u32 get_hdr_status_reg(struct intel_lspcon *lspcon)
+{
+ if (lspcon->vendor == LSPCON_VENDOR_MCA)
+ return DPCD_MCA_LSPCON_HDR_STATUS;
+ else
+ return DPCD_PARADE_LSPCON_HDR_STATUS;
+}
+
void lspcon_detect_hdr_capability(struct intel_lspcon *lspcon)
{
struct intel_digital_port *dig_port =
@@ -115,12 +124,8 @@ void lspcon_detect_hdr_capability(struct intel_lspcon *lspcon)
u8 hdr_caps;
int ret;
- /* Enable HDR for MCA based LSPCON devices */
- if (lspcon->vendor == LSPCON_VENDOR_MCA)
- ret = drm_dp_dpcd_read(&dp->aux, DPCD_MCA_LSPCON_HDR_STATUS,
- &hdr_caps, 1);
- else
- return;
+ ret = drm_dp_dpcd_read(&dp->aux, get_hdr_status_reg(lspcon),
+ &hdr_caps, 1);
if (ret < 0) {
drm_dbg_kms(dev, "HDR capability detection failed\n");