[1/3] drm/i915: Make pipe/transcoder offsets not depend on enum values

Submitted by Imre Deak on Nov. 20, 2018, 9:23 a.m.

Details

Message ID 20181120092325.21249-1-imre.deak@intel.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Imre Deak Nov. 20, 2018, 9:23 a.m.
Depending on the transcoder enum values to translate from transcoder
to pipe/transcoder register addresses can easily break if we add a new
transcoder. So remove the dependency by using named initializers.

Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_pci.c | 52 ++++++++++++++++++++++++++++++-----------
 1 file changed, 38 insertions(+), 14 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 983ae7fd8217..1b81d7cb209e 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -33,16 +33,30 @@ 
 #define GEN(x) .gen = (x), .gen_mask = BIT((x) - 1)
 
 #define GEN_DEFAULT_PIPEOFFSETS \
-	.pipe_offsets = { PIPE_A_OFFSET, PIPE_B_OFFSET, \
-			  PIPE_C_OFFSET, PIPE_EDP_OFFSET }, \
-	.trans_offsets = { TRANSCODER_A_OFFSET, TRANSCODER_B_OFFSET, \
-			   TRANSCODER_C_OFFSET, TRANSCODER_EDP_OFFSET }
+	.pipe_offsets = { \
+		[TRANSCODER_A] = PIPE_A_OFFSET,	\
+		[TRANSCODER_B] = PIPE_B_OFFSET, \
+		[TRANSCODER_C] = PIPE_C_OFFSET, \
+		[TRANSCODER_EDP] = PIPE_EDP_OFFSET, \
+	}, \
+	.trans_offsets = { \
+		[TRANSCODER_A] = TRANSCODER_A_OFFSET, \
+		[TRANSCODER_B] = TRANSCODER_B_OFFSET, \
+		[TRANSCODER_C] = TRANSCODER_C_OFFSET, \
+		[TRANSCODER_EDP] = TRANSCODER_EDP_OFFSET, \
+	}
 
 #define GEN_CHV_PIPEOFFSETS \
-	.pipe_offsets = { PIPE_A_OFFSET, PIPE_B_OFFSET, \
-			  CHV_PIPE_C_OFFSET }, \
-	.trans_offsets = { TRANSCODER_A_OFFSET, TRANSCODER_B_OFFSET, \
-			   CHV_TRANSCODER_C_OFFSET }
+	.pipe_offsets = { \
+		[TRANSCODER_A] = PIPE_A_OFFSET, \
+		[TRANSCODER_B] = PIPE_B_OFFSET, \
+		[TRANSCODER_C] = CHV_PIPE_C_OFFSET, \
+	}, \
+	.trans_offsets = { \
+		[TRANSCODER_A] = TRANSCODER_A_OFFSET, \
+		[TRANSCODER_B] = TRANSCODER_B_OFFSET, \
+		[TRANSCODER_C] = CHV_TRANSCODER_C_OFFSET, \
+	}
 
 #define CURSOR_OFFSETS \
 	.cursor_offsets = { CURSOR_A_OFFSET, CURSOR_B_OFFSET, CHV_CURSOR_C_OFFSET }
@@ -592,12 +606,22 @@  static const struct intel_device_info intel_cannonlake_info = {
 
 #define GEN11_FEATURES \
 	GEN10_FEATURES, \
-	.pipe_offsets = { PIPE_A_OFFSET, PIPE_B_OFFSET, \
-			  PIPE_C_OFFSET, PIPE_EDP_OFFSET, \
-			  PIPE_DSI0_OFFSET, PIPE_DSI1_OFFSET }, \
-	.trans_offsets = { TRANSCODER_A_OFFSET, TRANSCODER_B_OFFSET, \
-			   TRANSCODER_C_OFFSET, TRANSCODER_EDP_OFFSET, \
-			   TRANSCODER_DSI0_OFFSET, TRANSCODER_DSI1_OFFSET}, \
+	.pipe_offsets = { \
+		[TRANSCODER_A] = PIPE_A_OFFSET, \
+		[TRANSCODER_B] = PIPE_B_OFFSET, \
+		[TRANSCODER_C] = PIPE_C_OFFSET, \
+		[TRANSCODER_EDP] = PIPE_EDP_OFFSET, \
+		[TRANSCODER_DSI_0] = PIPE_DSI0_OFFSET, \
+		[TRANSCODER_DSI_1] = PIPE_DSI1_OFFSET, \
+	}, \
+	.trans_offsets = { \
+		[TRANSCODER_A] = TRANSCODER_A_OFFSET, \
+		[TRANSCODER_B] = TRANSCODER_B_OFFSET, \
+		[TRANSCODER_C] = TRANSCODER_C_OFFSET, \
+		[TRANSCODER_EDP] = TRANSCODER_EDP_OFFSET, \
+		[TRANSCODER_DSI_0] = TRANSCODER_DSI0_OFFSET, \
+		[TRANSCODER_DSI_1] = TRANSCODER_DSI1_OFFSET, \
+	}, \
 	GEN(11), \
 	.ddb_size = 2048, \
 	.has_logical_ring_elsq = 1

Comments

On Tue, Nov 20, 2018 at 01:53:06PM +0000, Patchwork wrote:
> == Series Details ==
> 
> Series: series starting with [1/3] drm/i915: Make pipe/transcoder offsets not depend on enum values
> URL   : https://patchwork.freedesktop.org/series/52742/
> State : success

Pushed to -dinq, thanks for the reviews.

> 
> == Summary ==
> 
> = CI Bug Log - changes from CI_DRM_5169_full -> Patchwork_10857_full =
> 
> == Summary - WARNING ==
> 
>   Minor unknown changes coming with Patchwork_10857_full need to be verified
>   manually.
>   
>   If you think the reported changes have nothing to do with the changes
>   introduced in Patchwork_10857_full, please notify your bug team to allow them
>   to document this new failure mode, which will reduce false positives in CI.
> 
>   
> 
> == Possible new issues ==
> 
>   Here are the unknown changes that may have been introduced in Patchwork_10857_full:
> 
>   === IGT changes ===
> 
>     ==== Warnings ====
> 
>     igt@pm_rc6_residency@rc6-accuracy:
>       shard-snb:          PASS -> SKIP
> 
>     
> == Known issues ==
> 
>   Here are the changes found in Patchwork_10857_full that come from known issues:
> 
>   === IGT changes ===
> 
>     ==== Issues hit ====
> 
>     igt@drm_import_export@import-close-race-flink:
>       shard-skl:          NOTRUN -> TIMEOUT (fdo#108667)
> 
>     igt@gem_eio@in-flight-1us:
>       shard-glk:          PASS -> FAIL (fdo#107799)
> 
>     igt@gem_exec_schedule@pi-ringfull-bsd:
>       {shard-iclb}:       NOTRUN -> FAIL (fdo#103158) +2
> 
>     igt@gem_ppgtt@blt-vs-render-ctxn:
>       shard-skl:          NOTRUN -> TIMEOUT (fdo#108039)
> 
>     igt@i915_suspend@shrink:
>       {shard-iclb}:       NOTRUN -> DMESG-WARN (fdo#108784)
> 
>     igt@kms_available_modes_crc@available_mode_test_crc:
>       {shard-iclb}:       NOTRUN -> FAIL (fdo#106641)
> 
>     igt@kms_busy@extended-modeset-hang-newfb-render-a:
>       shard-skl:          NOTRUN -> DMESG-WARN (fdo#107956) +2
> 
>     igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-a:
>       shard-hsw:          PASS -> DMESG-WARN (fdo#107956)
> 
>     igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-c:
>       {shard-iclb}:       NOTRUN -> DMESG-WARN (fdo#107956) +5
> 
>     igt@kms_ccs@pipe-a-crc-sprite-planes-basic:
>       {shard-iclb}:       NOTRUN -> FAIL (fdo#107725) +4
> 
>     igt@kms_chv_cursor_fail@pipe-b-256x256-top-edge:
>       shard-skl:          PASS -> FAIL (fdo#104671)
> 
>     igt@kms_chv_cursor_fail@pipe-c-128x128-bottom-edge:
>       shard-skl:          NOTRUN -> FAIL (fdo#104671)
> 
>     igt@kms_cursor_crc@cursor-128x128-sliding:
>       shard-apl:          PASS -> FAIL (fdo#103232) +2
> 
>     igt@kms_cursor_crc@cursor-256x256-random:
>       {shard-iclb}:       NOTRUN -> FAIL (fdo#103232) +9
> 
>     igt@kms_cursor_crc@cursor-64x64-suspend:
>       shard-skl:          PASS -> INCOMPLETE (fdo#104108) +1
> 
>     igt@kms_cursor_legacy@2x-long-nonblocking-modeset-vs-cursor-atomic:
>       shard-glk:          PASS -> FAIL (fdo#106509, fdo#105454)
> 
>     igt@kms_draw_crc@draw-method-xrgb2101010-render-untiled:
>       {shard-iclb}:       PASS -> WARN (fdo#108336) +3
> 
>     igt@kms_draw_crc@draw-method-xrgb8888-pwrite-xtiled:
>       {shard-iclb}:       NOTRUN -> WARN (fdo#108336)
> 
>     igt@kms_fbcon_fbt@psr:
>       {shard-iclb}:       NOTRUN -> FAIL (fdo#107882)
>       shard-skl:          NOTRUN -> FAIL (fdo#107882)
> 
>     igt@kms_flip@busy-flip:
>       {shard-iclb}:       NOTRUN -> DMESG-WARN (fdo#107724) +16
> 
>     igt@kms_frontbuffer_tracking@basic:
>       {shard-iclb}:       PASS -> DMESG-WARN (fdo#107724, fdo#108336) +5
> 
>     igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-move:
>       {shard-iclb}:       PASS -> DMESG-FAIL (fdo#107724) +4
> 
>     igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-onoff:
>       shard-glk:          PASS -> FAIL (fdo#103167)
> 
>     igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-mmap-gtt:
>       {shard-iclb}:       NOTRUN -> DMESG-FAIL (fdo#107724) +4
> 
>     igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-draw-mmap-cpu:
>       shard-skl:          NOTRUN -> FAIL (fdo#103167)
> 
>     igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-draw-pwrite:
>       {shard-iclb}:       PASS -> FAIL (fdo#103167) +2
> 
>     igt@kms_frontbuffer_tracking@psr-1p-primscrn-pri-indfb-draw-blt:
>       {shard-iclb}:       NOTRUN -> DMESG-WARN (fdo#107724, fdo#108336) +6
> 
>     igt@kms_frontbuffer_tracking@psr-1p-primscrn-spr-indfb-draw-pwrite:
>       {shard-iclb}:       NOTRUN -> FAIL (fdo#103167) +4
> 
>     igt@kms_hdmi_inject@inject-audio:
>       {shard-iclb}:       NOTRUN -> FAIL (fdo#102370)
> 
>     igt@kms_panel_fitting@legacy:
>       shard-skl:          NOTRUN -> FAIL (fdo#105456)
> 
>     igt@kms_plane@plane-position-covered-pipe-c-planes:
>       shard-apl:          PASS -> FAIL (fdo#103166) +2
> 
>     igt@kms_plane_alpha_blend@pipe-b-coverage-7efc:
>       shard-skl:          PASS -> FAIL (fdo#107815)
> 
>     igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min:
>       shard-skl:          NOTRUN -> FAIL (fdo#108145) +4
> 
>     igt@kms_plane_multiple@atomic-pipe-b-tiling-y:
>       {shard-iclb}:       NOTRUN -> FAIL (fdo#103166) +4
> 
>     igt@kms_plane_multiple@atomic-pipe-b-tiling-yf:
>       {shard-iclb}:       PASS -> FAIL (fdo#103166) +1
> 
>     igt@kms_psr@no_drrs:
>       {shard-iclb}:       PASS -> FAIL (fdo#108341)
> 
>     igt@kms_rotation_crc@primary-rotation-180:
>       shard-skl:          NOTRUN -> FAIL (fdo#107815, fdo#103925)
> 
>     igt@kms_vblank@pipe-a-ts-continuation-idle:
>       {shard-iclb}:       PASS -> DMESG-WARN (fdo#107724) +11
> 
>     igt@pm_backlight@fade_with_suspend:
>       shard-skl:          NOTRUN -> FAIL (fdo#107847)
> 
>     igt@pm_rps@min-max-config-loaded:
>       {shard-iclb}:       NOTRUN -> FAIL (fdo#102250)
> 
>     
>     ==== Possible fixes ====
> 
>     igt@gem_eio@in-flight-10ms:
>       shard-glk:          FAIL (fdo#107799) -> PASS
> 
>     igt@gem_exec_async@concurrent-writes-vebox:
>       shard-glk:          DMESG-WARN (fdo#106538, fdo#105763) -> PASS +1
> 
>     igt@kms_atomic_transition@1x-modeset-transitions-nonblocking-fencing:
>       shard-skl:          FAIL (fdo#107815, fdo#108470) -> PASS
> 
>     igt@kms_available_modes_crc@available_mode_test_crc:
>       shard-apl:          FAIL (fdo#106641) -> PASS
> 
>     igt@kms_busy@extended-modeset-hang-newfb-render-c:
>       shard-kbl:          DMESG-WARN (fdo#107956) -> PASS
> 
>     igt@kms_chv_cursor_fail@pipe-a-128x128-left-edge:
>       shard-skl:          FAIL (fdo#104671) -> PASS
> 
>     igt@kms_color@pipe-c-gamma:
>       shard-skl:          FAIL (fdo#108228, fdo#104782) -> PASS
> 
>     igt@kms_cursor_crc@cursor-64x64-suspend:
>       shard-glk:          FAIL (fdo#103232) -> PASS +3
> 
>     igt@kms_draw_crc@draw-method-rgb565-mmap-gtt-xtiled:
>       shard-skl:          FAIL (fdo#103184) -> PASS
> 
>     igt@kms_flip@flip-vs-absolute-wf_vblank:
>       shard-apl:          DMESG-WARN (fdo#103558, fdo#105602) -> PASS +16
> 
>     igt@kms_flip_tiling@flip-changes-tiling-yf:
>       shard-kbl:          DMESG-WARN (fdo#105604) -> PASS
> 
>     igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-onoff:
>       shard-apl:          FAIL (fdo#103167) -> PASS
> 
>     igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-pwrite:
>       shard-glk:          FAIL (fdo#103167) -> PASS +1
> 
>     igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-cur-indfb-move:
>       shard-glk:          INCOMPLETE (k.org#198133, fdo#103359) -> PASS
> 
>     igt@kms_frontbuffer_tracking@psr-1p-primscrn-pri-indfb-draw-mmap-gtt:
>       shard-skl:          FAIL (fdo#103167) -> PASS
> 
>     igt@kms_plane@plane-panning-bottom-right-pipe-c-planes:
>       shard-skl:          FAIL (fdo#103166) -> PASS
> 
>     igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes:
>       shard-skl:          INCOMPLETE (fdo#107773, fdo#104108) -> PASS
> 
>     igt@kms_plane_alpha_blend@pipe-c-alpha-opaque-fb:
>       shard-glk:          FAIL (fdo#108145) -> PASS
> 
>     igt@kms_plane_multiple@atomic-pipe-b-tiling-y:
>       shard-apl:          FAIL (fdo#103166) -> PASS +1
> 
>     igt@kms_plane_multiple@atomic-pipe-c-tiling-x:
>       shard-glk:          FAIL (fdo#103166) -> PASS +1
> 
>     igt@perf@polling:
>       shard-hsw:          FAIL (fdo#102252) -> PASS
> 
>     igt@pm_rpm@legacy-planes:
>       shard-skl:          INCOMPLETE (fdo#105959, fdo#107807) -> PASS +1
>       {shard-iclb}:       DMESG-WARN (fdo#108654) -> PASS
> 
>     igt@pm_rpm@system-suspend-modeset:
>       shard-skl:          INCOMPLETE (fdo#104108, fdo#107807) -> PASS
> 
>     
>     ==== Warnings ====
> 
>     igt@i915_suspend@shrink:
>       shard-skl:          INCOMPLETE (fdo#106886) -> DMESG-WARN (fdo#108784)
> 
>     igt@kms_ccs@pipe-c-crc-primary-basic:
>       {shard-iclb}:       FAIL (fdo#107725) -> DMESG-WARN (fdo#107724, fdo#108336)
> 
>     igt@kms_content_protection@atomic:
>       shard-apl:          FAIL (fdo#108597) -> INCOMPLETE (fdo#103927)
> 
>     igt@kms_cursor_crc@cursor-64x64-random:
>       shard-apl:          DMESG-WARN (fdo#103558, fdo#105602) -> FAIL (fdo#103232)
> 
>     
>   {name}: This element is suppressed. This means it is ignored when computing
>           the status of the difference (SUCCESS, WARNING, or FAILURE).
> 
>   fdo#102250 https://bugs.freedesktop.org/show_bug.cgi?id=102250
>   fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
>   fdo#102370 https://bugs.freedesktop.org/show_bug.cgi?id=102370
>   fdo#103158 https://bugs.freedesktop.org/show_bug.cgi?id=103158
>   fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
>   fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
>   fdo#103184 https://bugs.freedesktop.org/show_bug.cgi?id=103184
>   fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
>   fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
>   fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
>   fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
>   fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
>   fdo#104108 https://bugs.freedesktop.org/show_bug.cgi?id=104108
>   fdo#104671 https://bugs.freedesktop.org/show_bug.cgi?id=104671
>   fdo#104782 https://bugs.freedesktop.org/show_bug.cgi?id=104782
>   fdo#105454 https://bugs.freedesktop.org/show_bug.cgi?id=105454
>   fdo#105456 https://bugs.freedesktop.org/show_bug.cgi?id=105456
>   fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
>   fdo#105604 https://bugs.freedesktop.org/show_bug.cgi?id=105604
>   fdo#105763 https://bugs.freedesktop.org/show_bug.cgi?id=105763
>   fdo#105959 https://bugs.freedesktop.org/show_bug.cgi?id=105959
>   fdo#106509 https://bugs.freedesktop.org/show_bug.cgi?id=106509
>   fdo#106538 https://bugs.freedesktop.org/show_bug.cgi?id=106538
>   fdo#106641 https://bugs.freedesktop.org/show_bug.cgi?id=106641
>   fdo#106886 https://bugs.freedesktop.org/show_bug.cgi?id=106886
>   fdo#107724 https://bugs.freedesktop.org/show_bug.cgi?id=107724
>   fdo#107725 https://bugs.freedesktop.org/show_bug.cgi?id=107725
>   fdo#107773 https://bugs.freedesktop.org/show_bug.cgi?id=107773
>   fdo#107799 https://bugs.freedesktop.org/show_bug.cgi?id=107799
>   fdo#107807 https://bugs.freedesktop.org/show_bug.cgi?id=107807
>   fdo#107815 https://bugs.freedesktop.org/show_bug.cgi?id=107815
>   fdo#107847 https://bugs.freedesktop.org/show_bug.cgi?id=107847
>   fdo#107882 https://bugs.freedesktop.org/show_bug.cgi?id=107882
>   fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
>   fdo#108039 https://bugs.freedesktop.org/show_bug.cgi?id=108039
>   fdo#108145 https://bugs.freedesktop.org/show_bug.cgi?id=108145
>   fdo#108228 https://bugs.freedesktop.org/show_bug.cgi?id=108228
>   fdo#108336 https://bugs.freedesktop.org/show_bug.cgi?id=108336
>   fdo#108341 https://bugs.freedesktop.org/show_bug.cgi?id=108341
>   fdo#108470 https://bugs.freedesktop.org/show_bug.cgi?id=108470
>   fdo#108597 https://bugs.freedesktop.org/show_bug.cgi?id=108597
>   fdo#108654 https://bugs.freedesktop.org/show_bug.cgi?id=108654
>   fdo#108667 https://bugs.freedesktop.org/show_bug.cgi?id=108667
>   fdo#108784 https://bugs.freedesktop.org/show_bug.cgi?id=108784
>   k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133
> 
> 
> == Participating hosts (7 -> 7) ==
> 
>   No changes in participating hosts
> 
> 
> == Build changes ==
> 
>     * Linux: CI_DRM_5169 -> Patchwork_10857
> 
>   CI_DRM_5169: ed08968fdc2130ba3cb6f3d7dbe82b6a8c39973d @ git://anongit.freedesktop.org/gfx-ci/linux
>   IGT_4720: c27aaca295d3ca2a38521e571c012449371e4bb5 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
>   Patchwork_10857: e57fe9da9a20d3e7fc3135f388d0c9c697f84ba2 @ git://anongit.freedesktop.org/gfx-ci/linux
>   piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
> 
> == Logs ==
> 
> For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10857/shards.html