drm/i915: Refactor max WM level
Pull the expected max WM level determinations out to a separate function. Will have another user soon. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Родитель
8de123a5d8
Коммит
ad0d6dc485
|
@ -2561,19 +2561,22 @@ static void intel_fixup_cur_wm_latency(struct drm_device *dev, uint16_t wm[5])
|
||||||
wm[3] *= 2;
|
wm[3] *= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int ilk_wm_max_level(const struct drm_device *dev)
|
||||||
|
{
|
||||||
|
/* how many WM levels are we expecting */
|
||||||
|
if (IS_HASWELL(dev))
|
||||||
|
return 4;
|
||||||
|
else if (INTEL_INFO(dev)->gen >= 6)
|
||||||
|
return 3;
|
||||||
|
else
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
static void intel_print_wm_latency(struct drm_device *dev,
|
static void intel_print_wm_latency(struct drm_device *dev,
|
||||||
const char *name,
|
const char *name,
|
||||||
const uint16_t wm[5])
|
const uint16_t wm[5])
|
||||||
{
|
{
|
||||||
int level, max_level;
|
int level, max_level = ilk_wm_max_level(dev);
|
||||||
|
|
||||||
/* how many WM levels are we expecting */
|
|
||||||
if (IS_HASWELL(dev))
|
|
||||||
max_level = 4;
|
|
||||||
else if (INTEL_INFO(dev)->gen >= 6)
|
|
||||||
max_level = 3;
|
|
||||||
else
|
|
||||||
max_level = 2;
|
|
||||||
|
|
||||||
for (level = 0; level <= max_level; level++) {
|
for (level = 0; level <= max_level; level++) {
|
||||||
unsigned int latency = wm[level];
|
unsigned int latency = wm[level];
|
||||||
|
|
Загрузка…
Ссылка в новой задаче