summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/display/intel_bw.c
diff options
context:
space:
mode:
authorVinod Govindapillai <vinod.govindapillai@intel.com>2024-04-05 14:35:30 +0300
committerVinod Govindapillai <vinod.govindapillai@intel.com>2024-04-19 16:11:31 +0300
commitf09f95177dfd606e4bde234c65b991ae45e7ef65 (patch)
treeeffae887eddb83ea2afc07898dc10c79fdb14faa /drivers/gpu/drm/i915/display/intel_bw.c
parent193caff1369e7dcfb9dafd69451b6e3a8d8caa85 (diff)
downloadlinux-f09f95177dfd606e4bde234c65b991ae45e7ef65.tar.gz
linux-f09f95177dfd606e4bde234c65b991ae45e7ef65.tar.bz2
linux-f09f95177dfd606e4bde234c65b991ae45e7ef65.zip
drm/i915/display: extract code to prepare qgv points mask
Extract the code to prepare the QGV points mask as per the format expected by the pcode as this could be utlized from multiple points. Reviewed-by: Jouni Högander <jouni.hogander@intel.com> Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240405113533.338553-4-vinod.govindapillai@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_bw.c')
-rw-r--r--drivers/gpu/drm/i915/display/intel_bw.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_bw.c b/drivers/gpu/drm/i915/display/intel_bw.c
index 963c9e57a5d5..ea294b9ed733 100644
--- a/drivers/gpu/drm/i915/display/intel_bw.c
+++ b/drivers/gpu/drm/i915/display/intel_bw.c
@@ -851,6 +851,14 @@ static unsigned int icl_max_bw_qgv_point_mask(struct drm_i915_private *i915,
return max_bw_point;
}
+static u16 icl_prepare_qgv_points_mask(struct drm_i915_private *i915,
+ unsigned int qgv_points,
+ unsigned int psf_points)
+{
+ return ~(ICL_PCODE_REQ_QGV_PT(qgv_points) |
+ ADLS_PCODE_REQ_PSF_PT(psf_points)) & icl_qgv_points_mask(i915);
+}
+
static int mtl_find_qgv_points(struct drm_i915_private *i915,
unsigned int data_rate,
unsigned int num_active_planes,
@@ -994,11 +1002,9 @@ static int icl_find_qgv_points(struct drm_i915_private *i915,
* We store the ones which need to be masked as that is what PCode
* actually accepts as a parameter.
*/
- new_bw_state->qgv_points_mask =
- ~(ICL_PCODE_REQ_QGV_PT(qgv_points) |
- ADLS_PCODE_REQ_PSF_PT(psf_points)) &
- icl_qgv_points_mask(i915);
-
+ new_bw_state->qgv_points_mask = icl_prepare_qgv_points_mask(i915,
+ qgv_points,
+ psf_points);
/*
* If the actual mask had changed we need to make sure that
* the commits are serialized(in case this is a nomodeset, nonblocking)