On Fri, Oct 13, 2017 at 04:58:38PM +0300, Ville Syrjala wrote: > From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> > > Since we now have a ->get_hw_state() method for planes, let's use > that during the initial plane fb readout. > > Cc: Daniel Vetter <daniel.vetter@xxxxxxxx> > Suggested-by: Daniel Vetter <daniel.vetter@xxxxxxxx> > Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> Reviewed-by: James Ausmus <james.ausmus@xxxxxxxxx> > --- > drivers/gpu/drm/i915/intel_display.c | 30 ++++++++++++++++-------------- > 1 file changed, 16 insertions(+), 14 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c > index 2da670628e35..268d320690f4 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -7465,19 +7465,20 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc, > struct drm_framebuffer *fb; > struct intel_framebuffer *intel_fb; > > + if (!plane->get_hw_state(plane)) > + return; > + > + intel_fb = kzalloc(sizeof(*intel_fb), GFP_KERNEL); > + if (!intel_fb) { > + DRM_DEBUG_KMS("failed to alloc fb\n"); > + return; > + } > + > + fb = &intel_fb->base; > + > + fb->dev = dev; > + > val = I915_READ(DSPCNTR(plane_id)); > - if (!(val & DISPLAY_PLANE_ENABLE)) > - return; > - > - intel_fb = kzalloc(sizeof(*intel_fb), GFP_KERNEL); > - if (!intel_fb) { > - DRM_DEBUG_KMS("failed to alloc fb\n"); > - return; > - } > - > - fb = &intel_fb->base; > - > - fb->dev = dev; > > if (INTEL_GEN(dev_priv) >= 4) { > if (val & DISPPLANE_TILED) { > @@ -8496,6 +8497,9 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc, > struct drm_framebuffer *fb; > struct intel_framebuffer *intel_fb; > > + if (!plane->get_hw_state(plane)) > + return; > + > intel_fb = kzalloc(sizeof(*intel_fb), GFP_KERNEL); > if (!intel_fb) { > DRM_DEBUG_KMS("failed to alloc fb\n"); > @@ -8507,8 +8511,6 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc, > fb->dev = dev; > > val = I915_READ(PLANE_CTL(pipe, plane_id)); > - if (!(val & PLANE_CTL_ENABLE)) > - goto error; > > pixel_format = val & PLANE_CTL_FORMAT_MASK; > fourcc = skl_format_to_fourcc(pixel_format, > -- > 2.13.6 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@xxxxxxxxxxxxxxxxxxxxx > https://lists.freedesktop.org/mailman/listinfo/intel-gfx _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx