sna: Add XV_COLORSPACE attribute support for sprite Xv adaptors

Submitted by Ville Syrjälä on June 8, 2017, 8:33 p.m.

Details

Reviewer None
Submitted June 8, 2017, 8:33 p.m.
Last Updated March 2, 2018, 11:59 a.m.
Revision 6

Cover Letter(s)

Revision 1
      From: Ville Syrjälä <ville.syrjala@linux.intel.com>

While reviewing the COLOR_ENCODING/COLOR_RANGE props I decided that I
might as well implement them in i915. And here is the result.

With this the user can now select between BT.601 vs. BT.709, and
limited vs. full range on every platform where we currently have
YCbCr framebuffer support. I had to fix up GLK a bit more since it
wasn't actually doing the YCbCr->RGB conversion at all.

In order to unblock this further I also hacked together some userspace
support in the form of the XV_COLORSPACE port attribute in the intel
ddx. For that I needed to hack off the atomic requirement for these
properties. I don't think there's much point in restricting these 
to atomic anyway.

I've pushed the entire series (including Jyri's stuff with my hack) here:
git://github.com/vsyrjala/linux.git color_encoding_prop

And the intel ddx xv stuff is available here:
git://github.com/vsyrjala/xf86-video-intel.git xv_colorspace

Cc: Jyri Sarha <jsarha@ti.com>

Ville Syrjälä (5):
  drm/i915: Correctly handle limited range YCbCr data on VLV/CHV
  drm/i915: Fix plane YCbCr->RGB conversion for GLK
  drm/i915: Add support for the YCbCr COLOR_ENCODING property
  drm/i915: Change the COLOR_ENCODING prop default value to BT.709
  drm/i915: Add support for the YCbCr COLOR_RANGE property

 drivers/gpu/drm/i915/i915_reg.h      |  22 ++++++
 drivers/gpu/drm/i915/intel_display.c |  41 ++++++++++-
 drivers/gpu/drm/i915/intel_drv.h     |   2 +
 drivers/gpu/drm/i915/intel_sprite.c  | 130 +++++++++++++++++++++++++++--------
 4 files changed, 164 insertions(+), 31 deletions(-)
    

Revisions

SERIES REVISION LOOKS STRANGE. Please double-check patch list and the ordering before proceeding.

Patches download mbox

Tests

  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CHK     include/generated/bounds.h
  CHK     include/generated/timeconst.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  CHK     scripts/mod/devicetable-offsets.h
  CHK     include/generated/compile.h
  CHK     kernel/config_data.h
  CC [M]  drivers/gpu/drm/i915/intel_display.o
drivers/gpu/drm/i915/intel_display.c: In function ‘skl_plane_ctl’:
drivers/gpu/drm/i915/intel_display.c:3325:24: error: ‘const struct drm_plane_state’ has no member named ‘color_encoding’
   if (plane_state->base.color_encoding == DRM_COLOR_YCBCR_BT709)
                        ^
drivers/gpu/drm/i915/intel_display.c:3325:43: error: ‘DRM_COLOR_YCBCR_BT709’ undeclared (first use in this function)
   if (plane_state->base.color_encoding == DRM_COLOR_YCBCR_BT709)
                                           ^
drivers/gpu/drm/i915/intel_display.c:3325:43: note: each undeclared identifier is reported only once for each function it appears in
drivers/gpu/drm/i915/intel_display.c:3328:24: error: ‘const struct drm_plane_state’ has no member named ‘color_range’
   if (plane_state->base.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
                        ^
drivers/gpu/drm/i915/intel_display.c:3328:40: error: ‘DRM_COLOR_YCBCR_FULL_RANGE’ undeclared (first use in this function)
   if (plane_state->base.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
                                        ^
drivers/gpu/drm/i915/intel_display.c: In function ‘glk_color_ctl’:
drivers/gpu/drm/i915/intel_display.c:3354:24: error: ‘const struct drm_plane_state’ has no member named ‘color_encoding’
   if (plane_state->base.color_encoding == DRM_COLOR_YCBCR_BT709)
                        ^
drivers/gpu/drm/i915/intel_display.c:3354:43: error: ‘DRM_COLOR_YCBCR_BT709’ undeclared (first use in this function)
   if (plane_state->base.color_encoding == DRM_COLOR_YCBCR_BT709)
                                           ^
drivers/gpu/drm/i915/intel_display.c:3359:24: error: ‘const struct drm_plane_state’ has no member named ‘color_range’
   if (plane_state->base.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
                        ^
drivers/gpu/drm/i915/intel_display.c:3359:40: error: ‘DRM_COLOR_YCBCR_FULL_RANGE’ undeclared (first use in this function)
   if (plane_state->base.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
                                        ^
drivers/gpu/drm/i915/intel_display.c: In function ‘intel_primary_plane_create’:
drivers/gpu/drm/i915/intel_display.c:13836:3: error: implicit declaration of function ‘drm_plane_create_color_properties’ [-Werror=implicit-function-declaration]
   drm_plane_create_color_properties(&primary->base,
   ^
In file included from ./include/linux/kernel.h:10:0,
                 from ./include/linux/list.h:8,
                 from ./include/linux/dmi.h:4,
                 from drivers/gpu/drm/i915/intel_display.c:27:
drivers/gpu/drm/i915/intel_display.c:13837:13: error: ‘DRM_COLOR_YCBCR_BT601’ undeclared (first use in this function)
         BIT(DRM_COLOR_YCBCR_BT601) |
             ^
./include/linux/bitops.h:6:28: note: in definition of macro ‘BIT’
 #define BIT(nr)   (1UL << (nr))
                            ^
drivers/gpu/drm/i915/intel_display.c:13838:13: error: ‘DRM_COLOR_YCBCR_BT709’ undeclared (first use in this function)
         BIT(DRM_COLOR_YCBCR_BT709),
             ^
./include/linux/bitops.h:6:28: note: in definition of macro ‘BIT’
 #define BIT(nr)   (1UL << (nr))
                            ^
drivers/gpu/drm/i915/intel_display.c:13839:13: error: ‘DRM_COLOR_YCBCR_LIMITED_RANGE’ undeclared (first use in this function)
         BIT(DRM_COLOR_YCBCR_LIMITED_RANGE) |
             ^
./include/linux/bitops.h:6:28: note: in definition of macro ‘BIT’
 #define BIT(nr)   (1UL << (nr))
                            ^
drivers/gpu/drm/i915/intel_display.c:13840:13: error: ‘DRM_COLOR_YCBCR_FULL_RANGE’ undeclared (first use in this function)
         BIT(DRM_COLOR_YCBCR_FULL_RANGE),
             ^
./include/linux/bitops.h:6:28: note: in definition of macro ‘BIT’
 #define BIT(nr)   (1UL << (nr))
                            ^
cc1: all warnings being treated as errors
scripts/Makefile.build:302: recipe for target 'drivers/gpu/drm/i915/intel_display.o' failed
make[4]: *** [drivers/gpu/drm/i915/intel_display.o] Error 1
scripts/Makefile.build:561: recipe for target 'drivers/gpu/drm/i915' failed
make[3]: *** [drivers/gpu/drm/i915] Error 2
scripts/Makefile.build:561: recipe for target 'drivers/gpu/drm' failed
make[2]: *** [drivers/gpu/drm] Error 2
scripts/Makefile.build:561: recipe for target 'drivers/gpu' failed
make[1]: *** [drivers/gpu] Error 2
Makefile:1016: recipe for target 'drivers' failed
make: *** [drivers] Error 2

Patches download mbox

Tests

  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CHK     include/generated/bounds.h
  CHK     include/generated/timeconst.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  CHK     scripts/mod/devicetable-offsets.h
  CHK     include/generated/compile.h
  CHK     kernel/config_data.h
  CC [M]  drivers/gpu/drm/i915/intel_display.o
drivers/gpu/drm/i915/intel_display.c: In function ‘skl_plane_ctl’:
drivers/gpu/drm/i915/intel_display.c:3320:24: error: ‘const struct drm_plane_state’ has no member named ‘color_encoding’
   if (plane_state->base.color_encoding == DRM_COLOR_YCBCR_BT709)
                        ^
drivers/gpu/drm/i915/intel_display.c:3320:43: error: ‘DRM_COLOR_YCBCR_BT709’ undeclared (first use in this function)
   if (plane_state->base.color_encoding == DRM_COLOR_YCBCR_BT709)
                                           ^
drivers/gpu/drm/i915/intel_display.c:3320:43: note: each undeclared identifier is reported only once for each function it appears in
drivers/gpu/drm/i915/intel_display.c:3323:24: error: ‘const struct drm_plane_state’ has no member named ‘color_range’
   if (plane_state->base.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
                        ^
drivers/gpu/drm/i915/intel_display.c:3323:40: error: ‘DRM_COLOR_YCBCR_FULL_RANGE’ undeclared (first use in this function)
   if (plane_state->base.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
                                        ^
drivers/gpu/drm/i915/intel_display.c: In function ‘glk_color_ctl’:
drivers/gpu/drm/i915/intel_display.c:3349:24: error: ‘const struct drm_plane_state’ has no member named ‘color_encoding’
   if (plane_state->base.color_encoding == DRM_COLOR_YCBCR_BT709)
                        ^
drivers/gpu/drm/i915/intel_display.c:3349:43: error: ‘DRM_COLOR_YCBCR_BT709’ undeclared (first use in this function)
   if (plane_state->base.color_encoding == DRM_COLOR_YCBCR_BT709)
                                           ^
drivers/gpu/drm/i915/intel_display.c:3354:24: error: ‘const struct drm_plane_state’ has no member named ‘color_range’
   if (plane_state->base.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
                        ^
drivers/gpu/drm/i915/intel_display.c:3354:40: error: ‘DRM_COLOR_YCBCR_FULL_RANGE’ undeclared (first use in this function)
   if (plane_state->base.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
                                        ^
drivers/gpu/drm/i915/intel_display.c: In function ‘intel_primary_plane_create’:
drivers/gpu/drm/i915/intel_display.c:13853:3: error: implicit declaration of function ‘drm_plane_create_color_properties’ [-Werror=implicit-function-declaration]
   drm_plane_create_color_properties(&primary->base,
   ^
In file included from ./include/linux/kernel.h:10:0,
                 from ./include/linux/list.h:8,
                 from ./include/linux/dmi.h:4,
                 from drivers/gpu/drm/i915/intel_display.c:27:
drivers/gpu/drm/i915/intel_display.c:13854:13: error: ‘DRM_COLOR_YCBCR_BT601’ undeclared (first use in this function)
         BIT(DRM_COLOR_YCBCR_BT601) |
             ^
./include/linux/bitops.h:6:28: note: in definition of macro ‘BIT’
 #define BIT(nr)   (1UL << (nr))
                            ^
drivers/gpu/drm/i915/intel_display.c:13855:13: error: ‘DRM_COLOR_YCBCR_BT709’ undeclared (first use in this function)
         BIT(DRM_COLOR_YCBCR_BT709),
             ^
./include/linux/bitops.h:6:28: note: in definition of macro ‘BIT’
 #define BIT(nr)   (1UL << (nr))
                            ^
drivers/gpu/drm/i915/intel_display.c:13856:13: error: ‘DRM_COLOR_YCBCR_LIMITED_RANGE’ undeclared (first use in this function)
         BIT(DRM_COLOR_YCBCR_LIMITED_RANGE) |
             ^
./include/linux/bitops.h:6:28: note: in definition of macro ‘BIT’
 #define BIT(nr)   (1UL << (nr))
                            ^
drivers/gpu/drm/i915/intel_display.c:13857:13: error: ‘DRM_COLOR_YCBCR_FULL_RANGE’ undeclared (first use in this function)
         BIT(DRM_COLOR_YCBCR_FULL_RANGE),
             ^
./include/linux/bitops.h:6:28: note: in definition of macro ‘BIT’
 #define BIT(nr)   (1UL << (nr))
                            ^
cc1: all warnings being treated as errors
scripts/Makefile.build:302: recipe for target 'drivers/gpu/drm/i915/intel_display.o' failed
make[4]: *** [drivers/gpu/drm/i915/intel_display.o] Error 1
scripts/Makefile.build:561: recipe for target 'drivers/gpu/drm/i915' failed
make[3]: *** [drivers/gpu/drm/i915] Error 2
scripts/Makefile.build:561: recipe for target 'drivers/gpu/drm' failed
make[2]: *** [drivers/gpu/drm] Error 2
scripts/Makefile.build:561: recipe for target 'drivers/gpu' failed
make[1]: *** [drivers/gpu] Error 2
Makefile:1016: recipe for target 'drivers' failed
make: *** [drivers] Error 2