[PATCH] drm: Use atomic state for FB in legacy ioctls
Daniel Vetter
daniel at ffwll.ch
Tue Dec 13 21:22:33 UTC 2016
On Tue, Dec 13, 2016 at 11:14:47PM +0200, Ville Syrjälä wrote:
> On Tue, Dec 13, 2016 at 07:02:53PM +0000, Daniel Stone wrote:
> > Hi,
> >
> > > On 13 Dec 2016, at 6:48 pm, Ville Syrjälä <ville.syrjala at linux.intel.com> wrote:
> > >
> > >> On Tue, Dec 13, 2016 at 06:19:12PM +0000, Daniel Stone wrote:
> > >> @@ -357,7 +357,10 @@ int drm_mode_getcrtc(struct drm_device *dev,
> > >>
> > >> drm_modeset_lock_crtc(crtc, crtc->primary);
> > >> crtc_resp->gamma_size = crtc->gamma_size;
> > >> - if (crtc->primary->fb)
> > >> +
> > >> + if (crtc->primary->state && crtc->primary->state->fb)
> > >> + crtc_resp->fb_id = crtc->primary->state->fb->base.id;
> > >> + else if (!crtc->primary->state && crtc->primary->fb)
> > >> crtc_resp->fb_id = crtc->primary->fb->base.id;
> > >
> > > I think what we do elsewhere is totally ignore the legacy junk if the
> > > ->state pointer exists.
> >
> > Indeed, hence the negative state check on the second branch; having nested if statements instead seemed unnecessarily unwieldy, but the effect is the same.
>
> My bad. You hid it well though ;)
>
> Reviewed-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
Applied to drm-misc, thanks.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the dri-devel
mailing list