DRI3 v1.1: modifiers and multi-plane

Submitted by Louis-Francis Ratté-Boulianne on July 14, 2017, 4:47 a.m.

Details

Reviewer None
Submitted July 14, 2017, 4:47 a.m.
Last Updated Feb. 27, 2018, 4:53 p.m.
Revision 7
Root msg-id(s): 20170714044800.26535-1-lfrb@collabora.com
20170830044542.27923-1-lfrb@collabora.com
20170927051913.31462-1-lfrb@collabora.com
20171016050301.29948-1-lfrb@collabora.com
20171106213052.29587-1-lfrb@collabora.com
20180216041547.13531-1-lfrb@collabora.com
20180227165252.9845-1-lfrb@collabora.com

Cover Letter(s)

Revision 1
      Hi,

For context, please refer to last submission email:
https://lists.x.org/archives/xorg-devel/2017-June/053854.html

This new revision should fix comments made by Michel Dänzer and
Emil Velikov. The main differences are:

 - Keep the old pixmap_from_fd and fd_from_pixmap hooks so
   out-of-branch drivers can still work.
 - UAPI struct declaration is no longer included, we rely on
   the relevent header file to be shipped by libdrm once the
   kernel get support for formats/modifiers blob.
 - Patches are cleaner and should be easier to review.
 - Plus a lot of small fixes proposed by Emil.

There are still some FIXME and questions in there. Any opinion
about those is welcome.

Daniel Stone (1):
  Build: Use dri3proto CFLAGS

Louis-Francis Ratté-Boulianne (12):
  dri3: Add multi-planar/modifier buffer requests
  glamor: Implement PixmapFromBuffers and BuffersFromPixmap
  glamor: Implement GetSupportedFormats and GetSupportedModifiers
  dri3: Enable DRI3 version 1.1
  glamor: Use gbm_bo_create_with_modifiers for internal pixmap
    allocation
  modesetting: Add helper functions to retrieve DRM properties
  modesetting: Use atomic modesetting API for pageflip if available
  modesetting: Ignore CRTC_ID property in RandR properties
  modesetting: Add support for multi-plane pixmaps when page-flipping
  modesetting: Use atomic modesetting to configure output/CRTCs
  modesetting: Get supported formats/modifiers for scanout
  modesetting: Create scanout buffers using supported modifiers

 configure.ac                                     |   13 +
 dri3/dri3.c                                      |   92 ++
 dri3/dri3.h                                      |   47 +-
 dri3/dri3_priv.h                                 |   27 +-
 dri3/dri3_request.c                              |  448 +++++++++-
 dri3/dri3_screen.c                               |  173 +++-
 glamor/glamor.c                                  |   93 +-
 glamor/glamor.h                                  |   81 +-
 glamor/glamor_egl.c                              |  286 +++++-
 glamor/glamor_egl.h                              |   84 ++
 glamor/glamor_egl_ext.h                          |   65 ++
 glamor/glamor_egl_stubs.c                        |    7 +-
 glamor/glamor_priv.h                             |   10 +
 hw/xfree86/drivers/modesetting/driver.c          |    6 +
 hw/xfree86/drivers/modesetting/driver.h          |    1 +
 hw/xfree86/drivers/modesetting/drmmode_display.c | 1004 +++++++++++++++++++---
 hw/xfree86/drivers/modesetting/drmmode_display.h |   80 ++
 hw/xfree86/drivers/modesetting/pageflip.c        |   73 +-
 hw/xwayland/.gitignore                           |    2 +
 hw/xwayland/Makefile.am                          |    9 +-
 hw/xwayland/xwayland-glamor.c                    |  389 +++++++--
 hw/xwayland/xwayland.c                           |    6 +-
 hw/xwayland/xwayland.h                           |   19 +-
 include/dix-config.h.in                          |    9 +
 include/protocol-versions.h                      |    2 +-
 25 files changed, 2757 insertions(+), 269 deletions(-)
 create mode 100644 glamor/glamor_egl_ext.h
    
Revision 2
      Hi,

This is the RFC v2 for DRI3 v1.1 (minus the DMA fence part of it). For
context, please see:

https://lists.x.org/archives/xorg-devel/2017-June/053854.html

The main changes apart from bug fixes and cleanup are:

 - DRI3 advertised version is not bumped in this serie. It will wait
   for all the functions to be implemented (i.e. DMA fences).

 - Don't use a new DRM format type but just old dumb depth/bpp when
   creating a pixmap and requesting supported modifiers. That also means
   that DRI3 GetSupportedFormats is no longer needed.

 - Use GBM instead of relying on EGL extension to create multi-planes
   pixmaps.

The Git repositories containing all of these changes and related ones are
(branch: rfc/2017-08/dri3-v1.1)

git://git.collabora.com/git/user/lfrb/dri3proto
git://git.collabora.com/git/user/lfrb/xcb-proto
git://git.collabora.com/git/user/lfrb/mesa
git://git.collabora.com/git/user/lfrb/xserver

I will appreciate any comment to make it better!

Thanks,
Louis-Francis
    
Revision 3
      Hello,

This is the RFC v3 for DRI3 v1.1  (X11 modifiers and multi-plane).
For context, please check previous submissions:

https://lists.x.org/archives/xorg-devel/2017-June/053854.html
https://lists.x.org/archives/xorg-devel/2017-August/054436.html

The main changes in this iteration are:

 - Completely remove any reference to DMA fences. That will be
   part of DRI3 v1.2 instead.

 - DRI3GetModifiers now sends modifiers in two different sets:
     * Drawable specific: they should be prioritized by clients
       as they are more optimal for the given drawable.
     * Screen: they should work for all drawables on that
       screen.

 - Add PresentWindowCrtcNotify event that is sent when a window
   is presented on a different target CRTC than the last
   presentation. It allows clients to re-fetch the modifiers
   as the drawable-specific (i.e. optimal) ones might have
   changed.

 - Filter out multi-plane modifier (e.g. i965 CCS format) from
   being used to allocate internal buffers as that would most
   probably cause issues with synchronization of planes.

Thanks,

Louis-Francis
    
Revision 4
      Hello,

This is the RFC v4 for DRI3 v1.1  (X11 modifiers and multi-plane).
For context, please check previous submissions:

https://lists.x.org/archives/xorg-devel/2017-June/053854.html
https://lists.x.org/archives/xorg-devel/2017-August/054436.html
https://lists.x.org/archives/xorg-devel/2017-September/054776.html

The main change in this iteration is:

 - Remove PresentWindowCrtcNotify event and replace with
   PresentCompleteModeSuboptimalCopy mode. When receiving Complete
   event with that mode, the client should try to allocate buffers
   using a different format/modifier. 

Thanks,

Louis-Francis
    
Revision 5
      Hello,

This is the RFC v5 for DRI3 v1.1  (X11 modifiers and multi-plane).
For context, please check previous submissions:

https://lists.x.org/archives/xorg-devel/2017-June/053854.html
https://lists.x.org/archives/xorg-devel/2017-August/054436.html
https://lists.x.org/archives/xorg-devel/2017-September/054776.html
https://lists.x.org/archives/xorg-devel/2017-October/054899.html

The main changes in this iteration are:

 - Add an PresentPixmap() option to let know the server that the
   client understands what the PresentCompleteModeSuboptimalCopy
   flag means.

 - Fix a FD leak (Thanks Eero Tamminen).

 - Make sure that everything still works for EGL/GBM drivers not
   supporting modifiers.

Here are the repositories:

https://gitlab.collabora.com/lfrb/dri3proto/commits/rfc/2017-10/dri3-v1.1
https://gitlab.collabora.com/lfrb/presentproto/commits/rfc/2017-11/dri3-v1.1
https://gitlab.collabora.com/lfrb/xserver/commits/rfc/2017-11/dri3-v1.1

Thanks,

Louis-Francis
    
Revision 6
      Hello,

This is the RFC v6 for DRI3 v1.1  (X11 modifiers and multi-plane).
For context, please check previous submissions:

https://lists.x.org/archives/xorg-devel/2017-June/053854.html
https://lists.x.org/archives/xorg-devel/2017-August/054436.html
https://lists.x.org/archives/xorg-devel/2017-September/054776.html
https://lists.x.org/archives/xorg-devel/2017-October/054899.html
https://lists.x.org/archives/xorg-devel/2017-November/055170.html

The main changes in this iteration are:

 - Re-enable multiplane modifiers (e.g. Intel CCS)

 - Don't hardcode GBM surface format when using modifiers

 - Don't conflict with new DRM properties helper

The MESA-side of DRI3 v1.1 has been re-submitted today:

https://lists.freedesktop.org/archives/mesa-dev/2018-February/185703.html

Thanks,

Louis-Francis
    
Revision 7
      Hello,

This is the RFC v7 for DRI3 v1.1  (X11 modifiers and multi-plane).
For context, please check previous submissions:

https://lists.x.org/archives/xorg-devel/2017-June/053854.html
https://lists.x.org/archives/xorg-devel/2017-August/054436.html
https://lists.x.org/archives/xorg-devel/2017-September/054776.html
https://lists.x.org/archives/xorg-devel/2017-October/054899.html
https://lists.x.org/archives/xorg-devel/2017-November/055170.html
https://lists.x.org/archives/xorg-devel/2018-February/055932.html

The main changes in this iteration are:

 - Add some details in dri3proto.txt

 - Merge proto changes to xorgproto

 - Fix compilation issues in some commits

Thanks,

Louis-Francis
    

Revisions

Patches [mbox patches] [mbox cover letter] [mbox cover letter and patches]

# Name Submitter State TC A F R T
[RFC,v2,01/13] Build: Use dri3proto CFLAGS Louis-Francis Ratté-Boulianne Superseded 0
[RFC,v2,02/13] dri3: Add multi-planar/modifier buffer requests Louis-Francis Ratté-Boulianne Superseded 0
[RFC,v2,03/13] glamor: Implement PixmapFromBuffers and BuffersFromPixmap Louis-Francis Ratté-Boulianne Superseded 0
[RFC,v2,04/13] glamor: Implement GetSupportedFormats and GetSupportedModifiers Louis-Francis Ratté-Boulianne Superseded 0
[RFC,v2,05/13] dri3: Enable DRI3 version 1.1 Louis-Francis Ratté-Boulianne Superseded 0
[RFC,v2,06/13] glamor: Use gbm_bo_create_with_modifiers for internal pixmap allocation Louis-Francis Ratté-Boulianne Superseded 0
[RFC,v2,07/13] modesetting: Add helper functions to retrieve DRM properties Louis-Francis Ratté-Boulianne Superseded 0
[RFC,v2,08/13] modesetting: Use atomic modesetting API for pageflip if available Louis-Francis Ratté-Boulianne Superseded 0
[RFC,v2,09/13] modesetting: Ignore CRTC_ID property in RandR properties Louis-Francis Ratté-Boulianne Superseded 0
[RFC,v2,10/13] modesetting: Add support for multi-plane pixmaps when page-flipping Louis-Francis Ratté-Boulianne Superseded 0
[RFC,v2,11/13] modesetting: Use atomic modesetting to configure output/CRTCs Louis-Francis Ratté-Boulianne Superseded 0
[RFC,v2,12/13] modesetting: Get supported formats/modifiers for scanout Louis-Francis Ratté-Boulianne Superseded 0
[RFC,v2,13/13] modesetting: Create scanout buffers using supported modifiers Louis-Francis Ratté-Boulianne Superseded 0

Patches [mbox patches] [mbox cover letter] [mbox cover letter and patches]

# Name Submitter State TC A F R T
[RFC,dri3proto,v3,01/14] Add modifier/multi-plane requests, bump to v1.1 Louis-Francis Ratté-Boulianne Superseded 0
[RFC,presentproto,v3,02/14] Add PresentWindowCrtcNotify event Louis-Francis Ratté-Boulianne Superseded 1
[RFC,xserver,v3,03/14] dri3: Add multi-planar/modifier buffer requests Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v3,04/14] modesetting: Refactor xf86FindCrtcCoveringDrawable out of the driver Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v3,05/14] modesetting: Use atomic modesetting API for pageflip if available Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v3,06/14] modesetting: Add support for multi-plane pixmaps when page-flipping Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v3,07/14] modesetting: Use atomic modesetting to configure output/CRTCs Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v3,08/14] modesetting: Get supported formats/modifiers for scanout Louis-Francis Ratté-Boulianne Accepted 0
[RFC,xserver,v3,09/14] modesetting: Create scanout buffers using supported modifiers Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v3,10/14] glamor: Implement PixmapFromBuffers and BuffersFromPixmap Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v3,11/14] glamor: Implement GetSupportedModifiers Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v3,12/14] glamor: Use gbm_bo_create_with_modifiers for internal pixmap allocation Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v3,13/14] present: Send a PresentWindowCrtcNotify event appropriately Louis-Francis Ratté-Boulianne Superseded 6
[RFC,xserver,v3,14/14] dri3: Enable DRI3 version 1.1 Louis-Francis Ratté-Boulianne Superseded 0

Patches [mbox patches] [mbox cover letter] [mbox cover letter and patches]

# Name Submitter State TC A F R T
[RFC,dri3proto,v4,01/14] Add modifier/multi-plane requests, bump to v1.1 Louis-Francis Ratté-Boulianne Superseded 0
[RFC,presentproto,v4,02/14] Add PresentCompleteModeSuboptimalCopy flag for Complete event Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v4,03/14] dri3: Add multi-planar/modifier buffer requests Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v4,04/14] present: Send PresentCompleteModeSuboptimalCopy appropriately Louis-Francis Ratté-Boulianne Superseded 1
[RFC,xserver,v4,05/14] modesetting: Use atomic modesetting API for pageflip if available Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v4,06/14] modesetting: Add support for multi-plane pixmaps when page-flipping Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v4,07/14] modesetting: Use atomic modesetting to configure output/CRTCs Louis-Francis Ratté-Boulianne Superseded 1
[RFC,xserver,v4,08/14] modesetting: Get supported formats/modifiers for scanout Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v4,09/14] modesetting: Create scanout buffers using supported modifiers Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v4,10/14] modesetting: Check if buffer format is supported when flipping Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v4,11/14] glamor: Implement PixmapFromBuffers and BuffersFromPixmap Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v4,12/14] glamor: Implement GetSupportedModifiers Louis-Francis Ratté-Boulianne Superseded 1
[RFC,xserver,v4,13/14] glamor: Use gbm_bo_create_with_modifiers for internal pixmap allocation Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v4,14/14] dri3: Enable DRI3 version 1.1 Louis-Francis Ratté-Boulianne Superseded 0

Patches [mbox patches] [mbox cover letter] [mbox cover letter and patches]

# Name Submitter State TC A F R T
[RFC,dri3proto,v5,01/14] Add modifier/multi-plane requests, bump to v1.1 Louis-Francis Ratté-Boulianne RFC 0
[RFC,presentproto,v5,02/14] Add PresentCompleteModeSuboptimalCopy flag for Complete event Louis-Francis Ratté-Boulianne RFC 0
[RFC,xserver,v5,03/14] dri3: Add multi-planar/modifier buffer requests Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v5,04/14] present: Send PresentCompleteModeSuboptimalCopy appropriately Louis-Francis Ratté-Boulianne Superseded 1
[RFC,xserver,v5,05/14] modesetting: Use atomic modesetting API for pageflip if available Louis-Francis Ratté-Boulianne Superseded 1
[RFC,xserver,v5,06/14] modesetting: Add support for multi-plane pixmaps when page-flipping Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v5,07/14] modesetting: Use atomic modesetting to configure output/CRTCs Louis-Francis Ratté-Boulianne Superseded 2
[RFC,xserver,v5,08/14] modesetting: Get supported formats/modifiers for scanout Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v5,09/14] modesetting: Create scanout buffers using supported modifiers Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v5,10/14] modesetting: Check if buffer format is supported when flipping Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v5,11/14] glamor: Implement PixmapFromBuffers and BuffersFromPixmap Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v5,12/14] glamor: Implement GetSupportedModifiers Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v5,13/14] glamor: Use gbm_bo_create_with_modifiers for internal pixmap allocation Louis-Francis Ratté-Boulianne Superseded 1
[RFC,xserver,v5,14/14] dri3: Enable DRI3 version 1.1 Louis-Francis Ratté-Boulianne Superseded 0

Patches [mbox patches] [mbox cover letter] [mbox cover letter and patches]

# Name Submitter State TC A F R T
[RFC,dri3proto,v6,01/14] Add modifier/multi-plane requests, bump to v1.1 Louis-Francis Ratté-Boulianne RFC 5
[RFC,presentproto,v6,02/14] Add PresentCompleteModeSuboptimalCopy flag for Complete event Louis-Francis Ratté-Boulianne RFC 1 1
[RFC,xserver,v6,03/14] dri3: Add multi-planar/modifier buffer requests Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v6,04/14] present: Send PresentCompleteModeSuboptimalCopy appropriately Louis-Francis Ratté-Boulianne Accepted 0 1
[RFC,xserver,v6,05/14] modesetting: Use atomic modesetting API for pageflip if available Louis-Francis Ratté-Boulianne Superseded 1 1
[RFC,xserver,v6,06/14] modesetting: Add support for multi-plane pixmaps when page-flipping Louis-Francis Ratté-Boulianne Accepted 0 1
[RFC,xserver,v6,07/14] modesetting: Use atomic modesetting to configure output/CRTCs Louis-Francis Ratté-Boulianne Superseded 0 1
[RFC,xserver,v6,08/14] modesetting: Get supported formats/modifiers for scanout Louis-Francis Ratté-Boulianne Superseded 0 1
[RFC,xserver,v6,09/14] modesetting: Create scanout buffers using supported modifiers Louis-Francis Ratté-Boulianne Superseded 1 1
[RFC,xserver,v6,10/14] modesetting: Check if buffer format is supported when flipping Louis-Francis Ratté-Boulianne Superseded 0 1
[RFC,xserver,v6,11/14] glamor: Implement PixmapFromBuffers and BuffersFromPixmap Louis-Francis Ratté-Boulianne Superseded 0 1
[RFC,xserver,v6,12/14] glamor: Implement GetSupportedModifiers Louis-Francis Ratté-Boulianne Superseded 0 1
[RFC,xserver,v6,13/14] glamor: Use gbm_bo_create_with_modifiers for internal pixmap allocation Louis-Francis Ratté-Boulianne Superseded 0 1
[RFC,xserver,v6,14/14] dri3: Enable DRI3 version 1.1 Louis-Francis Ratté-Boulianne Superseded 0 1

Patches [mbox patches] [mbox cover letter] [mbox cover letter and patches]

# Name Submitter State TC A F R T
[RFC,xserver,v7,1/2] dri3: Add modifier/multi-plane requests, bump to v1.1 Louis-Francis Ratté-Boulianne Superseded 1
[RFC,xorgproto,v7,02/14] presentproto: PresentCompleteModeSuboptimalCopy flag Louis-Francis Ratté-Boulianne Superseded 3 1
[RFC,xserver,v7,03/14] dri3: Add multi-planar/modifier buffer requests Louis-Francis Ratté-Boulianne Superseded 0
[RFC,xserver,v7,04/14] present: Send PresentCompleteModeSuboptimalCopy appropriately Louis-Francis Ratté-Boulianne Superseded 0 1
[RFC,xserver,v7,05/14] modesetting: Use atomic modesetting API for pageflip if available Louis-Francis Ratté-Boulianne Superseded 0 1
[RFC,xserver,v7,06/14] modesetting: Add support for multi-plane pixmaps when page-flipping Louis-Francis Ratté-Boulianne Superseded 0 1
[RFC,xserver,v7,07/14] modesetting: Use atomic modesetting to configure output/CRTCs Louis-Francis Ratté-Boulianne Superseded 0 1
[RFC,xserver,v7,08/14] modesetting: Get supported formats/modifiers for scanout Louis-Francis Ratté-Boulianne Superseded 0 1
[RFC,xserver,v7,09/14] modesetting: Create scanout buffers using supported modifiers Louis-Francis Ratté-Boulianne Superseded 0 1
[RFC,xserver,v7,10/14] modesetting: Check if buffer format is supported when flipping Louis-Francis Ratté-Boulianne Accepted 0 1
[RFC,xserver,v7,11/14] glamor: Implement PixmapFromBuffers and BuffersFromPixmap Louis-Francis Ratté-Boulianne Superseded 0 1
[RFC,xserver,v7,12/14] glamor: Implement GetSupportedModifiers Louis-Francis Ratté-Boulianne Accepted 0 1
[RFC,xserver,v7,13/14] glamor: Use gbm_bo_create_with_modifiers for internal pixmap allocation Louis-Francis Ratté-Boulianne Superseded 0 1
[RFC,xserver,v7,14/14] dri3: Enable DRI3 version 1.1 Louis-Francis Ratté-Boulianne Superseded 2 1 1