[Intel-gfx] [v9 07/12] drm/i915/display: Enable HDR for Parade based lspcon
Ville Syrjälä
ville.syrjala at linux.intel.com
Wed Nov 25 16:42:10 UTC 2020
On Tue, Nov 03, 2020 at 08:58:29PM +0530, Uma Shankar wrote:
> Enable HDR for LSPCON based on Parade along with MCA.
>
> v2: Added a helper for status reg as suggested by Ville.
>
> Signed-off-by: Uma Shankar <uma.shankar at intel.com>
> Signed-off-by: Vipin Anand <vipin.anand at intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_lspcon.c | 19 +++++++++++++------
> 1 file changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_lspcon.c b/drivers/gpu/drm/i915/display/intel_lspcon.c
> index 19831f5e51bf..0cd3e0853cbf 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
More magic I know nothing about. But if it works it works.
>
> /* AUX addresses to write MCA AVI IF */
> #define LSPCON_MCA_AVI_IF_WRITE_OFFSET 0x5C0
> @@ -106,21 +107,27 @@ 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 =
> container_of(lspcon, struct intel_digital_port, lspcon);
> struct drm_device *dev = dig_port->base.base.dev;
> struct intel_dp *dp = lspcon_to_intel_dp(lspcon);
> + u32 lspcon_hdr_status_reg;
> 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;
> + lspcon_hdr_status_reg = get_hdr_status_reg(lspcon);
This extra variable seems rather pointless.
Reviewed-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> + ret = drm_dp_dpcd_read(&dp->aux, lspcon_hdr_status_reg,
> + &hdr_caps, 1);
>
> if (ret < 0) {
> drm_dbg_kms(dev, "hdr capability detection failed\n");
> --
> 2.26.2
--
Ville Syrjälä
Intel
More information about the Intel-gfx
mailing list