dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	DRI Development <dri-devel@lists.freedesktop.org>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH 6/8] drm/xen: Simplify fb_create
Date: Tue, 19 Nov 2019 22:25:43 +0100	[thread overview]
Message-ID: <20191119212543.GG30416@phenom.ffwll.local> (raw)
In-Reply-To: <4042b233-c219-5e72-adfd-8108b13e9a71@epam.com>

On Fri, Nov 15, 2019 at 10:33:24AM +0000, Oleksandr Andrushchenko wrote:
> On 11/15/19 11:21 AM, Daniel Vetter wrote:
> > The current code is a pretty good wtf moment, since we drop the
> > reference before we use it. It's not a big deal, because a) we only
> > use the pointer, so doesn't blow up and the real reason b) fb->obj[0]
> > already holds a full reference for us.
> >
> > Might as well take the real pointer ins't of complicated games that
> > baffle.
> >
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > Cc: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> > Cc: xen-devel@lists.xenproject.org
> Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>

Thanks for taking a look, pushed to drm-misc-next.
-Daniel

> > ---
> >   drivers/gpu/drm/xen/xen_drm_front_kms.c | 9 +--------
> >   1 file changed, 1 insertion(+), 8 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/xen/xen_drm_front_kms.c b/drivers/gpu/drm/xen/xen_drm_front_kms.c
> > index ff506bc99414..4f34c5208180 100644
> > --- a/drivers/gpu/drm/xen/xen_drm_front_kms.c
> > +++ b/drivers/gpu/drm/xen/xen_drm_front_kms.c
> > @@ -63,14 +63,7 @@ fb_create(struct drm_device *dev, struct drm_file *filp,
> >   	if (IS_ERR_OR_NULL(fb))
> >   		return fb;
> >   
> > -	gem_obj = drm_gem_object_lookup(filp, mode_cmd->handles[0]);
> > -	if (!gem_obj) {
> > -		DRM_ERROR("Failed to lookup GEM object\n");
> > -		ret = -ENOENT;
> > -		goto fail;
> > -	}
> > -
> > -	drm_gem_object_put_unlocked(gem_obj);
> > +	gem_obj = fb->obj[0];
> >   
> >   	ret = xen_drm_front_fb_attach(drm_info->front_info,
> >   				      xen_drm_front_dbuf_to_cookie(gem_obj),

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2019-11-19 21:25 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-15  9:21 [PATCH 0/8] fb_create drive-through cleanups Daniel Vetter
2019-11-15  9:21 ` Daniel Vetter
2019-11-15  9:21 ` [PATCH 1/8] drm/fb: More paranoia in addfb checks Daniel Vetter
2019-11-15 10:49   ` Pekka Paalanen
2019-11-15 12:44   ` [Intel-gfx] " Ville Syrjälä
2019-11-15 15:26     ` Daniel Vetter
2019-11-15  9:21 ` [PATCH 2/8] drm/atmel: ditch fb_create wrapper Daniel Vetter
2019-11-15  9:21   ` Daniel Vetter
2019-11-15  9:33   ` Boris Brezillon
2019-11-19 21:22     ` Daniel Vetter
2019-11-23  8:49       ` Sam Ravnborg
2019-11-23  8:49         ` Sam Ravnborg
2019-11-15  9:21 ` [PATCH 3/8] drm/mediatek: don't open-code drm_gem_fb_create Daniel Vetter
2019-11-15  9:21   ` Daniel Vetter
2019-11-22  7:42   ` CK Hu
2019-11-22 17:09     ` Daniel Vetter
2019-11-22 17:09       ` Daniel Vetter
2019-11-15  9:21 ` [PATCH 4/8] drm/rockchip: Use drm_gem_fb_create_with_dirty Daniel Vetter
2019-11-15  9:21   ` Daniel Vetter
2019-11-27 11:45   ` Andrzej Pietrasiewicz
2019-11-27 11:45     ` Andrzej Pietrasiewicz
2019-11-27 17:33   ` Andrzej Pietrasiewicz
2019-11-27 17:54     ` Daniel Vetter
2019-11-15  9:21 ` [PATCH 5/8] drm/tilcdc: Drop drm_gem_fb_create wrapper Daniel Vetter
2019-11-15  9:21   ` Daniel Vetter
2019-11-15 13:21   ` Jyri Sarha
2019-11-15 13:21     ` Jyri Sarha
2019-11-19 21:25     ` Daniel Vetter
2019-11-19 21:25       ` Daniel Vetter
2019-11-15  9:21 ` [PATCH 6/8] drm/xen: Simplify fb_create Daniel Vetter
2019-11-15 10:33   ` Oleksandr Andrushchenko
2019-11-15 10:33     ` Oleksandr Andrushchenko
2019-11-19 21:25     ` Daniel Vetter [this message]
2019-11-15  9:21 ` [PATCH 7/8] drm/hibmc: Use drm_gem_fb_create Daniel Vetter
2019-11-22  8:09   ` Thomas Zimmermann
2019-11-22  8:16   ` Thomas Zimmermann
2019-11-22  9:12     ` Daniel Vetter
2019-11-15  9:21 ` [PATCH 8/8] drm/todo: Add entry for fb funcs related cleanups Daniel Vetter
2019-11-15  9:21   ` Daniel Vetter
2019-11-20 10:46   ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191119212543.GG30416@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=Oleksandr_Andrushchenko@epam.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox