<div dir="ltr">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:<div><br></div><div><a href="https://chromium.googlesource.com/chromiumos/platform/drm-tests/+/master/drm_cursor_test.c">https://chromium.googlesource.com/chromiumos/platform/drm-tests/+/master/drm_cursor_test.c</a><br></div><div><br></div><div>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)?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 7, 2017 at 1:16 AM, Daniel Vetter <span dir="ltr"><<a href="mailto:daniel@ffwll.ch" target="_blank">daniel@ffwll.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Dec 06, 2017 at 07:01:59PM -0800, Gurchetan Singh wrote:<br>
> When a CRTC is disabled and we used an internally created framebuffer,<br>
> this patch disables the cursor plane and drops the reference that was<br>
> introduced when we called drm_internal_framebuffer_<wbr>create.<br>
><br>
> Signed-off-by: Gurchetan Singh <<a href="mailto:gurchetansingh@chromium.org">gurchetansingh@chromium.org</a>><br>
<br>
</span>What kind of bug are you trying to fix here? plane and cursor uapi is that<br>
when you re-enable the crtc, all the planes will be there again. Only<br>
exception is the primary plane, but that's only because set_config both<br>
disables the crtc _and_ the primary plane.<br>
<br>
Without more detail of what's going on I have no idea what exactly you're<br>
trying to achieve here.<br>
-Daniel<br>
<span class="">> ---<br>
>  drivers/gpu/drm/drm_crtc.c | 7 +++++++<br>
>  1 file changed, 7 insertions(+)<br>
><br>
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c<br>
> index f0556e654116..d732cca4879f 100644<br>
> --- a/drivers/gpu/drm/drm_crtc.c<br>
> +++ b/drivers/gpu/drm/drm_crtc.c<br>
> @@ -101,12 +101,19 @@ EXPORT_SYMBOL(drm_crtc_from_<wbr>index);<br>
>   */<br>
>  int drm_crtc_force_disable(struct drm_crtc *crtc)<br>
>  {<br>
> +     struct drm_framebuffer *fb;<br>
>       struct drm_mode_set set = {<br>
>               .crtc = crtc,<br>
>       };<br>
><br>
>       WARN_ON(drm_drv_uses_atomic_<wbr>modeset(crtc->dev));<br>
><br>
> +     if (crtc->cursor && crtc->cursor->fb && crtc->cursor->fb->internal) {<br>
> +             fb = crtc->cursor->fb;<br>
> +             drm_plane_force_disable(crtc-><wbr>cursor);<br>
> +             drm_framebuffer_unreference(<wbr>fb);<br>
> +     }<br>
> +<br>
>       return drm_mode_set_config_internal(&<wbr>set);<br>
>  }<br>
>  EXPORT_SYMBOL(drm_crtc_force_<wbr>disable);<br>
> --<br>
> 2.13.5<br>
><br>
</span>> ______________________________<wbr>_________________<br>
> dri-devel mailing list<br>
> <a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.<wbr>org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/dri-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/dri-devel</a><br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Daniel Vetter<br>
Software Engineer, Intel Corporation<br>
<a href="http://blog.ffwll.ch" rel="noreferrer" target="_blank">http://blog.ffwll.ch</a><br>
</font></span></blockquote></div><br></div>