mbox series

[v2,0/4] Fix various buffer mapping/import issues

Message ID 20240628200729.754669-1-zack.rusin@broadcom.com (mailing list archive)
Headers show
Series Fix various buffer mapping/import issues | expand

Message

Zack Rusin June 28, 2024, 8:07 p.m. UTC
This small series fixes all known prime/dumb_buffer/buffer dirty
tracking issues. Fixing of dumb-buffers turned out to be a lot more
complex than I wanted it to be. There's not much that can be done
there because the driver has to support old userspace (our Xorg driver
expects those to not be gem buffers and special cases a bunch of
functionality) and new userspace (which expects the handles to be
gem buffers, at least to issue GEM_CLOSE).

The third patch deals with it by making the objects returned from
dumb-buffers both (raw buffers and surfaces referenced by the same
handle), which always works and doesn't require any changes in userspace.

This fixes the known KDE (KWin's) buffer rendering issues.

v2: Fix compute_crc in the second patch, as spotted by Martin

Zack Rusin (4):
  drm/vmwgfx: Fix a deadlock in dma buf fence polling
  drm/vmwgfx: Make sure the screen surface is ref counted
  drm/vmwgfx: Fix handling of dumb buffers
  drm/vmwgfx: Add basic support for external buffers

 drivers/gpu/drm/vmwgfx/vmw_surface_cache.h |  10 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_bo.c         | 127 +++---
 drivers/gpu/drm/vmwgfx/vmwgfx_bo.h         |  15 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.h        |  40 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_fence.c      |  26 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_gem.c        |  62 ++-
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c        | 453 +++++++--------------
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.h        |  17 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c        |  14 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_prime.c      |  32 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_resource.c   |  27 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c       |  33 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c       | 145 +++----
 drivers/gpu/drm/vmwgfx/vmwgfx_surface.c    | 277 ++++++++++++-
 drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c       |  40 +-
 15 files changed, 788 insertions(+), 530 deletions(-)

Comments

Martin Krastev July 1, 2024, 12:23 p.m. UTC | #1
On Fri, Jun 28, 2024 at 11:07 PM Zack Rusin <zack.rusin@broadcom.com> wrote:
>
> This small series fixes all known prime/dumb_buffer/buffer dirty
> tracking issues. Fixing of dumb-buffers turned out to be a lot more
> complex than I wanted it to be. There's not much that can be done
> there because the driver has to support old userspace (our Xorg driver
> expects those to not be gem buffers and special cases a bunch of
> functionality) and new userspace (which expects the handles to be
> gem buffers, at least to issue GEM_CLOSE).
>
> The third patch deals with it by making the objects returned from
> dumb-buffers both (raw buffers and surfaces referenced by the same
> handle), which always works and doesn't require any changes in userspace.
>
> This fixes the known KDE (KWin's) buffer rendering issues.
>
> v2: Fix compute_crc in the second patch, as spotted by Martin
>
> Zack Rusin (4):
>   drm/vmwgfx: Fix a deadlock in dma buf fence polling
>   drm/vmwgfx: Make sure the screen surface is ref counted
>   drm/vmwgfx: Fix handling of dumb buffers
>   drm/vmwgfx: Add basic support for external buffers
>
>  drivers/gpu/drm/vmwgfx/vmw_surface_cache.h |  10 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_bo.c         | 127 +++---
>  drivers/gpu/drm/vmwgfx/vmwgfx_bo.h         |  15 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_drv.h        |  40 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_fence.c      |  26 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_gem.c        |  62 ++-
>  drivers/gpu/drm/vmwgfx/vmwgfx_kms.c        | 453 +++++++--------------
>  drivers/gpu/drm/vmwgfx/vmwgfx_kms.h        |  17 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c        |  14 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_prime.c      |  32 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_resource.c   |  27 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c       |  33 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c       | 145 +++----
>  drivers/gpu/drm/vmwgfx/vmwgfx_surface.c    | 277 ++++++++++++-
>  drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c       |  40 +-
>  15 files changed, 788 insertions(+), 530 deletions(-)
>
> --
> 2.40.1
>

To the series:
Reviewed-by: Martin Krastev <martin.krastev@broadcom.com>

Regards,
Martin
Maaz Mombasawala July 1, 2024, 10:43 p.m. UTC | #2
On 6/28/24 13:07, Zack Rusin wrote:
> This small series fixes all known prime/dumb_buffer/buffer dirty
> tracking issues. Fixing of dumb-buffers turned out to be a lot more
> complex than I wanted it to be. There's not much that can be done
> there because the driver has to support old userspace (our Xorg driver
> expects those to not be gem buffers and special cases a bunch of
> functionality) and new userspace (which expects the handles to be
> gem buffers, at least to issue GEM_CLOSE).
> 
> The third patch deals with it by making the objects returned from
> dumb-buffers both (raw buffers and surfaces referenced by the same
> handle), which always works and doesn't require any changes in userspace.
> 
> This fixes the known KDE (KWin's) buffer rendering issues.
> 
> v2: Fix compute_crc in the second patch, as spotted by Martin
> 
> Zack Rusin (4):
>   drm/vmwgfx: Fix a deadlock in dma buf fence polling
>   drm/vmwgfx: Make sure the screen surface is ref counted
>   drm/vmwgfx: Fix handling of dumb buffers
>   drm/vmwgfx: Add basic support for external buffers
> 
>  drivers/gpu/drm/vmwgfx/vmw_surface_cache.h |  10 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_bo.c         | 127 +++---
>  drivers/gpu/drm/vmwgfx/vmwgfx_bo.h         |  15 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_drv.h        |  40 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_fence.c      |  26 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_gem.c        |  62 ++-
>  drivers/gpu/drm/vmwgfx/vmwgfx_kms.c        | 453 +++++++--------------
>  drivers/gpu/drm/vmwgfx/vmwgfx_kms.h        |  17 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c        |  14 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_prime.c      |  32 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_resource.c   |  27 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c       |  33 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c       | 145 +++----
>  drivers/gpu/drm/vmwgfx/vmwgfx_surface.c    | 277 ++++++++++++-
>  drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c       |  40 +-
>  15 files changed, 788 insertions(+), 530 deletions(-)
> 


For the series - LGTM!

Reviewed-by: Maaz Mombasawala <maaz.mombasawala@broadcom.com>

Thanks,

Maaz Mombasawala <maaz.mombasawala@broadcom.com>