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

drm/i915/display: Separate xe and i915 common dpt code into own file

Here created intel_dpt_common.c to hold intel_dpt_configure which is
needed for both xe and i915.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231116150225.204233-1-juhapekka.heikkila@gmail.com

authored by

Juha-Pekka Heikkila and committed by
Jouni Högander
1aba6713 07e823c0

+49 -28
+1
drivers/gpu/drm/i915/Makefile
··· 275 275 display/intel_dpll.o \ 276 276 display/intel_dpll_mgr.o \ 277 277 display/intel_dpt.o \ 278 + display/intel_dpt_common.o \ 278 279 display/intel_drrs.o \ 279 280 display/intel_dsb.o \ 280 281 display/intel_dsb_buffer.o \
+1
drivers/gpu/drm/i915/display/intel_display.c
··· 76 76 #include "intel_dpll.h" 77 77 #include "intel_dpll_mgr.h" 78 78 #include "intel_dpt.h" 79 + #include "intel_dpt_common.h" 79 80 #include "intel_drrs.h" 80 81 #include "intel_dsb.h" 81 82 #include "intel_dsi.h"
-26
drivers/gpu/drm/i915/display/intel_dpt.c
··· 9 9 #include "gt/gen8_ppgtt.h" 10 10 11 11 #include "i915_drv.h" 12 - #include "i915_reg.h" 13 - #include "intel_de.h" 14 12 #include "intel_display_types.h" 15 13 #include "intel_dpt.h" 16 14 #include "intel_fb.h" ··· 316 318 i915_vm_put(&dpt->vm); 317 319 } 318 320 319 - void intel_dpt_configure(struct intel_crtc *crtc) 320 - { 321 - struct drm_i915_private *i915 = to_i915(crtc->base.dev); 322 - 323 - if (DISPLAY_VER(i915) == 14) { 324 - enum pipe pipe = crtc->pipe; 325 - enum plane_id plane_id; 326 - 327 - for_each_plane_id_on_crtc(crtc, plane_id) { 328 - if (plane_id == PLANE_CURSOR) 329 - continue; 330 - 331 - intel_de_rmw(i915, PLANE_CHICKEN(pipe, plane_id), 332 - PLANE_CHICKEN_DISABLE_DPT, 333 - i915->display.params.enable_dpt ? 0 : 334 - PLANE_CHICKEN_DISABLE_DPT); 335 - } 336 - } else if (DISPLAY_VER(i915) == 13) { 337 - intel_de_rmw(i915, CHICKEN_MISC_2, 338 - CHICKEN_MISC_DISABLE_DPT, 339 - i915->display.params.enable_dpt ? 0 : 340 - CHICKEN_MISC_DISABLE_DPT); 341 - } 342 - }
-2
drivers/gpu/drm/i915/display/intel_dpt.h
··· 10 10 11 11 struct i915_address_space; 12 12 struct i915_vma; 13 - struct intel_crtc; 14 13 struct intel_framebuffer; 15 14 16 15 void intel_dpt_destroy(struct i915_address_space *vm); ··· 19 20 void intel_dpt_resume(struct drm_i915_private *i915); 20 21 struct i915_address_space * 21 22 intel_dpt_create(struct intel_framebuffer *fb); 22 - void intel_dpt_configure(struct intel_crtc *crtc); 23 23 24 24 #endif /* __INTEL_DPT_H__ */
+34
drivers/gpu/drm/i915/display/intel_dpt_common.c
··· 1 + // SPDX-License-Identifier: MIT 2 + /* 3 + * Copyright © 2023 Intel Corporation 4 + */ 5 + 6 + #include "i915_reg.h" 7 + #include "intel_de.h" 8 + #include "intel_display_types.h" 9 + #include "intel_dpt_common.h" 10 + 11 + void intel_dpt_configure(struct intel_crtc *crtc) 12 + { 13 + struct drm_i915_private *i915 = to_i915(crtc->base.dev); 14 + 15 + if (DISPLAY_VER(i915) == 14) { 16 + enum pipe pipe = crtc->pipe; 17 + enum plane_id plane_id; 18 + 19 + for_each_plane_id_on_crtc(crtc, plane_id) { 20 + if (plane_id == PLANE_CURSOR) 21 + continue; 22 + 23 + intel_de_rmw(i915, PLANE_CHICKEN(pipe, plane_id), 24 + PLANE_CHICKEN_DISABLE_DPT, 25 + i915->display.params.enable_dpt ? 0 : 26 + PLANE_CHICKEN_DISABLE_DPT); 27 + } 28 + } else if (DISPLAY_VER(i915) == 13) { 29 + intel_de_rmw(i915, CHICKEN_MISC_2, 30 + CHICKEN_MISC_DISABLE_DPT, 31 + i915->display.params.enable_dpt ? 0 : 32 + CHICKEN_MISC_DISABLE_DPT); 33 + } 34 + }
+13
drivers/gpu/drm/i915/display/intel_dpt_common.h
··· 1 + /* SPDX-License-Identifier: MIT */ 2 + /* 3 + * Copyright © 2023 Intel Corporation 4 + */ 5 + 6 + #ifndef __INTEL_DPT_COMMON_H__ 7 + #define __INTEL_DPT_COMMON_H__ 8 + 9 + struct intel_crtc; 10 + 11 + void intel_dpt_configure(struct intel_crtc *crtc); 12 + 13 + #endif /* __INTEL_DPT_COMMON_H__ */