All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gurchetan Singh <gurchetansingh@chromium.org>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: ML dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 2/2] drm: clean up internally created framebuffer on CRTC disable
Date: Fri, 8 Dec 2017 14:17:39 -0800	[thread overview]
Message-ID: <CAAfnVBndT9nNvFYo3CH2WkLnW2xV5DPqWMi-yLpMzUriXG4TBw@mail.gmail.com> (raw)
In-Reply-To: <20171207091648.iyxv7hzznpswgenh@phenom.ffwll.local>


[-- Attachment #1.1: Type: text/plain, Size: 2575 bytes --]

The problem I'm trying to solve is that the internal cursor fb is leaky and
even present after closing the drm driver fd.  This can be seen by running
modetest after this test case:

https://chromium.googlesource.com/chromiumos/platform/drm-tests/+/master/drm_cursor_test.c

However, as you mentioned, the approach in this patch is not consistent
with the uapi.  Adding the internal fb to file_priv->fbs is another
approach, though I haven't gotten it to work in 100% of all cases.  What do
you recommend (if anything at all)?

On Thu, Dec 7, 2017 at 1:16 AM, Daniel Vetter <daniel@ffwll.ch> wrote:

> On Wed, Dec 06, 2017 at 07:01:59PM -0800, Gurchetan Singh wrote:
> > When a CRTC is disabled and we used an internally created framebuffer,
> > this patch disables the cursor plane and drops the reference that was
> > introduced when we called drm_internal_framebuffer_create.
> >
> > Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
>
> What kind of bug are you trying to fix here? plane and cursor uapi is that
> when you re-enable the crtc, all the planes will be there again. Only
> exception is the primary plane, but that's only because set_config both
> disables the crtc _and_ the primary plane.
>
> Without more detail of what's going on I have no idea what exactly you're
> trying to achieve here.
> -Daniel
> > ---
> >  drivers/gpu/drm/drm_crtc.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> > index f0556e654116..d732cca4879f 100644
> > --- a/drivers/gpu/drm/drm_crtc.c
> > +++ b/drivers/gpu/drm/drm_crtc.c
> > @@ -101,12 +101,19 @@ EXPORT_SYMBOL(drm_crtc_from_index);
> >   */
> >  int drm_crtc_force_disable(struct drm_crtc *crtc)
> >  {
> > +     struct drm_framebuffer *fb;
> >       struct drm_mode_set set = {
> >               .crtc = crtc,
> >       };
> >
> >       WARN_ON(drm_drv_uses_atomic_modeset(crtc->dev));
> >
> > +     if (crtc->cursor && crtc->cursor->fb &&
> crtc->cursor->fb->internal) {
> > +             fb = crtc->cursor->fb;
> > +             drm_plane_force_disable(crtc->cursor);
> > +             drm_framebuffer_unreference(fb);
> > +     }
> > +
> >       return drm_mode_set_config_internal(&set);
> >  }
> >  EXPORT_SYMBOL(drm_crtc_force_disable);
> > --
> > 2.13.5
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
>

[-- Attachment #1.2: Type: text/html, Size: 3876 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-12-08 22:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-07  3:01 [PATCH 2/2] drm: clean up internally created framebuffer on CRTC disable Gurchetan Singh
2017-12-07  9:16 ` Daniel Vetter
2017-12-08 22:17   ` Gurchetan Singh [this message]
2017-12-11  9:13     ` 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=CAAfnVBndT9nNvFYo3CH2WkLnW2xV5DPqWMi-yLpMzUriXG4TBw@mail.gmail.com \
    --to=gurchetansingh@chromium.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.