Skip to content

Commit 2924b8c

Browse files
committed
drm/i915: Use plane->get_hw_state() for initial plane fb readout
Since we now have a ->get_hw_state() method for planes, let's use that during the initial plane fb readout. v2: s/plane/i9xx_plane/ etc. (James) Cc: James Ausmus <james.ausmus@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: James Ausmus <james.ausmus@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20171117191917.11506-10-ville.syrjala@linux.intel.com Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
1 parent b1558c7 commit 2924b8c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/gpu/drm/i915/intel_display.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7413,8 +7413,7 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc,
74137413
struct drm_framebuffer *fb;
74147414
struct intel_framebuffer *intel_fb;
74157415

7416-
val = I915_READ(DSPCNTR(i9xx_plane));
7417-
if (!(val & DISPLAY_PLANE_ENABLE))
7416+
if (!plane->get_hw_state(plane))
74187417
return;
74197418

74207419
intel_fb = kzalloc(sizeof(*intel_fb), GFP_KERNEL);
@@ -7427,6 +7426,8 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc,
74277426

74287427
fb->dev = dev;
74297428

7429+
val = I915_READ(DSPCNTR(i9xx_plane));
7430+
74307431
if (INTEL_GEN(dev_priv) >= 4) {
74317432
if (val & DISPPLANE_TILED) {
74327433
plane_config->tiling = I915_TILING_X;
@@ -8442,6 +8443,9 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc,
84428443
struct drm_framebuffer *fb;
84438444
struct intel_framebuffer *intel_fb;
84448445

8446+
if (!plane->get_hw_state(plane))
8447+
return;
8448+
84458449
intel_fb = kzalloc(sizeof(*intel_fb), GFP_KERNEL);
84468450
if (!intel_fb) {
84478451
DRM_DEBUG_KMS("failed to alloc fb\n");
@@ -8453,8 +8457,6 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc,
84538457
fb->dev = dev;
84548458

84558459
val = I915_READ(PLANE_CTL(pipe, plane_id));
8456-
if (!(val & PLANE_CTL_ENABLE))
8457-
goto error;
84588460

84598461
pixel_format = val & PLANE_CTL_FORMAT_MASK;
84608462

0 commit comments

Comments
 (0)