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

drm/i915: Extract intel_cursor_regs.h

Move most cursor register definitions into their own file.
Declutters i915_reg.h a bit more.

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-4-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>

+84 -70
+1
drivers/gpu/drm/i915/display/intel_cursor.c
··· 14 14 #include "intel_atomic.h" 15 15 #include "intel_atomic_plane.h" 16 16 #include "intel_cursor.h" 17 + #include "intel_cursor_regs.h" 17 18 #include "intel_de.h" 18 19 #include "intel_display.h" 19 20 #include "intel_display_types.h"
+78
drivers/gpu/drm/i915/display/intel_cursor_regs.h
··· 1 + /* SPDX-License-Identifier: MIT */ 2 + /* 3 + * Copyright © 2024 Intel Corporation 4 + */ 5 + 6 + #ifndef __INTEL_CURSOR_REGS_H__ 7 + #define __INTEL_CURSOR_REGS_H__ 8 + 9 + #include "intel_display_reg_defs.h" 10 + 11 + #define _CURACNTR 0x70080 12 + /* Old style CUR*CNTR flags (desktop 8xx) */ 13 + #define CURSOR_ENABLE REG_BIT(31) 14 + #define CURSOR_PIPE_GAMMA_ENABLE REG_BIT(30) 15 + #define CURSOR_STRIDE_MASK REG_GENMASK(29, 28) 16 + #define CURSOR_STRIDE(stride) REG_FIELD_PREP(CURSOR_STRIDE_MASK, ffs(stride) - 9) /* 256,512,1k,2k */ 17 + #define CURSOR_FORMAT_MASK REG_GENMASK(26, 24) 18 + #define CURSOR_FORMAT_2C REG_FIELD_PREP(CURSOR_FORMAT_MASK, 0) 19 + #define CURSOR_FORMAT_3C REG_FIELD_PREP(CURSOR_FORMAT_MASK, 1) 20 + #define CURSOR_FORMAT_4C REG_FIELD_PREP(CURSOR_FORMAT_MASK, 2) 21 + #define CURSOR_FORMAT_ARGB REG_FIELD_PREP(CURSOR_FORMAT_MASK, 4) 22 + #define CURSOR_FORMAT_XRGB REG_FIELD_PREP(CURSOR_FORMAT_MASK, 5) 23 + /* New style CUR*CNTR flags */ 24 + #define MCURSOR_ARB_SLOTS_MASK REG_GENMASK(30, 28) /* icl+ */ 25 + #define MCURSOR_ARB_SLOTS(x) REG_FIELD_PREP(MCURSOR_ARB_SLOTS_MASK, (x)) /* icl+ */ 26 + #define MCURSOR_PIPE_SEL_MASK REG_GENMASK(29, 28) 27 + #define MCURSOR_PIPE_SEL(pipe) REG_FIELD_PREP(MCURSOR_PIPE_SEL_MASK, (pipe)) 28 + #define MCURSOR_PIPE_GAMMA_ENABLE REG_BIT(26) 29 + #define MCURSOR_PIPE_CSC_ENABLE REG_BIT(24) /* ilk+ */ 30 + #define MCURSOR_ROTATE_180 REG_BIT(15) 31 + #define MCURSOR_TRICKLE_FEED_DISABLE REG_BIT(14) 32 + #define MCURSOR_MODE_MASK 0x27 33 + #define MCURSOR_MODE_DISABLE 0x00 34 + #define MCURSOR_MODE_128_32B_AX 0x02 35 + #define MCURSOR_MODE_256_32B_AX 0x03 36 + #define MCURSOR_MODE_64_2B 0x04 37 + #define MCURSOR_MODE_64_32B_AX 0x07 38 + #define MCURSOR_MODE_128_ARGB_AX (0x20 | MCURSOR_MODE_128_32B_AX) 39 + #define MCURSOR_MODE_256_ARGB_AX (0x20 | MCURSOR_MODE_256_32B_AX) 40 + #define MCURSOR_MODE_64_ARGB_AX (0x20 | MCURSOR_MODE_64_32B_AX) 41 + #define _CURABASE 0x70084 42 + #define _CURAPOS 0x70088 43 + #define _CURAPOS_ERLY_TPT 0x7008c 44 + #define CURSOR_POS_Y_SIGN REG_BIT(31) 45 + #define CURSOR_POS_Y_MASK REG_GENMASK(30, 16) 46 + #define CURSOR_POS_Y(y) REG_FIELD_PREP(CURSOR_POS_Y_MASK, (y)) 47 + #define CURSOR_POS_X_SIGN REG_BIT(15) 48 + #define CURSOR_POS_X_MASK REG_GENMASK(14, 0) 49 + #define CURSOR_POS_X(x) REG_FIELD_PREP(CURSOR_POS_X_MASK, (x)) 50 + #define _CURASIZE 0x700a0 /* 845/865 */ 51 + #define CURSOR_HEIGHT_MASK REG_GENMASK(21, 12) 52 + #define CURSOR_HEIGHT(h) REG_FIELD_PREP(CURSOR_HEIGHT_MASK, (h)) 53 + #define CURSOR_WIDTH_MASK REG_GENMASK(9, 0) 54 + #define CURSOR_WIDTH(w) REG_FIELD_PREP(CURSOR_WIDTH_MASK, (w)) 55 + #define _CUR_FBC_CTL_A 0x700a0 /* ivb+ */ 56 + #define CUR_FBC_EN REG_BIT(31) 57 + #define CUR_FBC_HEIGHT_MASK REG_GENMASK(7, 0) 58 + #define CUR_FBC_HEIGHT(h) REG_FIELD_PREP(CUR_FBC_HEIGHT_MASK, (h)) 59 + #define _CUR_CHICKEN_A 0x700a4 /* mtl+ */ 60 + #define _CURASURFLIVE 0x700ac /* g4x+ */ 61 + #define _CURBCNTR 0x700c0 62 + #define _CURBBASE 0x700c4 63 + #define _CURBPOS 0x700c8 64 + 65 + #define _CURBCNTR_IVB 0x71080 66 + #define _CURBBASE_IVB 0x71084 67 + #define _CURBPOS_IVB 0x71088 68 + 69 + #define CURCNTR(pipe) _MMIO_CURSOR2(dev_priv, pipe, _CURACNTR) 70 + #define CURBASE(pipe) _MMIO_CURSOR2(dev_priv, pipe, _CURABASE) 71 + #define CURPOS(pipe) _MMIO_CURSOR2(dev_priv, pipe, _CURAPOS) 72 + #define CURPOS_ERLY_TPT(pipe) _MMIO_CURSOR2(dev_priv, pipe, _CURAPOS_ERLY_TPT) 73 + #define CURSIZE(pipe) _MMIO_CURSOR2(dev_priv, pipe, _CURASIZE) 74 + #define CUR_FBC_CTL(pipe) _MMIO_CURSOR2(dev_priv, pipe, _CUR_FBC_CTL_A) 75 + #define CUR_CHICKEN(pipe) _MMIO_CURSOR2(dev_priv, pipe, _CUR_CHICKEN_A) 76 + #define CURSURFLIVE(pipe) _MMIO_CURSOR2(dev_priv, pipe, _CURASURFLIVE) 77 + 78 + #endif /* __INTEL_CURSOR_REGS_H__ */
+1
drivers/gpu/drm/i915/display/intel_display.c
··· 65 65 #include "intel_crt.h" 66 66 #include "intel_crtc.h" 67 67 #include "intel_crtc_state_dump.h" 68 + #include "intel_cursor_regs.h" 68 69 #include "intel_ddi.h" 69 70 #include "intel_de.h" 70 71 #include "intel_display_driver.h"
+1
drivers/gpu/drm/i915/display/intel_psr.c
··· 29 29 #include "i915_reg.h" 30 30 #include "intel_atomic.h" 31 31 #include "intel_crtc.h" 32 + #include "intel_cursor_regs.h" 32 33 #include "intel_ddi.h" 33 34 #include "intel_de.h" 34 35 #include "intel_display_types.h"
+1
drivers/gpu/drm/i915/gvt/display.c
··· 37 37 #include "gvt.h" 38 38 39 39 #include "display/bxt_dpio_phy_regs.h" 40 + #include "display/intel_cursor_regs.h" 40 41 #include "display/intel_display.h" 41 42 #include "display/intel_dpio_phy.h" 42 43 #include "display/intel_sprite_regs.h"
+1
drivers/gpu/drm/i915/gvt/fb_decoder.c
··· 40 40 #include "i915_pvinfo.h" 41 41 #include "i915_reg.h" 42 42 43 + #include "display/intel_cursor_regs.h" 43 44 #include "display/intel_sprite_regs.h" 44 45 #include "display/skl_universal_plane_regs.h" 45 46
-70
drivers/gpu/drm/i915/i915_reg.h
··· 1762 1762 #define PIPE_LINK_M_G4X(pipe) _MMIO_PIPE(pipe, _PIPEA_LINK_M_G4X, _PIPEB_LINK_M_G4X) 1763 1763 #define PIPE_LINK_N_G4X(pipe) _MMIO_PIPE(pipe, _PIPEA_LINK_N_G4X, _PIPEB_LINK_N_G4X) 1764 1764 1765 - /* Display & cursor control */ 1766 - 1767 1765 /* Pipe A */ 1768 1766 #define _PIPEADSL 0x70000 1769 1767 #define PIPEDSL_CURR_FIELD REG_BIT(31) /* ctg+ */ ··· 2263 2265 #define _PIPEA_FLIPCOUNT_G4X 0x70044 2264 2266 #define PIPE_FRMCOUNT_G4X(pipe) _MMIO_PIPE2(dev_priv, pipe, _PIPEA_FRMCOUNT_G4X) 2265 2267 #define PIPE_FLIPCOUNT_G4X(pipe) _MMIO_PIPE2(dev_priv, pipe, _PIPEA_FLIPCOUNT_G4X) 2266 - 2267 - /* Cursor A & B regs */ 2268 - #define _CURACNTR 0x70080 2269 - /* Old style CUR*CNTR flags (desktop 8xx) */ 2270 - #define CURSOR_ENABLE REG_BIT(31) 2271 - #define CURSOR_PIPE_GAMMA_ENABLE REG_BIT(30) 2272 - #define CURSOR_STRIDE_MASK REG_GENMASK(29, 28) 2273 - #define CURSOR_STRIDE(stride) REG_FIELD_PREP(CURSOR_STRIDE_MASK, ffs(stride) - 9) /* 256,512,1k,2k */ 2274 - #define CURSOR_FORMAT_MASK REG_GENMASK(26, 24) 2275 - #define CURSOR_FORMAT_2C REG_FIELD_PREP(CURSOR_FORMAT_MASK, 0) 2276 - #define CURSOR_FORMAT_3C REG_FIELD_PREP(CURSOR_FORMAT_MASK, 1) 2277 - #define CURSOR_FORMAT_4C REG_FIELD_PREP(CURSOR_FORMAT_MASK, 2) 2278 - #define CURSOR_FORMAT_ARGB REG_FIELD_PREP(CURSOR_FORMAT_MASK, 4) 2279 - #define CURSOR_FORMAT_XRGB REG_FIELD_PREP(CURSOR_FORMAT_MASK, 5) 2280 - /* New style CUR*CNTR flags */ 2281 - #define MCURSOR_ARB_SLOTS_MASK REG_GENMASK(30, 28) /* icl+ */ 2282 - #define MCURSOR_ARB_SLOTS(x) REG_FIELD_PREP(MCURSOR_ARB_SLOTS_MASK, (x)) /* icl+ */ 2283 - #define MCURSOR_PIPE_SEL_MASK REG_GENMASK(29, 28) 2284 - #define MCURSOR_PIPE_SEL(pipe) REG_FIELD_PREP(MCURSOR_PIPE_SEL_MASK, (pipe)) 2285 - #define MCURSOR_PIPE_GAMMA_ENABLE REG_BIT(26) 2286 - #define MCURSOR_PIPE_CSC_ENABLE REG_BIT(24) /* ilk+ */ 2287 - #define MCURSOR_ROTATE_180 REG_BIT(15) 2288 - #define MCURSOR_TRICKLE_FEED_DISABLE REG_BIT(14) 2289 - #define MCURSOR_MODE_MASK 0x27 2290 - #define MCURSOR_MODE_DISABLE 0x00 2291 - #define MCURSOR_MODE_128_32B_AX 0x02 2292 - #define MCURSOR_MODE_256_32B_AX 0x03 2293 - #define MCURSOR_MODE_64_2B 0x04 2294 - #define MCURSOR_MODE_64_32B_AX 0x07 2295 - #define MCURSOR_MODE_128_ARGB_AX (0x20 | MCURSOR_MODE_128_32B_AX) 2296 - #define MCURSOR_MODE_256_ARGB_AX (0x20 | MCURSOR_MODE_256_32B_AX) 2297 - #define MCURSOR_MODE_64_ARGB_AX (0x20 | MCURSOR_MODE_64_32B_AX) 2298 - #define _CURABASE 0x70084 2299 - #define _CURAPOS 0x70088 2300 - #define _CURAPOS_ERLY_TPT 0x7008c 2301 - #define CURSOR_POS_Y_SIGN REG_BIT(31) 2302 - #define CURSOR_POS_Y_MASK REG_GENMASK(30, 16) 2303 - #define CURSOR_POS_Y(y) REG_FIELD_PREP(CURSOR_POS_Y_MASK, (y)) 2304 - #define CURSOR_POS_X_SIGN REG_BIT(15) 2305 - #define CURSOR_POS_X_MASK REG_GENMASK(14, 0) 2306 - #define CURSOR_POS_X(x) REG_FIELD_PREP(CURSOR_POS_X_MASK, (x)) 2307 - #define _CURASIZE 0x700a0 /* 845/865 */ 2308 - #define CURSOR_HEIGHT_MASK REG_GENMASK(21, 12) 2309 - #define CURSOR_HEIGHT(h) REG_FIELD_PREP(CURSOR_HEIGHT_MASK, (h)) 2310 - #define CURSOR_WIDTH_MASK REG_GENMASK(9, 0) 2311 - #define CURSOR_WIDTH(w) REG_FIELD_PREP(CURSOR_WIDTH_MASK, (w)) 2312 - #define _CUR_FBC_CTL_A 0x700a0 /* ivb+ */ 2313 - #define CUR_FBC_EN REG_BIT(31) 2314 - #define CUR_FBC_HEIGHT_MASK REG_GENMASK(7, 0) 2315 - #define CUR_FBC_HEIGHT(h) REG_FIELD_PREP(CUR_FBC_HEIGHT_MASK, (h)) 2316 - #define _CUR_CHICKEN_A 0x700a4 /* mtl+ */ 2317 - #define _CURASURFLIVE 0x700ac /* g4x+ */ 2318 - #define _CURBCNTR 0x700c0 2319 - #define _CURBBASE 0x700c4 2320 - #define _CURBPOS 0x700c8 2321 - 2322 - #define _CURBCNTR_IVB 0x71080 2323 - #define _CURBBASE_IVB 0x71084 2324 - #define _CURBPOS_IVB 0x71088 2325 - 2326 - #define CURCNTR(pipe) _MMIO_CURSOR2(dev_priv, pipe, _CURACNTR) 2327 - #define CURBASE(pipe) _MMIO_CURSOR2(dev_priv, pipe, _CURABASE) 2328 - #define CURPOS(pipe) _MMIO_CURSOR2(dev_priv, pipe, _CURAPOS) 2329 - #define CURPOS_ERLY_TPT(pipe) _MMIO_CURSOR2(dev_priv, pipe, _CURAPOS_ERLY_TPT) 2330 - #define CURSIZE(pipe) _MMIO_CURSOR2(dev_priv, pipe, _CURASIZE) 2331 - #define CUR_FBC_CTL(pipe) _MMIO_CURSOR2(dev_priv, pipe, _CUR_FBC_CTL_A) 2332 - #define CUR_CHICKEN(pipe) _MMIO_CURSOR2(dev_priv, pipe, _CUR_CHICKEN_A) 2333 - #define CURSURFLIVE(pipe) _MMIO_CURSOR2(dev_priv, pipe, _CURASURFLIVE) 2334 2268 2335 2269 /* Display A control */ 2336 2270 #define _DSPAADDR_VLV 0x7017C /* vlv/chv */
+1
drivers/gpu/drm/i915/intel_gvt_mmio_table.c
··· 7 7 #include "display/intel_audio_regs.h" 8 8 #include "display/intel_backlight_regs.h" 9 9 #include "display/intel_color_regs.h" 10 + #include "display/intel_cursor_regs.h" 10 11 #include "display/intel_display_types.h" 11 12 #include "display/intel_dmc_regs.h" 12 13 #include "display/intel_dp_aux_regs.h"