drm/i915/: Initialise trans_min for skl_compute_transition_wm()
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 15 Nov 2017 10:50:35 +0000 (10:50 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 19 Feb 2018 20:38:52 +0000 (20:38 +0000)
clang spots

drivers/gpu/drm/i915/intel_pm.c:4655:6: warning: variable 'trans_min' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
        if (INTEL_GEN(dev_priv) >= 10)

but fortunately for us we skip the function unless on a gen10+ device.
However, to keep the function generic in case we do want to re-enable it
for gen9 again, initialise trans_min to 0.

References: ca47667f523e ("drm/i915/gen10: Calculate and enable transition WM")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mahesh Kumar <mahesh1.kumar@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171115105036.1094-3-chris@chris-wilson.co.uk
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/i915/intel_pm.c

index 158d00fdf5494175b7c146c9a1380566277c47b7..a88f0f2136042ae523636d660b83045a594cd19a 100644 (file)
@@ -4713,6 +4713,7 @@ static void skl_compute_transition_wm(struct intel_crtc_state *cstate,
        if (!dev_priv->ipc_enabled)
                goto exit;
 
+       trans_min = 0;
        if (INTEL_GEN(dev_priv) >= 10)
                trans_min = 4;