drm/i915/bw: Extract icl_init_qgv_info()

Simplify the initialization of QGV points info by extracting
the code to initialize the QGV points info from dram info based
on the memory type. This will reduce the complexity of the init
QGV info routine as we will be supporting new memory types in
future platforms.

v2: rebase after Ville's refactoring

v3: patch description updated

Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://patch.msgid.link/20260615203355.218578-5-vinod.govindapillai@intel.com
This commit is contained in:
Vinod Govindapillai 2026-06-15 23:33:52 +03:00
parent 490de57216
commit 6d7e5cebd0

View File

@ -246,12 +246,10 @@ static bool is_y_tile(struct intel_display *display)
return !HAS_4TILE(display);
}
static int icl_get_qgv_points(struct intel_display *display,
const struct dram_info *dram_info,
struct intel_qgv_info *qi)
static int icl_init_qgv_info(struct intel_display *display,
const struct dram_info *dram_info,
struct intel_qgv_info *qi)
{
int i, ret;
qi->num_qgv_points = dram_info->num_qgv_points;
qi->num_psf_points = dram_info->num_psf_gv_points;
@ -323,6 +321,18 @@ static int icl_get_qgv_points(struct intel_display *display,
qi->max_numchannels = 1;
}
return 0;
}
static int icl_get_qgv_points(struct intel_display *display,
const struct dram_info *dram_info,
struct intel_qgv_info *qi)
{
int i, ret;
if (icl_init_qgv_info(display, dram_info, qi))
return -EINVAL;
if (drm_WARN_ON(display->drm,
qi->num_qgv_points > ARRAY_SIZE(qi->points)))
qi->num_qgv_points = ARRAY_SIZE(qi->points);