Skip to content

Commit 2e2adb0

Browse files
vsyrjalafooishbar
authored andcommitted
drm/i915: Add render decompression support
SKL+ display engine can scan out certain kinds of compressed surfaces produced by the render engine. This involved telling the display engine the location of the color control surfae (CCS) which describes which parts of the main surface are compressed and which are not. The location of CCS is provided by userspace as just another plane with its own offset. Add the required stuff to validate the user provided AUX plane metadata and convert the user provided linear offset into something the hardware can consume. Due to hardware limitations we require that the main surface and the AUX surface (CCS) be part of the same bo. The hardware also makes life hard by not allowing you to provide separate x/y offsets for the main and AUX surfaces (excpet with NV12), so finding suitable offsets for both requires a bit of work. Assuming we still want keep playing tricks with the offsets. I've just gone with a dumb "search backward for suitable offsets" approach, which is far from optimal, but it works. Also not all planes will be capable of scanning out compressed surfaces, and eg. 90/270 degree rotation is not supported in combination with decompression either. This patch may contain work from at least the following people: * Vandana Kannan <vandana.kannan@intel.com> * Daniel Vetter <daniel@ffwll.ch> * Ben Widawsky <ben@bwidawsk.net> v2: Deal with display workarounds 0390, 0531, 1125 (Paulo) v3: Pretend CCS tiles are regular 128 byte wide Y tiles (Jason) Put the AUX register defines to the correct place Fix up the slightly bogus rotation check v4: Use I915_WRITE_FW() due to plane update locking changes s/return -EINVAL/goto err/ in intel_framebuffer_init() Eliminate a bunch hardcoded numbers in CCS code v5: (By Ben) conflict resolution + - res_blocks += fixed_16_16_to_u32_round_up(y_tile_minimum); + res_blocks += fixed16_to_u32_round_up(y_tile_minimum); v6: (daniels) Fix botched commit message. Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Ville Syrjä <ville.syrjala@linux.intel.com> Reviewed-by: Ben Widawsky <ben@bwidawsk.net> (v1) Reviewed-by: Daniel Stone <daniels@collabora.com> Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Signed-off-by: Daniel Stone <daniels@collabora.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170801165817.7063-1-ben@bwidawsk.net
1 parent bbfb6ce commit 2e2adb0

4 files changed

Lines changed: 272 additions & 18 deletions

File tree

‎drivers/gpu/drm/i915/i915_reg.h‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6199,6 +6199,10 @@ enum {
61996199
#define _PLANE_KEYMSK_2_A 0x70298
62006200
#define _PLANE_KEYMAX_1_A 0x701a0
62016201
#define _PLANE_KEYMAX_2_A 0x702a0
6202+
#define _PLANE_AUX_DIST_1_A 0x701c0
6203+
#define _PLANE_AUX_DIST_2_A 0x702c0
6204+
#define _PLANE_AUX_OFFSET_1_A 0x701c4
6205+
#define _PLANE_AUX_OFFSET_2_A 0x702c4
62026206
#define _PLANE_COLOR_CTL_1_A 0x701CC /* GLK+ */
62036207
#define _PLANE_COLOR_CTL_2_A 0x702CC /* GLK+ */
62046208
#define _PLANE_COLOR_CTL_3_A 0x703CC /* GLK+ */
@@ -6305,6 +6309,24 @@ enum {
63056309
#define PLANE_NV12_BUF_CFG(pipe, plane) \
63066310
_MMIO_PLANE(plane, _PLANE_NV12_BUF_CFG_1(pipe), _PLANE_NV12_BUF_CFG_2(pipe))
63076311

6312+
#define _PLANE_AUX_DIST_1_B 0x711c0
6313+
#define _PLANE_AUX_DIST_2_B 0x712c0
6314+
#define _PLANE_AUX_DIST_1(pipe) \
6315+
_PIPE(pipe, _PLANE_AUX_DIST_1_A, _PLANE_AUX_DIST_1_B)
6316+
#define _PLANE_AUX_DIST_2(pipe) \
6317+
_PIPE(pipe, _PLANE_AUX_DIST_2_A, _PLANE_AUX_DIST_2_B)
6318+
#define PLANE_AUX_DIST(pipe, plane) \
6319+
_MMIO_PLANE(plane, _PLANE_AUX_DIST_1(pipe), _PLANE_AUX_DIST_2(pipe))
6320+
6321+
#define _PLANE_AUX_OFFSET_1_B 0x711c4
6322+
#define _PLANE_AUX_OFFSET_2_B 0x712c4
6323+
#define _PLANE_AUX_OFFSET_1(pipe) \
6324+
_PIPE(pipe, _PLANE_AUX_OFFSET_1_A, _PLANE_AUX_OFFSET_1_B)
6325+
#define _PLANE_AUX_OFFSET_2(pipe) \
6326+
_PIPE(pipe, _PLANE_AUX_OFFSET_2_A, _PLANE_AUX_OFFSET_2_B)
6327+
#define PLANE_AUX_OFFSET(pipe, plane) \
6328+
_MMIO_PLANE(plane, _PLANE_AUX_OFFSET_1(pipe), _PLANE_AUX_OFFSET_2(pipe))
6329+
63086330
#define _PLANE_COLOR_CTL_1_B 0x711CC
63096331
#define _PLANE_COLOR_CTL_2_B 0x712CC
63106332
#define _PLANE_COLOR_CTL_3_B 0x713CC
@@ -6788,6 +6810,7 @@ enum {
67886810
# define CHICKEN3_DGMG_DONE_FIX_DISABLE (1 << 2)
67896811

67906812
#define CHICKEN_PAR1_1 _MMIO(0x42080)
6813+
#define SKL_RC_HASH_OUTSIDE (1 << 15)
67916814
#define DPA_MASK_VBLANK_SRD (1 << 15)
67926815
#define FORCE_ARB_IDLE_PLANES (1 << 14)
67936816
#define SKL_EDP_PSR_FIX_RDWRAP (1 << 3)

0 commit comments

Comments
 (0)