diff mbox series

[v3,1/5] drm/i915/scaler: Add and compute scaling factors

Message ID 20250106165111.1672722-2-mitulkumar.ajitkumar.golani@intel.com (mailing list archive)
State New
Headers show
Series Check Scaler and DSC Prefill Latency Against Vblank | expand

Commit Message

Golani, Mitulkumar Ajitkumar Jan. 6, 2025, 4:51 p.m. UTC
Add scaling factors to scaler_state for a perticular scaler user,
use it later to compute scaler prefill latency. Also to extend this
when either pipe or plane scaler is in use.

Signed-off-by: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
---
 drivers/gpu/drm/i915/display/intel_display_types.h | 2 ++
 drivers/gpu/drm/i915/display/skl_scaler.c          | 3 +++
 2 files changed, 5 insertions(+)

Comments

Nautiyal, Ankit K Jan. 7, 2025, 1 p.m. UTC | #1
On 1/6/2025 10:21 PM, Mitul Golani wrote:
> Add scaling factors to scaler_state for a perticular scaler user,

typo: particular

> use it later to compute scaler prefill latency. Also to extend this
> when either pipe or plane scaler is in use.

As I understand we are adding a new member to store the hscale and vscale.

Here we are storing only for plane scaler but intention is to store it 
for pipe scaler case as well.

Perhaps the commit message can be rephrased better.

Regards,

Ankit


>
> Signed-off-by: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
> ---
>   drivers/gpu/drm/i915/display/intel_display_types.h | 2 ++
>   drivers/gpu/drm/i915/display/skl_scaler.c          | 3 +++
>   2 files changed, 5 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index f230163226d1..67c49a1d0232 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -711,6 +711,8 @@ struct intel_initial_plane_config {
>   struct intel_scaler {
>   	u32 mode;
>   	bool in_use;
> +	int hscale;
> +	int vscale;
>   };
>   
>   struct intel_crtc_scaler_state {
> diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c
> index ae21fce534dc..6c69545fe172 100644
> --- a/drivers/gpu/drm/i915/display/skl_scaler.c
> +++ b/drivers/gpu/drm/i915/display/skl_scaler.c
> @@ -424,6 +424,9 @@ static int intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_stat
>   
>   			return -EINVAL;
>   		}
> +
> +		scaler_state->scalers[*scaler_id].hscale = hscale;
> +		scaler_state->scalers[*scaler_id].vscale = vscale;
>   	}
>   
>   	drm_dbg_kms(display->drm, "Attached scaler id %u.%u to %s:%d\n",
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index f230163226d1..67c49a1d0232 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -711,6 +711,8 @@  struct intel_initial_plane_config {
 struct intel_scaler {
 	u32 mode;
 	bool in_use;
+	int hscale;
+	int vscale;
 };
 
 struct intel_crtc_scaler_state {
diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c
index ae21fce534dc..6c69545fe172 100644
--- a/drivers/gpu/drm/i915/display/skl_scaler.c
+++ b/drivers/gpu/drm/i915/display/skl_scaler.c
@@ -424,6 +424,9 @@  static int intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_stat
 
 			return -EINVAL;
 		}
+
+		scaler_state->scalers[*scaler_id].hscale = hscale;
+		scaler_state->scalers[*scaler_id].vscale = vscale;
 	}
 
 	drm_dbg_kms(display->drm, "Attached scaler id %u.%u to %s:%d\n",