diff mbox series

[v8,5/7] drm/i915/display: Add support for pack and unpack

Message ID 20240509075833.1858363-6-mitulkumar.ajitkumar.golani@intel.com (mailing list archive)
State New, archived
Headers show
Series Implement CMRR Support | expand

Commit Message

Golani, Mitulkumar Ajitkumar May 9, 2024, 7:58 a.m. UTC
Add support of pack and unpack for target_rr_divider.

Signed-off-by: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Nautiyal, Ankit K May 23, 2024, 11:31 a.m. UTC | #1
On 5/9/2024 1:28 PM, Mitul Golani wrote:
> Add support of pack and unpack for target_rr_divider.
>
> Signed-off-by: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
> ---
>   drivers/gpu/drm/i915/display/intel_dp.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 486361eb0070..523956193fbf 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -4228,7 +4228,7 @@ static ssize_t intel_dp_as_sdp_pack(const struct drm_dp_as_sdp *as_sdp,
>   	sdp->db[1] = as_sdp->vtotal & 0xFF;
>   	sdp->db[2] = (as_sdp->vtotal >> 8) & 0xFF;
>   	sdp->db[3] = as_sdp->target_rr & 0xFF;
> -	sdp->db[4] = (as_sdp->target_rr >> 8) & 0x3;
> +	sdp->db[4] = (as_sdp->target_rr >> 8) & 0x23;

I think this is incorrect, this should be:

sdp->db[4] = (as_sdp->target_rr >> 8) & 0x3;
if (as_sdp->target_rr_divider)
sdb->db[4] |= 0x20;

Regards,

Ankit

>   
>   	return length;
>   }
> @@ -4410,6 +4410,7 @@ int intel_dp_as_sdp_unpack(struct drm_dp_as_sdp *as_sdp,
>   	as_sdp->mode = sdp->db[0] & DP_ADAPTIVE_SYNC_SDP_OPERATION_MODE;
>   	as_sdp->vtotal = (sdp->db[2] << 8) | sdp->db[1];
>   	as_sdp->target_rr = (u64)sdp->db[3] | ((u64)sdp->db[4] & 0x3);
> +	as_sdp->target_rr_divider = sdp->db[4] & 0x20;
>   
>   	return 0;
>   }
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 486361eb0070..523956193fbf 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -4228,7 +4228,7 @@  static ssize_t intel_dp_as_sdp_pack(const struct drm_dp_as_sdp *as_sdp,
 	sdp->db[1] = as_sdp->vtotal & 0xFF;
 	sdp->db[2] = (as_sdp->vtotal >> 8) & 0xFF;
 	sdp->db[3] = as_sdp->target_rr & 0xFF;
-	sdp->db[4] = (as_sdp->target_rr >> 8) & 0x3;
+	sdp->db[4] = (as_sdp->target_rr >> 8) & 0x23;
 
 	return length;
 }
@@ -4410,6 +4410,7 @@  int intel_dp_as_sdp_unpack(struct drm_dp_as_sdp *as_sdp,
 	as_sdp->mode = sdp->db[0] & DP_ADAPTIVE_SYNC_SDP_OPERATION_MODE;
 	as_sdp->vtotal = (sdp->db[2] << 8) | sdp->db[1];
 	as_sdp->target_rr = (u64)sdp->db[3] | ((u64)sdp->db[4] & 0x3);
+	as_sdp->target_rr_divider = sdp->db[4] & 0x20;
 
 	return 0;
 }