Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915: Move skl+ wm/ddb registers to proper headers

On SKL+ the watermark/DDB registers are proper per-plane
registers. Move the definitons to their respective files.

Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
CC: Zhi Wang <zhi.wang.linux@gmail.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240510152329.24098-5-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>

+86 -83
+20
drivers/gpu/drm/i915/display/intel_cursor_regs.h
··· 75 75 #define CUR_CHICKEN(pipe) _MMIO_CURSOR2(dev_priv, pipe, _CUR_CHICKEN_A) 76 76 #define CURSURFLIVE(pipe) _MMIO_CURSOR2(dev_priv, pipe, _CURASURFLIVE) 77 77 78 + /* skl+ */ 79 + #define _CUR_WM_A_0 0x70140 80 + #define _CUR_WM_B_0 0x71140 81 + #define _CUR_WM_SAGV_A 0x70158 82 + #define _CUR_WM_SAGV_B 0x71158 83 + #define _CUR_WM_SAGV_TRANS_A 0x7015C 84 + #define _CUR_WM_SAGV_TRANS_B 0x7115C 85 + #define _CUR_WM_TRANS_A 0x70168 86 + #define _CUR_WM_TRANS_B 0x71168 87 + #define _CUR_WM_0(pipe) _PIPE(pipe, _CUR_WM_A_0, _CUR_WM_B_0) 88 + #define CUR_WM(pipe, level) _MMIO(_CUR_WM_0(pipe) + ((4) * (level))) 89 + #define CUR_WM_SAGV(pipe) _MMIO_PIPE(pipe, _CUR_WM_SAGV_A, _CUR_WM_SAGV_B) 90 + #define CUR_WM_SAGV_TRANS(pipe) _MMIO_PIPE(pipe, _CUR_WM_SAGV_TRANS_A, _CUR_WM_SAGV_TRANS_B) 91 + #define CUR_WM_TRANS(pipe) _MMIO_PIPE(pipe, _CUR_WM_TRANS_A, _CUR_WM_TRANS_B) 92 + 93 + /* skl+ */ 94 + #define _CUR_BUF_CFG_A 0x7017c 95 + #define _CUR_BUF_CFG_B 0x7117c 96 + #define CUR_BUF_CFG(pipe) _MMIO_PIPE(pipe, _CUR_BUF_CFG_A, _CUR_BUF_CFG_B) 97 + 78 98 #endif /* __INTEL_CURSOR_REGS_H__ */
+64
drivers/gpu/drm/i915/display/skl_universal_plane_regs.h
··· 402 402 (index) * 4, _PLANE_CSC_POSTOFF_HI_2(pipe) + \ 403 403 (index) * 4) 404 404 405 + #define _PLANE_WM_1_A_0 0x70240 406 + #define _PLANE_WM_1_B_0 0x71240 407 + #define _PLANE_WM_2_A_0 0x70340 408 + #define _PLANE_WM_2_B_0 0x71340 409 + #define _PLANE_WM_SAGV_1_A 0x70258 410 + #define _PLANE_WM_SAGV_1_B 0x71258 411 + #define _PLANE_WM_SAGV_2_A 0x70358 412 + #define _PLANE_WM_SAGV_2_B 0x71358 413 + #define _PLANE_WM_SAGV_TRANS_1_A 0x7025C 414 + #define _PLANE_WM_SAGV_TRANS_1_B 0x7125C 415 + #define _PLANE_WM_SAGV_TRANS_2_A 0x7035C 416 + #define _PLANE_WM_SAGV_TRANS_2_B 0x7135C 417 + #define _PLANE_WM_TRANS_1_A 0x70268 418 + #define _PLANE_WM_TRANS_1_B 0x71268 419 + #define _PLANE_WM_TRANS_2_A 0x70368 420 + #define _PLANE_WM_TRANS_2_B 0x71368 421 + #define PLANE_WM_EN (1 << 31) 422 + #define PLANE_WM_IGNORE_LINES (1 << 30) 423 + #define PLANE_WM_LINES_MASK REG_GENMASK(26, 14) 424 + #define PLANE_WM_BLOCKS_MASK REG_GENMASK(11, 0) 425 + 426 + #define _PLANE_WM_1(pipe) _PIPE(pipe, _PLANE_WM_1_A_0, _PLANE_WM_1_B_0) 427 + #define _PLANE_WM_2(pipe) _PIPE(pipe, _PLANE_WM_2_A_0, _PLANE_WM_2_B_0) 428 + #define _PLANE_WM_BASE(pipe, plane) \ 429 + _PLANE(plane, _PLANE_WM_1(pipe), _PLANE_WM_2(pipe)) 430 + #define PLANE_WM(pipe, plane, level) \ 431 + _MMIO(_PLANE_WM_BASE(pipe, plane) + ((4) * (level))) 432 + #define _PLANE_WM_SAGV_1(pipe) \ 433 + _PIPE(pipe, _PLANE_WM_SAGV_1_A, _PLANE_WM_SAGV_1_B) 434 + #define _PLANE_WM_SAGV_2(pipe) \ 435 + _PIPE(pipe, _PLANE_WM_SAGV_2_A, _PLANE_WM_SAGV_2_B) 436 + #define PLANE_WM_SAGV(pipe, plane) \ 437 + _MMIO(_PLANE(plane, _PLANE_WM_SAGV_1(pipe), _PLANE_WM_SAGV_2(pipe))) 438 + #define _PLANE_WM_SAGV_TRANS_1(pipe) \ 439 + _PIPE(pipe, _PLANE_WM_SAGV_TRANS_1_A, _PLANE_WM_SAGV_TRANS_1_B) 440 + #define _PLANE_WM_SAGV_TRANS_2(pipe) \ 441 + _PIPE(pipe, _PLANE_WM_SAGV_TRANS_2_A, _PLANE_WM_SAGV_TRANS_2_B) 442 + #define PLANE_WM_SAGV_TRANS(pipe, plane) \ 443 + _MMIO(_PLANE(plane, _PLANE_WM_SAGV_TRANS_1(pipe), _PLANE_WM_SAGV_TRANS_2(pipe))) 444 + #define _PLANE_WM_TRANS_1(pipe) \ 445 + _PIPE(pipe, _PLANE_WM_TRANS_1_A, _PLANE_WM_TRANS_1_B) 446 + #define _PLANE_WM_TRANS_2(pipe) \ 447 + _PIPE(pipe, _PLANE_WM_TRANS_2_A, _PLANE_WM_TRANS_2_B) 448 + #define PLANE_WM_TRANS(pipe, plane) \ 449 + _MMIO(_PLANE(plane, _PLANE_WM_TRANS_1(pipe), _PLANE_WM_TRANS_2(pipe))) 450 + 451 + #define _PLANE_BUF_CFG_1_B 0x7127c 452 + #define _PLANE_BUF_CFG_2_B 0x7137c 453 + #define _PLANE_BUF_CFG_1(pipe) \ 454 + _PIPE(pipe, _PLANE_BUF_CFG_1_A, _PLANE_BUF_CFG_1_B) 455 + #define _PLANE_BUF_CFG_2(pipe) \ 456 + _PIPE(pipe, _PLANE_BUF_CFG_2_A, _PLANE_BUF_CFG_2_B) 457 + #define PLANE_BUF_CFG(pipe, plane) \ 458 + _MMIO_PLANE(plane, _PLANE_BUF_CFG_1(pipe), _PLANE_BUF_CFG_2(pipe)) 459 + 460 + #define _PLANE_NV12_BUF_CFG_1_B 0x71278 461 + #define _PLANE_NV12_BUF_CFG_2_B 0x71378 462 + #define _PLANE_NV12_BUF_CFG_1(pipe) \ 463 + _PIPE(pipe, _PLANE_NV12_BUF_CFG_1_A, _PLANE_NV12_BUF_CFG_1_B) 464 + #define _PLANE_NV12_BUF_CFG_2(pipe) \ 465 + _PIPE(pipe, _PLANE_NV12_BUF_CFG_2_A, _PLANE_NV12_BUF_CFG_2_B) 466 + #define PLANE_NV12_BUF_CFG(pipe, plane) \ 467 + _MMIO_PLANE(plane, _PLANE_NV12_BUF_CFG_1(pipe), _PLANE_NV12_BUF_CFG_2(pipe)) 468 + 405 469 #endif /* __SKL_UNIVERSAL_PLANE_REGS_H__ */
+1
drivers/gpu/drm/i915/display/skl_watermark.c
··· 13 13 #include "intel_bw.h" 14 14 #include "intel_cdclk.h" 15 15 #include "intel_crtc.h" 16 + #include "intel_cursor_regs.h" 16 17 #include "intel_de.h" 17 18 #include "intel_display.h" 18 19 #include "intel_display_power.h"
-83
drivers/gpu/drm/i915/display/skl_watermark_regs.h
··· 43 43 #define MBUS_TRANSLATION_THROTTLE_MIN_MASK REG_GENMASK(15, 13) 44 44 #define MBUS_TRANSLATION_THROTTLE_MIN(val) REG_FIELD_PREP(MBUS_TRANSLATION_THROTTLE_MIN_MASK, val) 45 45 46 - /* Watermark register definitions for SKL */ 47 - #define _CUR_WM_A_0 0x70140 48 - #define _CUR_WM_B_0 0x71140 49 - #define _CUR_WM_SAGV_A 0x70158 50 - #define _CUR_WM_SAGV_B 0x71158 51 - #define _CUR_WM_SAGV_TRANS_A 0x7015C 52 - #define _CUR_WM_SAGV_TRANS_B 0x7115C 53 - #define _CUR_WM_TRANS_A 0x70168 54 - #define _CUR_WM_TRANS_B 0x71168 55 - #define _PLANE_WM_1_A_0 0x70240 56 - #define _PLANE_WM_1_B_0 0x71240 57 - #define _PLANE_WM_2_A_0 0x70340 58 - #define _PLANE_WM_2_B_0 0x71340 59 - #define _PLANE_WM_SAGV_1_A 0x70258 60 - #define _PLANE_WM_SAGV_1_B 0x71258 61 - #define _PLANE_WM_SAGV_2_A 0x70358 62 - #define _PLANE_WM_SAGV_2_B 0x71358 63 - #define _PLANE_WM_SAGV_TRANS_1_A 0x7025C 64 - #define _PLANE_WM_SAGV_TRANS_1_B 0x7125C 65 - #define _PLANE_WM_SAGV_TRANS_2_A 0x7035C 66 - #define _PLANE_WM_SAGV_TRANS_2_B 0x7135C 67 - #define _PLANE_WM_TRANS_1_A 0x70268 68 - #define _PLANE_WM_TRANS_1_B 0x71268 69 - #define _PLANE_WM_TRANS_2_A 0x70368 70 - #define _PLANE_WM_TRANS_2_B 0x71368 71 - #define PLANE_WM_EN (1 << 31) 72 - #define PLANE_WM_IGNORE_LINES (1 << 30) 73 - #define PLANE_WM_LINES_MASK REG_GENMASK(26, 14) 74 - #define PLANE_WM_BLOCKS_MASK REG_GENMASK(11, 0) 75 - 76 - #define _CUR_WM_0(pipe) _PIPE(pipe, _CUR_WM_A_0, _CUR_WM_B_0) 77 - #define CUR_WM(pipe, level) _MMIO(_CUR_WM_0(pipe) + ((4) * (level))) 78 - #define CUR_WM_SAGV(pipe) _MMIO_PIPE(pipe, _CUR_WM_SAGV_A, _CUR_WM_SAGV_B) 79 - #define CUR_WM_SAGV_TRANS(pipe) _MMIO_PIPE(pipe, _CUR_WM_SAGV_TRANS_A, _CUR_WM_SAGV_TRANS_B) 80 - #define CUR_WM_TRANS(pipe) _MMIO_PIPE(pipe, _CUR_WM_TRANS_A, _CUR_WM_TRANS_B) 81 - #define _PLANE_WM_1(pipe) _PIPE(pipe, _PLANE_WM_1_A_0, _PLANE_WM_1_B_0) 82 - #define _PLANE_WM_2(pipe) _PIPE(pipe, _PLANE_WM_2_A_0, _PLANE_WM_2_B_0) 83 - #define _PLANE_WM_BASE(pipe, plane) \ 84 - _PLANE(plane, _PLANE_WM_1(pipe), _PLANE_WM_2(pipe)) 85 - #define PLANE_WM(pipe, plane, level) \ 86 - _MMIO(_PLANE_WM_BASE(pipe, plane) + ((4) * (level))) 87 - #define _PLANE_WM_SAGV_1(pipe) \ 88 - _PIPE(pipe, _PLANE_WM_SAGV_1_A, _PLANE_WM_SAGV_1_B) 89 - #define _PLANE_WM_SAGV_2(pipe) \ 90 - _PIPE(pipe, _PLANE_WM_SAGV_2_A, _PLANE_WM_SAGV_2_B) 91 - #define PLANE_WM_SAGV(pipe, plane) \ 92 - _MMIO(_PLANE(plane, _PLANE_WM_SAGV_1(pipe), _PLANE_WM_SAGV_2(pipe))) 93 - #define _PLANE_WM_SAGV_TRANS_1(pipe) \ 94 - _PIPE(pipe, _PLANE_WM_SAGV_TRANS_1_A, _PLANE_WM_SAGV_TRANS_1_B) 95 - #define _PLANE_WM_SAGV_TRANS_2(pipe) \ 96 - _PIPE(pipe, _PLANE_WM_SAGV_TRANS_2_A, _PLANE_WM_SAGV_TRANS_2_B) 97 - #define PLANE_WM_SAGV_TRANS(pipe, plane) \ 98 - _MMIO(_PLANE(plane, _PLANE_WM_SAGV_TRANS_1(pipe), _PLANE_WM_SAGV_TRANS_2(pipe))) 99 - #define _PLANE_WM_TRANS_1(pipe) \ 100 - _PIPE(pipe, _PLANE_WM_TRANS_1_A, _PLANE_WM_TRANS_1_B) 101 - #define _PLANE_WM_TRANS_2(pipe) \ 102 - _PIPE(pipe, _PLANE_WM_TRANS_2_A, _PLANE_WM_TRANS_2_B) 103 - #define PLANE_WM_TRANS(pipe, plane) \ 104 - _MMIO(_PLANE(plane, _PLANE_WM_TRANS_1(pipe), _PLANE_WM_TRANS_2(pipe))) 105 - 106 - #define _PLANE_BUF_CFG_1_B 0x7127c 107 - #define _PLANE_BUF_CFG_2_B 0x7137c 108 - #define _PLANE_BUF_CFG_1(pipe) \ 109 - _PIPE(pipe, _PLANE_BUF_CFG_1_A, _PLANE_BUF_CFG_1_B) 110 - #define _PLANE_BUF_CFG_2(pipe) \ 111 - _PIPE(pipe, _PLANE_BUF_CFG_2_A, _PLANE_BUF_CFG_2_B) 112 - #define PLANE_BUF_CFG(pipe, plane) \ 113 - _MMIO_PLANE(plane, _PLANE_BUF_CFG_1(pipe), _PLANE_BUF_CFG_2(pipe)) 114 - 115 - #define _PLANE_NV12_BUF_CFG_1_B 0x71278 116 - #define _PLANE_NV12_BUF_CFG_2_B 0x71378 117 - #define _PLANE_NV12_BUF_CFG_1(pipe) \ 118 - _PIPE(pipe, _PLANE_NV12_BUF_CFG_1_A, _PLANE_NV12_BUF_CFG_1_B) 119 - #define _PLANE_NV12_BUF_CFG_2(pipe) \ 120 - _PIPE(pipe, _PLANE_NV12_BUF_CFG_2_A, _PLANE_NV12_BUF_CFG_2_B) 121 - #define PLANE_NV12_BUF_CFG(pipe, plane) \ 122 - _MMIO_PLANE(plane, _PLANE_NV12_BUF_CFG_1(pipe), _PLANE_NV12_BUF_CFG_2(pipe)) 123 - 124 - /* SKL new cursor registers */ 125 - #define _CUR_BUF_CFG_A 0x7017c 126 - #define _CUR_BUF_CFG_B 0x7117c 127 - #define CUR_BUF_CFG(pipe) _MMIO_PIPE(pipe, _CUR_BUF_CFG_A, _CUR_BUF_CFG_B) 128 - 129 46 /* 130 47 * The below are numbered starting from "S1" on gen11/gen12, but starting 131 48 * with display 13, the bspec switches to a 0-based numbering scheme
+1
drivers/gpu/drm/i915/gvt/handlers.c
··· 42 42 #include "i915_pvinfo.h" 43 43 #include "intel_mchbar_regs.h" 44 44 #include "display/bxt_dpio_phy_regs.h" 45 + #include "display/intel_cursor_regs.h" 45 46 #include "display/intel_display_types.h" 46 47 #include "display/intel_dmc_regs.h" 47 48 #include "display/intel_dp_aux_regs.h"