xref: /linux/drivers/gpu/drm/i915/display/intel_dpt_common.c (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
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 #include "skl_universal_plane_regs.h"
11 
12 void intel_dpt_configure(struct intel_crtc *crtc)
13 {
14 	struct drm_i915_private *i915 = to_i915(crtc->base.dev);
15 
16 	if (DISPLAY_VER(i915) == 14) {
17 		enum pipe pipe = crtc->pipe;
18 		enum plane_id plane_id;
19 
20 		for_each_plane_id_on_crtc(crtc, plane_id) {
21 			if (plane_id == PLANE_CURSOR)
22 				continue;
23 
24 			intel_de_rmw(i915, PLANE_CHICKEN(pipe, plane_id),
25 				     PLANE_CHICKEN_DISABLE_DPT,
26 				     i915->display.params.enable_dpt ? 0 :
27 				     PLANE_CHICKEN_DISABLE_DPT);
28 		}
29 	} else if (DISPLAY_VER(i915) == 13) {
30 		intel_de_rmw(i915, CHICKEN_MISC_2,
31 			     CHICKEN_MISC_DISABLE_DPT,
32 			     i915->display.params.enable_dpt ? 0 :
33 			     CHICKEN_MISC_DISABLE_DPT);
34 	}
35 }
36