gfx: drv: Check framebuffer depth with HDMI
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 20 Mar 2012 14:46:18 +0000 (16:46 +0200)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Tue, 3 Jul 2012 09:30:42 +0000 (12:30 +0300)
The HDMI code takes an entirely separate code path for mode setting.
Mode the framebuffer depth check earlier, so that the HDMI case is
checked as well.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
drivers/staging/mrst/drv/psb_intel_display.c

index 2ad83f4..e2e4a56 100644 (file)
@@ -859,7 +859,7 @@ void mdfld__intel_plane_set_alpha(int enable)
        REG_WRITE(dspcntr_reg, dspcntr);
 }
 
-static int check_fb(struct drm_framebuffer *fb)
+static int check_fb(const struct drm_framebuffer *fb)
 {
        if (!fb)
                return 0;
@@ -1549,6 +1549,10 @@ static int mdfld_crtc_mode_set(struct drm_crtc *crtc,
 
        PSB_DEBUG_ENTRY("pipe = 0x%x\n", pipe);
 
+       ret = check_fb(crtc->fb);
+       if (ret)
+               return ret;
+
        if (pipe == 1) {
                if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, true))
                        return 0;
@@ -1600,10 +1604,6 @@ static int mdfld_crtc_mode_set(struct drm_crtc *crtc,
                return 0;
        }
 
-       ret = check_fb(crtc->fb);
-       if (ret)
-               return ret;
-
        PSB_DEBUG_ENTRY("adjusted_hdisplay = %d\n",
                 adjusted_mode->hdisplay);
        PSB_DEBUG_ENTRY("adjusted_vdisplay = %d\n",