GET_PLANE2 w/ i915 implementation

Submitted by Ben Widawsky on Jan. 12, 2017, 12:51 a.m.

Details

Reviewer None
Submitted Jan. 12, 2017, 12:51 a.m.
Last Updated Jan. 27, 2017, 1:02 a.m.
Revision 3

Cover Letter(s)

Revision 1
      This patch series implements GET_PLANE2 support for Intel platforms and defines
the new kernel UAPI. The idea was originally introduced by Kristian. Ultimately,
the purpose of the new API is to provide the ability to query per-plane
modifiers in KMS. These modifiers, which are just fb modifiers, will be used by
the client to enable optimal modifications for framebuffers. A reference
implementation in kmscube is referenced (in that code is a comment for an
optimal algorithm not implemented).

This work has been discussed on the mailing list and IRC over the last few weeks
and this is a result of the agreed changes. There is still some debate about the
UAPI, I believe, but I can firmly say that this seems entirely sufficient for
Intel platforms in the foreseeable future.

Cc: Kristian Høgsberg <krh@bitplanet.net>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
References: (ccs modifier) https://lists.freedesktop.org/archives/intel-gfx/2017-January/116022.html
References: (GBM modifiers) https://lists.freedesktop.org/archives/mesa-dev/2017-January/139284.html
References: (kmscube) https://github.com/bwidawsk/kmscube/commit/55519640f5a1a21983e267fb39e4cf48f6312ef9
References: (libdrm) https://lists.freedesktop.org/archives/dri-devel/2016-December/127942.html

Ben Widawsky (3):
  drm: Add new DRM_IOCTL_MODE_GETPLANE2
  drm/i915: Add format modifiers for Intel
  drm/i915: Add support for GET_PLANE2 CCS modifiers

 drivers/gpu/drm/arc/arcpgu_crtc.c               |   1 +
 drivers/gpu/drm/arm/hdlcd_crtc.c                |   1 +
 drivers/gpu/drm/arm/malidp_planes.c             |   2 +-
 drivers/gpu/drm/armada/armada_crtc.c            |   1 +
 drivers/gpu/drm/armada/armada_overlay.c         |   1 +
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c |   4 +-
 drivers/gpu/drm/drm_ioctl.c                     |   2 +-
 drivers/gpu/drm/drm_modeset_helper.c            |   1 +
 drivers/gpu/drm/drm_plane.c                     |  67 +++++++++++++-
 drivers/gpu/drm/drm_simple_kms_helper.c         |   3 +
 drivers/gpu/drm/exynos/exynos_drm_plane.c       |   2 +-
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c     |   2 +-
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c  |   1 +
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c |   2 +-
 drivers/gpu/drm/i915/intel_display.c            | 116 +++++++++++++++++++++++-
 drivers/gpu/drm/i915/intel_sprite.c             |  31 +++++++
 drivers/gpu/drm/imx/ipuv3-plane.c               |   4 +-
 drivers/gpu/drm/mediatek/mtk_drm_plane.c        |   2 +-
 drivers/gpu/drm/meson/meson_plane.c             |   1 +
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c       |   2 +-
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c       |   2 +-
 drivers/gpu/drm/mxsfb/mxsfb_drv.c               |   2 +-
 drivers/gpu/drm/nouveau/nv50_display.c          |   5 +-
 drivers/gpu/drm/omapdrm/omap_plane.c            |   3 +-
 drivers/gpu/drm/rcar-du/rcar_du_plane.c         |   4 +-
 drivers/gpu/drm/rcar-du/rcar_du_vsp.c           |   5 +-
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c     |   4 +-
 drivers/gpu/drm/sti/sti_cursor.c                |   1 +
 drivers/gpu/drm/sti/sti_gdp.c                   |   2 +-
 drivers/gpu/drm/sti/sti_hqvdp.c                 |   2 +-
 drivers/gpu/drm/sun4i/sun4i_layer.c             |   1 +
 drivers/gpu/drm/tegra/dc.c                      |  12 +--
 drivers/gpu/drm/vc4/vc4_plane.c                 |   2 +-
 drivers/gpu/drm/virtio/virtgpu_plane.c          |   2 +-
 drivers/gpu/drm/zte/zx_plane.c                  |   2 +-
 include/drm/drm_plane.h                         |  21 ++++-
 include/drm/drm_simple_kms_helper.h             |   1 +
 include/uapi/drm/drm.h                          |   1 +
 include/uapi/drm/drm_fourcc.h                   |  11 +++
 include/uapi/drm/drm_mode.h                     |  27 ++++++
 40 files changed, 320 insertions(+), 36 deletions(-)
    

Revisions

Patches download mbox

Tests

  LD [M]  sound/pci/hda/snd-hda-codec-generic.o
  LD      lib/built-in.o
  LD      sound/pci/built-in.o
  LD      drivers/acpi/built-in.o
  LD      drivers/md/dm-mod.o
  LD      sound/built-in.o
  LD      drivers/scsi/scsi_mod.o
  LD      drivers/video/fbdev/core/fb.o
  LD      net/ipv6/ipv6.o
  LD      drivers/video/fbdev/core/built-in.o
  LD      drivers/pci/built-in.o
  LD      drivers/usb/storage/usb-storage.o
  LD      drivers/usb/storage/built-in.o
drivers/gpu/drm/i915/intel_sprite.c:1043:2: error: ‘I915_FORMAT_MOD_Yf_TILED_CCS’ undeclared here (not in a function)
  I915_FORMAT_MOD_Yf_TILED_CCS,
  ^
drivers/gpu/drm/i915/intel_sprite.c:1044:2: error: ‘I915_FORMAT_MOD_Y_TILED_CCS’ undeclared here (not in a function)
  I915_FORMAT_MOD_Y_TILED_CCS,
  ^
  LD      net/ipv6/built-in.o
scripts/Makefile.build:293: recipe for target 'drivers/gpu/drm/i915/intel_sprite.o' failed
make[4]: *** [drivers/gpu/drm/i915/intel_sprite.o] Error 1
make[4]: *** Waiting for unfinished jobs....
  LD [M]  drivers/usb/serial/usbserial.o
  LD [M]  drivers/misc/mei/mei-me.o
  LD      drivers/misc/built-in.o
  LD      drivers/thermal/thermal_sys.o
  LD      drivers/thermal/built-in.o
  LD [M]  drivers/gpu/drm/vgem/vgem.o
  LD      drivers/tty/serial/8250/8250.o
  LD [M]  drivers/mmc/core/mmc_block.o
drivers/gpu/drm/i915/intel_display.c:100:2: error: ‘I915_FORMAT_MOD_Yf_TILED_CCS’ undeclared here (not in a function)
  I915_FORMAT_MOD_Yf_TILED_CCS,
  ^
drivers/gpu/drm/i915/intel_display.c:101:2: error: ‘I915_FORMAT_MOD_Y_TILED_CCS’ undeclared here (not in a function)
  I915_FORMAT_MOD_Y_TILED_CCS,
  ^
  LD [M]  drivers/net/ethernet/broadcom/genet/genet.o
  LD      drivers/mmc/built-in.o
  LD      drivers/usb/gadget/libcomposite.o
  LD      drivers/video/fbdev/built-in.o
  LD      drivers/spi/built-in.o
drivers/gpu/drm/i915/intel_display.c: In function ‘skl_mod_supported’:
drivers/gpu/drm/i915/intel_display.c:15053:20: error: comparison between pointer and integer [-Werror]
   return  modifier == I915_FORMAT_MOD_Yf_TILED_CCS ||
                    ^
drivers/gpu/drm/i915/intel_display.c:15054:13: error: comparison between pointer and integer [-Werror]
    modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
             ^
  LD      drivers/scsi/sd_mod.o
  LD      drivers/scsi/built-in.o
  LD      net/ipv4/built-in.o
  LD [M]  drivers/net/ethernet/intel/igbvf/igbvf.o
  LD      drivers/usb/gadget/udc/udc-core.o
  LD      drivers/usb/gadget/udc/built-in.o
cc1: all warnings being treated as errors
scripts/Makefile.build:293: recipe for target 'drivers/gpu/drm/i915/intel_display.o' failed
make[4]: *** [drivers/gpu/drm/i915/intel_display.o] Error 1
  LD      drivers/usb/gadget/built-in.o
  LD      drivers/video/console/built-in.o
  LD      drivers/video/built-in.o
  LD      drivers/iommu/built-in.o
  LD      drivers/tty/serial/8250/8250_base.o
  LD      drivers/tty/serial/8250/built-in.o
  LD      drivers/tty/serial/built-in.o
  LD      fs/btrfs/btrfs.o
  LD      fs/btrfs/built-in.o
  LD [M]  drivers/net/ethernet/intel/e1000/e1000.o
  LD      drivers/usb/core/usbcore.o
  CC      arch/x86/kernel/cpu/capflags.o
  LD      drivers/gpu/drm/drm.o
  LD      drivers/usb/core/built-in.o
  LD      arch/x86/kernel/cpu/built-in.o
  LD      net/core/built-in.o
  LD      arch/x86/kernel/built-in.o
  LD      net/built-in.o
  LD      drivers/usb/host/xhci-hcd.o
  LD      drivers/tty/vt/built-in.o
  LD      drivers/tty/built-in.o
  LD      arch/x86/built-in.o
  LD [M]  drivers/net/ethernet/intel/igb/igb.o
  LD      drivers/usb/host/built-in.o
  LD      drivers/md/md-mod.o
  LD      drivers/usb/built-in.o
  LD      drivers/md/built-in.o
  LD      fs/ext4/ext4.o
  LD [M]  drivers/net/ethernet/intel/e1000e/e1000e.o
  LD      fs/ext4/built-in.o
  LD      fs/built-in.o
scripts/Makefile.build:551: recipe for target 'drivers/gpu/drm/i915' failed
make[3]: *** [drivers/gpu/drm/i915] Error 2
scripts/Makefile.build:551: recipe for target 'drivers/gpu/drm' failed
make[2]: *** [drivers/gpu/drm] Error 2
scripts/Makefile.build:551: recipe for target 'drivers/gpu' failed
make[1]: *** [drivers/gpu] Error 2
make[1]: *** Waiting for unfinished jobs....
  LD      drivers/net/ethernet/built-in.o
  LD      drivers/net/built-in.o
Makefile:988: recipe for target 'drivers' failed
make: *** [drivers] Error 2

Patches download mbox

Tests

  LD      drivers/usb/storage/usb-storage.o
  LD      drivers/usb/storage/built-in.o
  LD      drivers/acpi/built-in.o
  LD      net/ipv6/built-in.o
  LD [M]  drivers/misc/mei/mei-me.o
  LD      drivers/misc/built-in.o
  LD      drivers/pci/pcie/pcieportdrv.o
  LD      drivers/tty/serial/8250/8250.o
  LD [M]  drivers/mmc/core/mmc_block.o
  LD      drivers/mmc/built-in.o
  LD      drivers/gpu/drm/drm.o
  LD [M]  drivers/usb/serial/usbserial.o
  LD      drivers/scsi/scsi_mod.o
  LD [M]  drivers/net/ethernet/broadcom/genet/genet.o
  LD [M]  sound/pci/hda/snd-hda-codec-generic.o
  LD      drivers/pci/pcie/aer/aerdriver.o
  LD      drivers/pci/pcie/aer/built-in.o
  LD      sound/pci/built-in.o
  LD      drivers/pci/pcie/built-in.o
  LD      drivers/usb/gadget/udc/udc-core.o
  LD      drivers/usb/gadget/udc/built-in.o
  LD      drivers/iommu/built-in.o
  LD      drivers/thermal/thermal_sys.o
  LD      drivers/thermal/built-in.o
drivers/gpu/drm/i915/intel_display.c:100:2: error: ‘I915_FORMAT_MOD_Yf_TILED_CCS’ undeclared here (not in a function)
  I915_FORMAT_MOD_Yf_TILED_CCS,
  ^
drivers/gpu/drm/i915/intel_display.c:101:2: error: ‘I915_FORMAT_MOD_Y_TILED_CCS’ undeclared here (not in a function)
  I915_FORMAT_MOD_Y_TILED_CCS,
  ^
  LD      sound/built-in.o
  LD      drivers/usb/gadget/libcomposite.o
  LD      drivers/usb/gadget/built-in.o
drivers/gpu/drm/i915/intel_sprite.c:1043:2: error: ‘I915_FORMAT_MOD_Yf_TILED_CCS’ undeclared here (not in a function)
  I915_FORMAT_MOD_Yf_TILED_CCS,
  ^
drivers/gpu/drm/i915/intel_sprite.c:1044:2: error: ‘I915_FORMAT_MOD_Y_TILED_CCS’ undeclared here (not in a function)
  I915_FORMAT_MOD_Y_TILED_CCS,
  ^
  LD      drivers/video/fbdev/core/fb.o
  LD      drivers/video/fbdev/core/built-in.o
scripts/Makefile.build:293: recipe for target 'drivers/gpu/drm/i915/intel_sprite.o' failed
make[4]: *** [drivers/gpu/drm/i915/intel_sprite.o] Error 1
make[4]: *** Waiting for unfinished jobs....
drivers/gpu/drm/i915/intel_display.c: In function ‘skl_mod_supported’:
drivers/gpu/drm/i915/intel_display.c:15053:20: error: comparison between pointer and integer [-Werror]
   return  modifier == I915_FORMAT_MOD_Yf_TILED_CCS ||
                    ^
drivers/gpu/drm/i915/intel_display.c:15054:13: error: comparison between pointer and integer [-Werror]
    modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
             ^
cc1: all warnings being treated as errors
scripts/Makefile.build:293: recipe for target 'drivers/gpu/drm/i915/intel_display.o' failed
make[4]: *** [drivers/gpu/drm/i915/intel_display.o] Error 1
  LD      drivers/spi/built-in.o
  LD      drivers/tty/serial/8250/8250_base.o
  LD      drivers/video/fbdev/built-in.o
  LD      drivers/tty/serial/8250/built-in.o
  LD [M]  drivers/net/ethernet/intel/igbvf/igbvf.o
  LD      drivers/tty/serial/built-in.o
  LD      net/ipv4/built-in.o
  LD      drivers/scsi/sd_mod.o
  LD      drivers/scsi/built-in.o
  LD      fs/btrfs/btrfs.o
  LD      drivers/pci/built-in.o
  LD      fs/btrfs/built-in.o
  LD [M]  drivers/net/ethernet/intel/e1000/e1000.o
  LD      drivers/video/console/built-in.o
  LD      drivers/video/built-in.o
  CC      arch/x86/kernel/cpu/capflags.o
  LD      arch/x86/kernel/cpu/built-in.o
  LD      arch/x86/kernel/built-in.o
  LD      drivers/usb/core/usbcore.o
  LD      drivers/usb/core/built-in.o
  LD      drivers/usb/host/xhci-hcd.o
  LD      arch/x86/built-in.o
  LD      drivers/tty/vt/built-in.o
  LD      drivers/tty/built-in.o
  LD      fs/ext4/ext4.o
  LD      drivers/usb/host/built-in.o
  LD      drivers/usb/built-in.o
  LD      fs/ext4/built-in.o
  LD      net/core/built-in.o
  LD      fs/built-in.o
  LD      net/built-in.o
  LD [M]  drivers/net/ethernet/intel/igb/igb.o
  LD      drivers/md/md-mod.o
  LD      drivers/md/built-in.o
  LD [M]  drivers/net/ethernet/intel/e1000e/e1000e.o
scripts/Makefile.build:551: recipe for target 'drivers/gpu/drm/i915' failed
make[3]: *** [drivers/gpu/drm/i915] Error 2
scripts/Makefile.build:551: recipe for target 'drivers/gpu/drm' failed
make[2]: *** [drivers/gpu/drm] Error 2
scripts/Makefile.build:551: recipe for target 'drivers/gpu' failed
make[1]: *** [drivers/gpu] Error 2
make[1]: *** Waiting for unfinished jobs....
  LD      drivers/net/ethernet/built-in.o
  LD      drivers/net/built-in.o
Makefile:988: recipe for target 'drivers' failed
make: *** [drivers] Error 2

Patches download mbox

Tests

  CC [M]  drivers/gpu/drm/i915/gvt/cmd_parser.o
  CC [M]  drivers/gpu/drm/i915/gvt/sched_policy.o
  CC [M]  drivers/gpu/drm/i915/intel_lpe_audio.o
  CC [M]  drivers/gpu/drm/i915/gvt/render.o
  LD      drivers/iommu/built-in.o
  LD      drivers/tty/serial/8250/8250.o
  LD      lib/raid6/raid6_pq.o
  LD      lib/raid6/built-in.o
  LD      drivers/usb/storage/usb-storage.o
  LD      drivers/pci/pcie/aer/aerdriver.o
  LD      drivers/pci/pcie/aer/built-in.o
  LD      drivers/usb/storage/built-in.o
  LD      drivers/pci/pcie/built-in.o
  LD [M]  drivers/gpu/drm/vgem/vgem.o
  LD      drivers/spi/built-in.o
  LD      drivers/scsi/scsi_mod.o
  LD      drivers/video/fbdev/core/fb.o
  LD [M]  drivers/usb/serial/usbserial.o
  LD      drivers/video/fbdev/core/built-in.o
  LD      drivers/video/fbdev/built-in.o
  LD      drivers/pci/built-in.o
  LD      drivers/video/console/built-in.o
drivers/gpu/drm/i915/intel_display.c:100:2: error: ‘I915_FORMAT_MOD_Yf_TILED_CCS’ undeclared here (not in a function)
  I915_FORMAT_MOD_Yf_TILED_CCS,
  ^
drivers/gpu/drm/i915/intel_display.c:101:2: error: ‘I915_FORMAT_MOD_Y_TILED_CCS’ undeclared here (not in a function)
  I915_FORMAT_MOD_Y_TILED_CCS,
  ^
  LD      drivers/video/built-in.o
drivers/gpu/drm/i915/intel_sprite.c:1043:2: error: ‘I915_FORMAT_MOD_Yf_TILED_CCS’ undeclared here (not in a function)
  I915_FORMAT_MOD_Yf_TILED_CCS,
  ^
drivers/gpu/drm/i915/intel_sprite.c:1044:2: error: ‘I915_FORMAT_MOD_Y_TILED_CCS’ undeclared here (not in a function)
  I915_FORMAT_MOD_Y_TILED_CCS,
  ^
scripts/Makefile.build:293: recipe for target 'drivers/gpu/drm/i915/intel_sprite.o' failed
make[4]: *** [drivers/gpu/drm/i915/intel_sprite.o] Error 1
make[4]: *** Waiting for unfinished jobs....
  LD      drivers/usb/gadget/udc/udc-core.o
  LD      drivers/usb/gadget/udc/built-in.o
  LD      drivers/usb/gadget/libcomposite.o
  LD      net/ipv6/ipv6.o
  LD [M]  drivers/net/ethernet/broadcom/genet/genet.o
  LD      drivers/usb/gadget/built-in.o
drivers/gpu/drm/i915/intel_display.c: In function ‘skl_mod_supported’:
drivers/gpu/drm/i915/intel_display.c:15056:20: error: comparison between pointer and integer [-Werror]
   return  modifier == I915_FORMAT_MOD_Yf_TILED_CCS ||
                    ^
drivers/gpu/drm/i915/intel_display.c:15057:13: error: comparison between pointer and integer [-Werror]
    modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
             ^
  LD      net/ipv6/built-in.o
  AR      lib/lib.a
  LD      drivers/tty/serial/8250/8250_base.o
  LD      drivers/tty/serial/8250/built-in.o
  EXPORTS lib/lib-ksyms.o
  LD      drivers/tty/serial/built-in.o
  LD      lib/built-in.o
cc1: all warnings being treated as errors
  LD      drivers/scsi/sd_mod.o
scripts/Makefile.build:293: recipe for target 'drivers/gpu/drm/i915/intel_display.o' failed
make[4]: *** [drivers/gpu/drm/i915/intel_display.o] Error 1
  LD      drivers/scsi/built-in.o
  LD      net/ipv4/built-in.o
  LD      fs/btrfs/btrfs.o
  LD [M]  drivers/net/ethernet/intel/igbvf/igbvf.o
  LD      drivers/tty/vt/built-in.o
  LD      drivers/tty/built-in.o
  LD      drivers/gpu/drm/drm.o
  LD      drivers/usb/core/usbcore.o
  LD      fs/btrfs/built-in.o
  LD      drivers/usb/core/built-in.o
  CC      arch/x86/kernel/cpu/capflags.o
  LD      arch/x86/kernel/cpu/built-in.o
  LD      arch/x86/kernel/built-in.o
  LD      drivers/usb/host/xhci-hcd.o
  LD      drivers/md/md-mod.o
  LD      drivers/md/built-in.o
  LD      arch/x86/built-in.o
  LD [M]  drivers/net/ethernet/intel/e1000/e1000.o
  LD      fs/ext4/ext4.o
  LD      net/core/built-in.o
  LD      fs/ext4/built-in.o
  LD      net/built-in.o
  LD      fs/built-in.o
  LD      drivers/usb/host/built-in.o
  LD      drivers/usb/built-in.o
  LD [M]  drivers/net/ethernet/intel/e1000e/e1000e.o
  LD [M]  drivers/net/ethernet/intel/igb/igb.o
scripts/Makefile.build:551: recipe for target 'drivers/gpu/drm/i915' failed
make[3]: *** [drivers/gpu/drm/i915] Error 2
scripts/Makefile.build:551: recipe for target 'drivers/gpu/drm' failed
make[2]: *** [drivers/gpu/drm] Error 2
scripts/Makefile.build:551: recipe for target 'drivers/gpu' failed
make[1]: *** [drivers/gpu] Error 2
make[1]: *** Waiting for unfinished jobs....
  LD      drivers/net/ethernet/built-in.o
  LD      drivers/net/built-in.o
Makefile:988: recipe for target 'drivers' failed
make: *** [drivers] Error 2