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

Merge tag 'topic/drm-intel-plane-color-pipeline-2025-12-04' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-next

drm/i915 topic pull request for v6.19:

Features and functionality:
- Add plane color management support (Uma, Chaitanya)

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Jani Nikula <jani.nikula@intel.com>
Link: https://patch.msgid.link/e7129c6afd6208719d2f5124da86e810505e7a7b@intel.com

+751 -2
+2
drivers/gpu/drm/i915/Makefile
··· 239 239 display/intel_cdclk.o \ 240 240 display/intel_cmtg.o \ 241 241 display/intel_color.o \ 242 + display/intel_colorop.o \ 243 + display/intel_color_pipeline.o \ 242 244 display/intel_combo_phy.o \ 243 245 display/intel_connector.o \ 244 246 display/intel_crtc.o \
+335
drivers/gpu/drm/i915/display/intel_color.c
··· 32 32 #include "intel_display_utils.h" 33 33 #include "intel_dsb.h" 34 34 #include "intel_vrr.h" 35 + #include "skl_universal_plane.h" 36 + #include "skl_universal_plane_regs.h" 35 37 36 38 struct intel_color_funcs { 37 39 int (*color_check)(struct intel_atomic_state *state, ··· 89 87 * Read config other than LUTs and CSCs, before them. Optional. 90 88 */ 91 89 void (*get_config)(struct intel_crtc_state *crtc_state); 90 + 91 + /* Plane CSC*/ 92 + void (*load_plane_csc_matrix)(struct intel_dsb *dsb, 93 + const struct intel_plane_state *plane_state); 94 + 95 + /* Plane Pre/Post CSC */ 96 + void (*load_plane_luts)(struct intel_dsb *dsb, 97 + const struct intel_plane_state *plane_state); 92 98 }; 93 99 94 100 #define CTM_COEFF_SIGN (1ULL << 63) ··· 618 608 619 609 if (CTM_COEFF_NEGATIVE(coeff)) 620 610 c = -c; 611 + 612 + int_bits = max(int_bits, 1); 621 613 622 614 c = clamp(c, -(s64)BIT(int_bits + frac_bits - 1), 623 615 (s64)(BIT(int_bits + frac_bits - 1) - 1)); ··· 3848 3836 } 3849 3837 } 3850 3838 3839 + static void 3840 + xelpd_load_plane_csc_matrix(struct intel_dsb *dsb, 3841 + const struct intel_plane_state *plane_state) 3842 + { 3843 + struct intel_display *display = to_intel_display(plane_state); 3844 + const struct drm_plane_state *state = &plane_state->uapi; 3845 + enum pipe pipe = to_intel_plane(state->plane)->pipe; 3846 + enum plane_id plane = to_intel_plane(state->plane)->id; 3847 + const struct drm_property_blob *blob = plane_state->hw.ctm; 3848 + struct drm_color_ctm_3x4 *ctm; 3849 + const u64 *input; 3850 + u16 coeffs[9] = {}; 3851 + int i, j; 3852 + 3853 + if (!icl_is_hdr_plane(display, plane) || !blob) 3854 + return; 3855 + 3856 + ctm = blob->data; 3857 + input = ctm->matrix; 3858 + 3859 + /* 3860 + * Convert fixed point S31.32 input to format supported by the 3861 + * hardware. 3862 + */ 3863 + for (i = 0, j = 0; i < ARRAY_SIZE(coeffs); i++) { 3864 + u64 abs_coeff = ((1ULL << 63) - 1) & input[j]; 3865 + 3866 + /* 3867 + * Clamp input value to min/max supported by 3868 + * hardware. 3869 + */ 3870 + abs_coeff = clamp_val(abs_coeff, 0, CTM_COEFF_4_0 - 1); 3871 + 3872 + /* sign bit */ 3873 + if (CTM_COEFF_NEGATIVE(input[j])) 3874 + coeffs[i] |= 1 << 15; 3875 + 3876 + if (abs_coeff < CTM_COEFF_0_125) 3877 + coeffs[i] |= (3 << 12) | 3878 + ILK_CSC_COEFF_FP(abs_coeff, 12); 3879 + else if (abs_coeff < CTM_COEFF_0_25) 3880 + coeffs[i] |= (2 << 12) | 3881 + ILK_CSC_COEFF_FP(abs_coeff, 11); 3882 + else if (abs_coeff < CTM_COEFF_0_5) 3883 + coeffs[i] |= (1 << 12) | 3884 + ILK_CSC_COEFF_FP(abs_coeff, 10); 3885 + else if (abs_coeff < CTM_COEFF_1_0) 3886 + coeffs[i] |= ILK_CSC_COEFF_FP(abs_coeff, 9); 3887 + else if (abs_coeff < CTM_COEFF_2_0) 3888 + coeffs[i] |= (7 << 12) | 3889 + ILK_CSC_COEFF_FP(abs_coeff, 8); 3890 + else 3891 + coeffs[i] |= (6 << 12) | 3892 + ILK_CSC_COEFF_FP(abs_coeff, 7); 3893 + 3894 + /* Skip postoffs */ 3895 + if (!((j + 2) % 4)) 3896 + j += 2; 3897 + else 3898 + j++; 3899 + } 3900 + 3901 + intel_de_write_dsb(display, dsb, PLANE_CSC_COEFF(pipe, plane, 0), 3902 + coeffs[0] << 16 | coeffs[1]); 3903 + intel_de_write_dsb(display, dsb, PLANE_CSC_COEFF(pipe, plane, 1), 3904 + coeffs[2] << 16); 3905 + 3906 + intel_de_write_dsb(display, dsb, PLANE_CSC_COEFF(pipe, plane, 2), 3907 + coeffs[3] << 16 | coeffs[4]); 3908 + intel_de_write_dsb(display, dsb, PLANE_CSC_COEFF(pipe, plane, 3), 3909 + coeffs[5] << 16); 3910 + 3911 + intel_de_write_dsb(display, dsb, PLANE_CSC_COEFF(pipe, plane, 4), 3912 + coeffs[6] << 16 | coeffs[7]); 3913 + intel_de_write_dsb(display, dsb, PLANE_CSC_COEFF(pipe, plane, 5), 3914 + coeffs[8] << 16); 3915 + 3916 + intel_de_write_dsb(display, dsb, PLANE_CSC_PREOFF(pipe, plane, 0), 0); 3917 + intel_de_write_dsb(display, dsb, PLANE_CSC_PREOFF(pipe, plane, 1), 0); 3918 + intel_de_write_dsb(display, dsb, PLANE_CSC_PREOFF(pipe, plane, 2), 0); 3919 + 3920 + /* 3921 + * Conversion from S31.32 to S0.12. BIT[12] is the signed bit 3922 + */ 3923 + intel_de_write_dsb(display, dsb, 3924 + PLANE_CSC_POSTOFF(pipe, plane, 0), 3925 + ctm_to_twos_complement(input[3], 0, 12)); 3926 + intel_de_write_dsb(display, dsb, 3927 + PLANE_CSC_POSTOFF(pipe, plane, 1), 3928 + ctm_to_twos_complement(input[7], 0, 12)); 3929 + intel_de_write_dsb(display, dsb, 3930 + PLANE_CSC_POSTOFF(pipe, plane, 2), 3931 + ctm_to_twos_complement(input[11], 0, 12)); 3932 + } 3933 + 3934 + static void 3935 + xelpd_program_plane_pre_csc_lut(struct intel_dsb *dsb, 3936 + const struct intel_plane_state *plane_state) 3937 + { 3938 + struct intel_display *display = to_intel_display(plane_state); 3939 + const struct drm_plane_state *state = &plane_state->uapi; 3940 + enum pipe pipe = to_intel_plane(state->plane)->pipe; 3941 + enum plane_id plane = to_intel_plane(state->plane)->id; 3942 + const struct drm_color_lut32 *pre_csc_lut = plane_state->hw.degamma_lut->data; 3943 + u32 i, lut_size; 3944 + 3945 + if (icl_is_hdr_plane(display, plane)) { 3946 + lut_size = 128; 3947 + 3948 + intel_de_write_dsb(display, dsb, 3949 + PLANE_PRE_CSC_GAMC_INDEX_ENH(pipe, plane, 0), 3950 + PLANE_PAL_PREC_AUTO_INCREMENT); 3951 + 3952 + if (pre_csc_lut) { 3953 + for (i = 0; i < lut_size; i++) { 3954 + u32 lut_val = drm_color_lut32_extract(pre_csc_lut[i].green, 24); 3955 + 3956 + intel_de_write_dsb(display, dsb, 3957 + PLANE_PRE_CSC_GAMC_DATA_ENH(pipe, plane, 0), 3958 + lut_val); 3959 + } 3960 + 3961 + /* Program the max register to clamp values > 1.0. */ 3962 + /* TODO: Restrict to 0x7ffffff */ 3963 + do { 3964 + intel_de_write_dsb(display, dsb, 3965 + PLANE_PRE_CSC_GAMC_DATA_ENH(pipe, plane, 0), 3966 + (1 << 24)); 3967 + } while (i++ > 130); 3968 + } else { 3969 + for (i = 0; i < lut_size; i++) { 3970 + u32 v = (i * ((1 << 24) - 1)) / (lut_size - 1); 3971 + 3972 + intel_de_write_dsb(display, dsb, 3973 + PLANE_PRE_CSC_GAMC_DATA_ENH(pipe, plane, 0), v); 3974 + } 3975 + 3976 + do { 3977 + intel_de_write_dsb(display, dsb, 3978 + PLANE_PRE_CSC_GAMC_DATA_ENH(pipe, plane, 0), 3979 + 1 << 24); 3980 + } while (i++ < 130); 3981 + } 3982 + 3983 + intel_de_write_dsb(display, dsb, PLANE_PRE_CSC_GAMC_INDEX_ENH(pipe, plane, 0), 0); 3984 + } 3985 + } 3986 + 3987 + static void 3988 + xelpd_program_plane_post_csc_lut(struct intel_dsb *dsb, 3989 + const struct intel_plane_state *plane_state) 3990 + { 3991 + struct intel_display *display = to_intel_display(plane_state); 3992 + const struct drm_plane_state *state = &plane_state->uapi; 3993 + enum pipe pipe = to_intel_plane(state->plane)->pipe; 3994 + enum plane_id plane = to_intel_plane(state->plane)->id; 3995 + const struct drm_color_lut32 *post_csc_lut = plane_state->hw.gamma_lut->data; 3996 + u32 i, lut_size, lut_val; 3997 + 3998 + if (icl_is_hdr_plane(display, plane)) { 3999 + intel_de_write_dsb(display, dsb, PLANE_POST_CSC_GAMC_INDEX_ENH(pipe, plane, 0), 4000 + PLANE_PAL_PREC_AUTO_INCREMENT); 4001 + /* TODO: Add macro */ 4002 + intel_de_write_dsb(display, dsb, PLANE_POST_CSC_GAMC_SEG0_INDEX_ENH(pipe, plane, 0), 4003 + PLANE_PAL_PREC_AUTO_INCREMENT); 4004 + if (post_csc_lut) { 4005 + lut_size = 32; 4006 + for (i = 0; i < lut_size; i++) { 4007 + lut_val = drm_color_lut32_extract(post_csc_lut[i].green, 24); 4008 + 4009 + intel_de_write_dsb(display, dsb, 4010 + PLANE_POST_CSC_GAMC_DATA_ENH(pipe, plane, 0), 4011 + lut_val); 4012 + } 4013 + 4014 + /* Segment 2 */ 4015 + do { 4016 + intel_de_write_dsb(display, dsb, 4017 + PLANE_POST_CSC_GAMC_DATA_ENH(pipe, plane, 0), 4018 + (1 << 24)); 4019 + } while (i++ < 34); 4020 + } else { 4021 + /*TODO: Add for segment 0 */ 4022 + lut_size = 32; 4023 + for (i = 0; i < lut_size; i++) { 4024 + u32 v = (i * ((1 << 24) - 1)) / (lut_size - 1); 4025 + 4026 + intel_de_write_dsb(display, dsb, 4027 + PLANE_POST_CSC_GAMC_DATA_ENH(pipe, plane, 0), v); 4028 + } 4029 + 4030 + do { 4031 + intel_de_write_dsb(display, dsb, 4032 + PLANE_POST_CSC_GAMC_DATA_ENH(pipe, plane, 0), 4033 + 1 << 24); 4034 + } while (i++ < 34); 4035 + } 4036 + 4037 + intel_de_write_dsb(display, dsb, PLANE_POST_CSC_GAMC_INDEX_ENH(pipe, plane, 0), 0); 4038 + intel_de_write_dsb(display, dsb, 4039 + PLANE_POST_CSC_GAMC_SEG0_INDEX_ENH(pipe, plane, 0), 0); 4040 + } 4041 + } 4042 + 4043 + static void 4044 + xelpd_plane_load_luts(struct intel_dsb *dsb, const struct intel_plane_state *plane_state) 4045 + { 4046 + if (plane_state->hw.degamma_lut) 4047 + xelpd_program_plane_pre_csc_lut(dsb, plane_state); 4048 + 4049 + if (plane_state->hw.gamma_lut) 4050 + xelpd_program_plane_post_csc_lut(dsb, plane_state); 4051 + } 4052 + 4053 + static u32 glk_3dlut_10(const struct drm_color_lut32 *color) 4054 + { 4055 + return REG_FIELD_PREP(LUT_3D_DATA_RED_MASK, drm_color_lut32_extract(color->red, 10)) | 4056 + REG_FIELD_PREP(LUT_3D_DATA_GREEN_MASK, drm_color_lut32_extract(color->green, 10)) | 4057 + REG_FIELD_PREP(LUT_3D_DATA_BLUE_MASK, drm_color_lut32_extract(color->blue, 10)); 4058 + } 4059 + 4060 + static void glk_load_lut_3d(struct intel_dsb *dsb, 4061 + struct intel_crtc *crtc, 4062 + const struct drm_property_blob *blob) 4063 + { 4064 + struct intel_display *display = to_intel_display(crtc->base.dev); 4065 + const struct drm_color_lut32 *lut = blob->data; 4066 + int i, lut_size = drm_color_lut32_size(blob); 4067 + enum pipe pipe = crtc->pipe; 4068 + 4069 + if (!dsb && intel_de_read(display, LUT_3D_CTL(pipe)) & LUT_3D_READY) { 4070 + drm_err(display->drm, "[CRTC:%d:%s] 3D LUT not ready, not loading LUTs\n", 4071 + crtc->base.base.id, crtc->base.name); 4072 + return; 4073 + } 4074 + 4075 + intel_de_write_dsb(display, dsb, LUT_3D_INDEX(pipe), LUT_3D_AUTO_INCREMENT); 4076 + for (i = 0; i < lut_size; i++) 4077 + intel_de_write_dsb(display, dsb, LUT_3D_DATA(pipe), glk_3dlut_10(&lut[i])); 4078 + intel_de_write_dsb(display, dsb, LUT_3D_INDEX(pipe), 0); 4079 + } 4080 + 4081 + static void glk_lut_3d_commit(struct intel_dsb *dsb, struct intel_crtc *crtc, bool enable) 4082 + { 4083 + struct intel_display *display = to_intel_display(crtc); 4084 + enum pipe pipe = crtc->pipe; 4085 + u32 val = 0; 4086 + 4087 + if (!dsb && intel_de_read(display, LUT_3D_CTL(pipe)) & LUT_3D_READY) { 4088 + drm_err(display->drm, "[CRTC:%d:%s] 3D LUT not ready, not committing change\n", 4089 + crtc->base.base.id, crtc->base.name); 4090 + return; 4091 + } 4092 + 4093 + if (enable) 4094 + val = LUT_3D_ENABLE | LUT_3D_READY | LUT_3D_BIND_PLANE_1; 4095 + 4096 + intel_de_write_dsb(display, dsb, LUT_3D_CTL(pipe), val); 4097 + } 4098 + 3851 4099 static const struct intel_color_funcs chv_color_funcs = { 3852 4100 .color_check = chv_color_check, 3853 4101 .color_commit_arm = i9xx_color_commit_arm, ··· 4155 3883 .lut_equal = icl_lut_equal, 4156 3884 .read_csc = icl_read_csc, 4157 3885 .get_config = skl_get_config, 3886 + .load_plane_csc_matrix = xelpd_load_plane_csc_matrix, 3887 + .load_plane_luts = xelpd_plane_load_luts, 4158 3888 }; 4159 3889 4160 3890 static const struct intel_color_funcs icl_color_funcs = { ··· 4236 3962 .read_csc = ilk_read_csc, 4237 3963 .get_config = ilk_get_config, 4238 3964 }; 3965 + 3966 + void intel_color_plane_commit_arm(struct intel_dsb *dsb, 3967 + const struct intel_plane_state *plane_state) 3968 + { 3969 + struct intel_display *display = to_intel_display(plane_state); 3970 + struct intel_crtc *crtc = to_intel_crtc(plane_state->uapi.crtc); 3971 + 3972 + if (crtc && intel_color_crtc_has_3dlut(display, crtc->pipe)) 3973 + glk_lut_3d_commit(dsb, crtc, !!plane_state->hw.lut_3d); 3974 + } 3975 + 3976 + static void 3977 + intel_color_load_plane_csc_matrix(struct intel_dsb *dsb, 3978 + const struct intel_plane_state *plane_state) 3979 + { 3980 + struct intel_display *display = to_intel_display(plane_state); 3981 + 3982 + if (display->funcs.color->load_plane_csc_matrix) 3983 + display->funcs.color->load_plane_csc_matrix(dsb, plane_state); 3984 + } 3985 + 3986 + static void 3987 + intel_color_load_plane_luts(struct intel_dsb *dsb, 3988 + const struct intel_plane_state *plane_state) 3989 + { 3990 + struct intel_display *display = to_intel_display(plane_state); 3991 + 3992 + if (display->funcs.color->load_plane_luts) 3993 + display->funcs.color->load_plane_luts(dsb, plane_state); 3994 + } 3995 + 3996 + bool 3997 + intel_color_crtc_has_3dlut(struct intel_display *display, enum pipe pipe) 3998 + { 3999 + if (DISPLAY_VER(display) >= 12) 4000 + return pipe == PIPE_A || pipe == PIPE_B; 4001 + else 4002 + return false; 4003 + } 4004 + 4005 + static void 4006 + intel_color_load_3dlut(struct intel_dsb *dsb, 4007 + const struct intel_plane_state *plane_state) 4008 + { 4009 + struct intel_display *display = to_intel_display(plane_state); 4010 + struct intel_crtc *crtc = to_intel_crtc(plane_state->uapi.crtc); 4011 + 4012 + if (crtc && intel_color_crtc_has_3dlut(display, crtc->pipe)) 4013 + glk_load_lut_3d(dsb, crtc, plane_state->hw.lut_3d); 4014 + } 4015 + 4016 + void intel_color_plane_program_pipeline(struct intel_dsb *dsb, 4017 + const struct intel_plane_state *plane_state) 4018 + { 4019 + if (plane_state->hw.ctm) 4020 + intel_color_load_plane_csc_matrix(dsb, plane_state); 4021 + if (plane_state->hw.degamma_lut || plane_state->hw.gamma_lut) 4022 + intel_color_load_plane_luts(dsb, plane_state); 4023 + if (plane_state->hw.lut_3d) 4024 + intel_color_load_3dlut(dsb, plane_state); 4025 + } 4239 4026 4240 4027 void intel_color_crtc_init(struct intel_crtc *crtc) 4241 4028 {
+7 -1
drivers/gpu/drm/i915/display/intel_color.h
··· 13 13 struct intel_crtc; 14 14 struct intel_display; 15 15 struct intel_dsb; 16 + struct intel_plane_state; 16 17 struct drm_property_blob; 18 + enum pipe; 17 19 18 20 void intel_color_init_hooks(struct intel_display *display); 19 21 int intel_color_init(struct intel_display *display); ··· 42 40 const struct drm_property_blob *blob2, 43 41 bool is_pre_csc_lut); 44 42 void intel_color_assert_luts(const struct intel_crtc_state *crtc_state); 45 - 43 + void intel_color_plane_program_pipeline(struct intel_dsb *dsb, 44 + const struct intel_plane_state *plane_state); 45 + void intel_color_plane_commit_arm(struct intel_dsb *dsb, 46 + const struct intel_plane_state *plane_state); 47 + bool intel_color_crtc_has_3dlut(struct intel_display *display, enum pipe pipe); 46 48 #endif /* __INTEL_COLOR_H__ */
+99
drivers/gpu/drm/i915/display/intel_color_pipeline.c
··· 1 + // SPDX-License-Identifier: MIT 2 + /* 3 + * Copyright © 2025 Intel Corporation 4 + */ 5 + #include "intel_color.h" 6 + #include "intel_colorop.h" 7 + #include "intel_color_pipeline.h" 8 + #include "intel_de.h" 9 + #include "intel_display_types.h" 10 + #include "skl_universal_plane.h" 11 + 12 + #define MAX_COLOR_PIPELINES 1 13 + #define PLANE_DEGAMMA_SIZE 128 14 + #define PLANE_GAMMA_SIZE 32 15 + 16 + static 17 + int _intel_color_pipeline_plane_init(struct drm_plane *plane, struct drm_prop_enum_list *list, 18 + enum pipe pipe) 19 + { 20 + struct drm_device *dev = plane->dev; 21 + struct intel_display *display = to_intel_display(dev); 22 + struct drm_colorop *prev_op; 23 + struct intel_colorop *colorop; 24 + int ret; 25 + 26 + colorop = intel_colorop_create(INTEL_PLANE_CB_PRE_CSC_LUT); 27 + 28 + ret = drm_plane_colorop_curve_1d_lut_init(dev, &colorop->base, plane, 29 + PLANE_DEGAMMA_SIZE, 30 + DRM_COLOROP_LUT1D_INTERPOLATION_LINEAR, 31 + DRM_COLOROP_FLAG_ALLOW_BYPASS); 32 + 33 + if (ret) 34 + return ret; 35 + 36 + list->type = colorop->base.base.id; 37 + list->name = kasprintf(GFP_KERNEL, "Color Pipeline %d", colorop->base.base.id); 38 + 39 + /* TODO: handle failures and clean up */ 40 + prev_op = &colorop->base; 41 + 42 + if (DISPLAY_VER(display) >= 35 && 43 + intel_color_crtc_has_3dlut(display, pipe) && 44 + plane->type == DRM_PLANE_TYPE_PRIMARY) { 45 + colorop = intel_colorop_create(INTEL_PLANE_CB_3DLUT); 46 + 47 + ret = drm_plane_colorop_3dlut_init(dev, &colorop->base, plane, 17, 48 + DRM_COLOROP_LUT3D_INTERPOLATION_TETRAHEDRAL, 49 + true); 50 + if (ret) 51 + return ret; 52 + 53 + drm_colorop_set_next_property(prev_op, &colorop->base); 54 + 55 + prev_op = &colorop->base; 56 + } 57 + 58 + colorop = intel_colorop_create(INTEL_PLANE_CB_CSC); 59 + ret = drm_plane_colorop_ctm_3x4_init(dev, &colorop->base, plane, 60 + DRM_COLOROP_FLAG_ALLOW_BYPASS); 61 + if (ret) 62 + return ret; 63 + 64 + drm_colorop_set_next_property(prev_op, &colorop->base); 65 + prev_op = &colorop->base; 66 + 67 + colorop = intel_colorop_create(INTEL_PLANE_CB_POST_CSC_LUT); 68 + ret = drm_plane_colorop_curve_1d_lut_init(dev, &colorop->base, plane, 69 + PLANE_GAMMA_SIZE, 70 + DRM_COLOROP_LUT1D_INTERPOLATION_LINEAR, 71 + DRM_COLOROP_FLAG_ALLOW_BYPASS); 72 + if (ret) 73 + return ret; 74 + 75 + drm_colorop_set_next_property(prev_op, &colorop->base); 76 + 77 + return 0; 78 + } 79 + 80 + int intel_color_pipeline_plane_init(struct drm_plane *plane, enum pipe pipe) 81 + { 82 + struct drm_device *dev = plane->dev; 83 + struct intel_display *display = to_intel_display(dev); 84 + struct drm_prop_enum_list pipelines[MAX_COLOR_PIPELINES]; 85 + int len = 0; 86 + int ret; 87 + 88 + /* Currently expose pipeline only for HDR planes */ 89 + if (!icl_is_hdr_plane(display, to_intel_plane(plane)->id)) 90 + return 0; 91 + 92 + /* Add pipeline consisting of transfer functions */ 93 + ret = _intel_color_pipeline_plane_init(plane, &pipelines[len], pipe); 94 + if (ret) 95 + return ret; 96 + len++; 97 + 98 + return drm_plane_create_color_pipeline_property(plane, pipelines, len); 99 + }
+14
drivers/gpu/drm/i915/display/intel_color_pipeline.h
··· 1 + /* SPDX-License-Identifier: MIT */ 2 + /* 3 + * Copyright © 2025 Intel Corporation 4 + */ 5 + 6 + #ifndef __INTEL_COLOR_PIPELINE_H__ 7 + #define __INTEL_COLOR_PIPELINE_H__ 8 + 9 + struct drm_plane; 10 + enum pipe; 11 + 12 + int intel_color_pipeline_plane_init(struct drm_plane *plane, enum pipe pipe); 13 + 14 + #endif /* __INTEL_COLOR_PIPELINE_H__ */
+29
drivers/gpu/drm/i915/display/intel_color_regs.h
··· 316 316 #define SKL_BOTTOM_COLOR_CSC_ENABLE REG_BIT(30) 317 317 #define SKL_BOTTOM_COLOR(pipe) _MMIO_PIPE(pipe, _SKL_BOTTOM_COLOR_A, _SKL_BOTTOM_COLOR_B) 318 318 319 + /* 3D LUT */ 320 + #define _LUT_3D_CTL_A 0x490A4 321 + #define _LUT_3D_CTL_B 0x491A4 322 + #define LUT_3D_CTL(pipe) _MMIO_PIPE(pipe, _LUT_3D_CTL_A, _LUT_3D_CTL_B) 323 + #define LUT_3D_ENABLE REG_BIT(31) 324 + #define LUT_3D_READY REG_BIT(30) 325 + #define LUT_3D_BINDING_MASK REG_GENMASK(23, 22) 326 + #define LUT_3D_BIND_PIPE REG_FIELD_PREP(LUT_3D_BINDING_MASK, 0) 327 + #define LUT_3D_BIND_PLANE_1 REG_FIELD_PREP(LUT_3D_BINDING_MASK, 1) 328 + #define LUT_3D_BIND_PLANE_2 REG_FIELD_PREP(LUT_3D_BINDING_MASK, 2) 329 + #define LUT_3D_BIND_PLANE_3 REG_FIELD_PREP(LUT_3D_BINDING_MASK, 3) 330 + 331 + #define _LUT_3D_INDEX_A 0x490A8 332 + #define _LUT_3D_INDEX_B 0x491A8 333 + #define LUT_3D_INDEX(pipe) _MMIO_PIPE(pipe, _LUT_3D_INDEX_A, _LUT_3D_INDEX_B) 334 + #define LUT_3D_AUTO_INCREMENT REG_BIT(13) 335 + #define LUT_3D_INDEX_VALUE_MASK REG_GENMASK(12, 0) 336 + #define LUT_3D_INDEX_VALUE(x) REG_FIELD_PREP(LUT_3D_INDEX_VALUE_MASK, (x)) 337 + 338 + #define _LUT_3D_DATA_A 0x490AC 339 + #define _LUT_3D_DATA_B 0x491AC 340 + #define LUT_3D_DATA(pipe) _MMIO_PIPE(pipe, _LUT_3D_DATA_A, _LUT_3D_DATA_B) 341 + #define LUT_3D_DATA_RED_MASK REG_GENMASK(29, 20) 342 + #define LUT_3D_DATA_GREEN_MASK REG_GENMASK(19, 10) 343 + #define LUT_3D_DATA_BLUE_MASK REG_GENMASK(9, 0) 344 + #define LUT_3D_DATA_RED(x) REG_FIELD_PREP(LUT_3D_DATA_RED_MASK, (x)) 345 + #define LUT_3D_DATA_GREEN(x) REG_FIELD_PREP(LUT_3D_DATA_GREEN_MASK, (x)) 346 + #define LUT_3D_DATA_BLUE(x) REG_FIELD_PREP(LUT_3D_DATA_BLUE_MASK, (x)) 347 + 319 348 #endif /* __INTEL_COLOR_REGS_H__ */
+35
drivers/gpu/drm/i915/display/intel_colorop.c
··· 1 + // SPDX-License-Identifier: MIT 2 + /* 3 + * Copyright © 2025 Intel Corporation 4 + */ 5 + #include "intel_colorop.h" 6 + 7 + struct intel_colorop *to_intel_colorop(struct drm_colorop *colorop) 8 + { 9 + return container_of(colorop, struct intel_colorop, base); 10 + } 11 + 12 + struct intel_colorop *intel_colorop_alloc(void) 13 + { 14 + struct intel_colorop *colorop; 15 + 16 + colorop = kzalloc(sizeof(*colorop), GFP_KERNEL); 17 + if (!colorop) 18 + return ERR_PTR(-ENOMEM); 19 + 20 + return colorop; 21 + } 22 + 23 + struct intel_colorop *intel_colorop_create(enum intel_color_block id) 24 + { 25 + struct intel_colorop *colorop; 26 + 27 + colorop = intel_colorop_alloc(); 28 + 29 + if (IS_ERR(colorop)) 30 + return colorop; 31 + 32 + colorop->id = id; 33 + 34 + return colorop; 35 + }
+15
drivers/gpu/drm/i915/display/intel_colorop.h
··· 1 + /* SPDX-License-Identifier: MIT */ 2 + /* 3 + * Copyright © 2025 Intel Corporation 4 + */ 5 + 6 + #ifndef __INTEL_COLOROP_H__ 7 + #define __INTEL_COLOROP_H__ 8 + 9 + #include "intel_display_types.h" 10 + 11 + struct intel_colorop *to_intel_colorop(struct drm_colorop *colorop); 12 + struct intel_colorop *intel_colorop_alloc(void); 13 + struct intel_colorop *intel_colorop_create(enum intel_color_block id); 14 + 15 + #endif /* __INTEL_COLOROP_H__ */
+4 -1
drivers/gpu/drm/i915/display/intel_display.c
··· 7296 7296 struct intel_display *display = to_intel_display(state); 7297 7297 struct intel_crtc_state *new_crtc_state = 7298 7298 intel_atomic_get_new_crtc_state(state, crtc); 7299 + unsigned int size = new_crtc_state->plane_color_changed ? 8192 : 1024; 7299 7300 7300 7301 if (!new_crtc_state->use_flipq && 7301 7302 !new_crtc_state->use_dsb && ··· 7307 7306 * Rough estimate: 7308 7307 * ~64 registers per each plane * 8 planes = 512 7309 7308 * Double that for pipe stuff and other overhead. 7309 + * ~4913 registers for 3DLUT 7310 + * ~200 color registers * 3 HDR planes 7310 7311 */ 7311 7312 new_crtc_state->dsb_commit = intel_dsb_prepare(state, crtc, INTEL_DSB_0, 7312 7313 new_crtc_state->use_dsb || 7313 - new_crtc_state->use_flipq ? 1024 : 16); 7314 + new_crtc_state->use_flipq ? size : 16); 7314 7315 if (!new_crtc_state->dsb_commit) { 7315 7316 new_crtc_state->use_flipq = false; 7316 7317 new_crtc_state->use_dsb = false;
+9
drivers/gpu/drm/i915/display/intel_display_limits.h
··· 138 138 HPD_NUM_PINS 139 139 }; 140 140 141 + enum intel_color_block { 142 + INTEL_PLANE_CB_PRE_CSC_LUT, 143 + INTEL_PLANE_CB_CSC, 144 + INTEL_PLANE_CB_POST_CSC_LUT, 145 + INTEL_PLANE_CB_3DLUT, 146 + 147 + INTEL_CB_MAX 148 + }; 149 + 141 150 #endif /* __INTEL_DISPLAY_LIMITS_H__ */
+9
drivers/gpu/drm/i915/display/intel_display_types.h
··· 646 646 enum drm_color_encoding color_encoding; 647 647 enum drm_color_range color_range; 648 648 enum drm_scaling_filter scaling_filter; 649 + struct drm_property_blob *ctm, *degamma_lut, *gamma_lut, *lut_3d; 649 650 } hw; 650 651 651 652 struct i915_vma *ggtt_vma; ··· 1392 1391 u8 silence_period_sym_clocks; 1393 1392 u8 lfps_half_cycle_num_of_syms; 1394 1393 } alpm_state; 1394 + 1395 + /* to track changes in plane color blocks */ 1396 + bool plane_color_changed; 1395 1397 }; 1396 1398 1397 1399 enum intel_pipe_crc_source { ··· 1987 1983 enum pipe pipe; 1988 1984 struct intel_digital_port *primary; 1989 1985 struct intel_connector *connector; 1986 + }; 1987 + 1988 + struct intel_colorop { 1989 + struct drm_colorop base; 1990 + enum intel_color_block id; 1990 1991 }; 1991 1992 1992 1993 static inline struct intel_encoder *
+55
drivers/gpu/drm/i915/display/intel_plane.c
··· 49 49 #include "i9xx_plane_regs.h" 50 50 #include "intel_cdclk.h" 51 51 #include "intel_cursor.h" 52 + #include "intel_colorop.h" 52 53 #include "intel_display_rps.h" 53 54 #include "intel_display_trace.h" 54 55 #include "intel_display_types.h" ··· 337 336 *damage = drm_plane_state_src(&new_uapi_plane_state->uapi); 338 337 } 339 338 339 + static bool 340 + intel_plane_colorop_replace_blob(struct intel_plane_state *plane_state, 341 + struct intel_colorop *intel_colorop, 342 + struct drm_property_blob *blob) 343 + { 344 + if (intel_colorop->id == INTEL_PLANE_CB_CSC) 345 + return drm_property_replace_blob(&plane_state->hw.ctm, blob); 346 + else if (intel_colorop->id == INTEL_PLANE_CB_PRE_CSC_LUT) 347 + return drm_property_replace_blob(&plane_state->hw.degamma_lut, blob); 348 + else if (intel_colorop->id == INTEL_PLANE_CB_POST_CSC_LUT) 349 + return drm_property_replace_blob(&plane_state->hw.gamma_lut, blob); 350 + else if (intel_colorop->id == INTEL_PLANE_CB_3DLUT) 351 + return drm_property_replace_blob(&plane_state->hw.lut_3d, blob); 352 + 353 + return false; 354 + } 355 + 356 + static void 357 + intel_plane_color_copy_uapi_to_hw_state(struct intel_plane_state *plane_state, 358 + const struct intel_plane_state *from_plane_state, 359 + struct intel_crtc *crtc) 360 + { 361 + struct drm_colorop *iter_colorop, *colorop; 362 + struct drm_colorop_state *new_colorop_state; 363 + struct drm_atomic_state *state = plane_state->uapi.state; 364 + struct intel_colorop *intel_colorop; 365 + struct drm_property_blob *blob; 366 + struct intel_atomic_state *intel_atomic_state = to_intel_atomic_state(state); 367 + struct intel_crtc_state *new_crtc_state = intel_atomic_state ? 368 + intel_atomic_get_new_crtc_state(intel_atomic_state, crtc) : NULL; 369 + bool changed = false; 370 + int i = 0; 371 + 372 + iter_colorop = plane_state->uapi.color_pipeline; 373 + 374 + while (iter_colorop) { 375 + for_each_new_colorop_in_state(state, colorop, new_colorop_state, i) { 376 + if (new_colorop_state->colorop == iter_colorop) { 377 + blob = new_colorop_state->bypass ? NULL : new_colorop_state->data; 378 + intel_colorop = to_intel_colorop(colorop); 379 + changed |= intel_plane_colorop_replace_blob(plane_state, 380 + intel_colorop, 381 + blob); 382 + } 383 + } 384 + iter_colorop = iter_colorop->next; 385 + } 386 + 387 + if (new_crtc_state && changed) 388 + new_crtc_state->plane_color_changed = true; 389 + } 390 + 340 391 void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state, 341 392 const struct intel_plane_state *from_plane_state, 342 393 struct intel_crtc *crtc) ··· 417 364 418 365 plane_state->uapi.src = drm_plane_state_src(&from_plane_state->uapi); 419 366 plane_state->uapi.dst = drm_plane_state_dest(&from_plane_state->uapi); 367 + 368 + intel_plane_color_copy_uapi_to_hw_state(plane_state, from_plane_state, crtc); 420 369 } 421 370 422 371 void intel_plane_copy_hw_state(struct intel_plane_state *plane_state,
+21
drivers/gpu/drm/i915/display/skl_universal_plane.c
··· 11 11 12 12 #include "pxp/intel_pxp.h" 13 13 #include "intel_bo.h" 14 + #include "intel_color.h" 15 + #include "intel_color_pipeline.h" 14 16 #include "intel_de.h" 15 17 #include "intel_display_irq.h" 16 18 #include "intel_display_regs.h" ··· 1277 1275 if (plane_state->force_black) 1278 1276 plane_color_ctl |= PLANE_COLOR_PLANE_CSC_ENABLE; 1279 1277 1278 + if (plane_state->hw.degamma_lut) 1279 + plane_color_ctl |= PLANE_COLOR_PRE_CSC_GAMMA_ENABLE; 1280 + 1281 + if (plane_state->hw.ctm) 1282 + plane_color_ctl |= PLANE_COLOR_PLANE_CSC_ENABLE; 1283 + 1284 + if (plane_state->hw.gamma_lut) { 1285 + plane_color_ctl &= ~PLANE_COLOR_PLANE_GAMMA_DISABLE; 1286 + if (drm_color_lut32_size(plane_state->hw.gamma_lut) != 32) 1287 + plane_color_ctl |= PLANE_COLOR_POST_CSC_GAMMA_MULTSEG_ENABLE; 1288 + } 1289 + 1280 1290 return plane_color_ctl; 1281 1291 } 1282 1292 ··· 1570 1556 plane_color_ctl = plane_state->color_ctl | 1571 1557 glk_plane_color_ctl_crtc(crtc_state); 1572 1558 1559 + intel_color_plane_program_pipeline(dsb, plane_state); 1560 + 1573 1561 /* The scaler will handle the output position */ 1574 1562 if (plane_state->scaler_id >= 0) { 1575 1563 crtc_x = 0; ··· 1672 1656 skl_program_plane_scaler(dsb, plane, crtc_state, plane_state); 1673 1657 1674 1658 icl_plane_update_sel_fetch_arm(dsb, plane, crtc_state, plane_state); 1659 + 1660 + intel_color_plane_commit_arm(dsb, plane_state); 1675 1661 1676 1662 /* 1677 1663 * In order to have FBC for fp16 formats pixel normalizer block must be ··· 3018 3000 BIT(DRM_COLOR_YCBCR_FULL_RANGE), 3019 3001 DRM_COLOR_YCBCR_BT709, 3020 3002 DRM_COLOR_YCBCR_LIMITED_RANGE); 3003 + 3004 + if (DISPLAY_VER(display) >= 12) 3005 + intel_color_pipeline_plane_init(&plane->base, pipe); 3021 3006 3022 3007 drm_plane_create_alpha_property(&plane->base); 3023 3008 drm_plane_create_blend_mode_property(&plane->base,
+115
drivers/gpu/drm/i915/display/skl_universal_plane_regs.h
··· 254 254 #define PLANE_COLOR_PIPE_CSC_ENABLE REG_BIT(23) /* Pre-ICL */ 255 255 #define PLANE_COLOR_PLANE_CSC_ENABLE REG_BIT(21) /* ICL+ */ 256 256 #define PLANE_COLOR_INPUT_CSC_ENABLE REG_BIT(20) /* ICL+ */ 257 + #define PLANE_COLOR_POST_CSC_GAMMA_MULTSEG_ENABLE REG_BIT(15) /* TGL+ */ 258 + #define PLANE_COLOR_PRE_CSC_GAMMA_ENABLE REG_BIT(14) 257 259 #define PLANE_COLOR_CSC_MODE_MASK REG_GENMASK(19, 17) 258 260 #define PLANE_COLOR_CSC_MODE_BYPASS REG_FIELD_PREP(PLANE_COLOR_CSC_MODE_MASK, 0) 259 261 #define PLANE_COLOR_CSC_MODE_YUV601_TO_RGB601 REG_FIELD_PREP(PLANE_COLOR_CSC_MODE_MASK, 1) ··· 291 289 #define PLANE_INPUT_CSC_POSTOFF(pipe, plane, index) _MMIO_SKL_PLANE_DW((pipe), (plane), (index), \ 292 290 _PLANE_INPUT_CSC_POSTOFF_HI_1_A, _PLANE_INPUT_CSC_POSTOFF_HI_1_B, \ 293 291 _PLANE_INPUT_CSC_POSTOFF_HI_2_A, _PLANE_INPUT_CSC_POSTOFF_HI_2_B) 292 + 293 + #define _MMIO_PLANE_GAMC(plane, i, a, b) _MMIO(_PIPE(plane, a, b) + (i) * 4) 294 + 295 + #define _PLANE_POST_CSC_GAMC_SEG0_INDEX_ENH_1_A 0x70160 296 + #define _PLANE_POST_CSC_GAMC_SEG0_INDEX_ENH_1_B 0x71160 297 + #define _PLANE_POST_CSC_GAMC_SEG0_INDEX_ENH_2_A 0x70260 298 + #define _PLANE_POST_CSC_GAMC_SEG0_INDEX_ENH_2_B 0x71260 299 + #define _PLANE_POST_CSC_GAMC_SEG0_INDEX_ENH_1(pipe) _PIPE(pipe, _PLANE_POST_CSC_GAMC_SEG0_INDEX_ENH_1_A, \ 300 + _PLANE_POST_CSC_GAMC_SEG0_INDEX_ENH_1_B) 301 + #define _PLANE_POST_CSC_GAMC_SEG0_INDEX_ENH_2(pipe) _PIPE(pipe, _PLANE_POST_CSC_GAMC_SEG0_INDEX_ENH_2_A, \ 302 + _PLANE_POST_CSC_GAMC_SEG0_INDEX_ENH_2_B) 303 + #define PLANE_POST_CSC_GAMC_SEG0_INDEX_ENH(pipe, plane, i) _MMIO_PLANE_GAMC(plane, i, _PLANE_POST_CSC_GAMC_SEG0_INDEX_ENH_1(pipe), \ 304 + _PLANE_POST_CSC_GAMC_SEG0_INDEX_ENH_2(pipe)) 305 + 306 + #define _PLANE_POST_CSC_GAMC_SEG0_DATA_ENH_1_A 0x70164 307 + #define _PLANE_POST_CSC_GAMC_SEG0_DATA_ENH_1_B 0x71164 308 + #define _PLANE_POST_CSC_GAMC_SEG0_DATA_ENH_2_A 0x70264 309 + #define _PLANE_POST_CSC_GAMC_SEG0_DATA_ENH_2_B 0x71264 310 + #define _PLANE_POST_CSC_GAMC_SEG0_DATA_ENH_1(pipe) _PIPE(pipe, _PLANE_POST_CSC_GAMC_SEG0_DATA_ENH_1_A, \ 311 + _PLANE_POST_CSC_GAMC_SEG0_DATA_ENH_1_B) 312 + #define _PLANE_POST_CSC_GAMC_SEG0_DATA_ENH_2(pipe) _PIPE(pipe, _PLANE_POST_CSC_GAMC_SEG0_DATA_ENH_2_A, \ 313 + _PLANE_POST_CSC_GAMC_SEG0_DATA_ENH_2_B) 314 + #define PLANE_POST_CSC_GAMC_SEG0_DATA_ENH(pipe, plane, i) _MMIO_PLANE_GAMC(plane, i, _PLANE_POST_CSC_GAMC_SEG0_DATA_ENH_1(pipe), \ 315 + _PLANE_POST_CSC_GAMC_SEG0_DATA_ENH_2(pipe)) 316 + 317 + #define _PLANE_POST_CSC_GAMC_INDEX_ENH_1_A 0x701d8 318 + #define _PLANE_POST_CSC_GAMC_INDEX_ENH_1_B 0x711d8 319 + #define _PLANE_POST_CSC_GAMC_INDEX_ENH_2_A 0x702d8 320 + #define _PLANE_POST_CSC_GAMC_INDEX_ENH_2_B 0x712d8 321 + #define _PLANE_POST_CSC_GAMC_INDEX_ENH_1(pipe) _PIPE(pipe, _PLANE_POST_CSC_GAMC_INDEX_ENH_1_A, \ 322 + _PLANE_POST_CSC_GAMC_INDEX_ENH_1_B) 323 + #define _PLANE_POST_CSC_GAMC_INDEX_ENH_2(pipe) _PIPE(pipe, _PLANE_POST_CSC_GAMC_INDEX_ENH_2_A, \ 324 + _PLANE_POST_CSC_GAMC_INDEX_ENH_2_B) 325 + #define PLANE_POST_CSC_GAMC_INDEX_ENH(pipe, plane, i) _MMIO_PLANE_GAMC(plane, i, _PLANE_POST_CSC_GAMC_INDEX_ENH_1(pipe), \ 326 + _PLANE_POST_CSC_GAMC_INDEX_ENH_2(pipe)) 327 + 328 + #define _PLANE_POST_CSC_GAMC_DATA_ENH_1_A 0x701dc 329 + #define _PLANE_POST_CSC_GAMC_DATA_ENH_1_B 0x711dc 330 + #define _PLANE_POST_CSC_GAMC_DATA_ENH_2_A 0x702dc 331 + #define _PLANE_POST_CSC_GAMC_DATA_ENH_2_B 0x712dc 332 + #define _PLANE_POST_CSC_GAMC_DATA_ENH_1(pipe) _PIPE(pipe, _PLANE_POST_CSC_GAMC_DATA_ENH_1_A, \ 333 + _PLANE_POST_CSC_GAMC_DATA_ENH_1_B) 334 + #define _PLANE_POST_CSC_GAMC_DATA_ENH_2(pipe) _PIPE(pipe, _PLANE_POST_CSC_GAMC_DATA_ENH_2_A, \ 335 + _PLANE_POST_CSC_GAMC_DATA_ENH_2_B) 336 + #define PLANE_POST_CSC_GAMC_DATA_ENH(pipe, plane, i) _MMIO_PLANE_GAMC(plane, i, _PLANE_POST_CSC_GAMC_DATA_ENH_1(pipe), \ 337 + _PLANE_POST_CSC_GAMC_DATA_ENH_2(pipe)) 338 + 339 + #define _PLANE_POST_CSC_GAMC_INDEX_1_A 0x704d8 340 + #define _PLANE_POST_CSC_GAMC_INDEX_1_B 0x714d8 341 + #define _PLANE_POST_CSC_GAMC_INDEX_2_A 0x705d8 342 + #define _PLANE_POST_CSC_GAMC_INDEX_2_B 0x715d8 343 + #define _PLANE_POST_CSC_GAMC_INDEX_1(pipe) _PIPE(pipe, _PLANE_POST_CSC_GAMC_INDEX_1_A, \ 344 + _PLANE_POST_CSC_GAMC_INDEX_1_B) 345 + #define _PLANE_POST_CSC_GAMC_INDEX_2(pipe) _PIPE(pipe, _PLANE_POST_CSC_GAMC_INDEX_2_A, \ 346 + _PLANE_POST_CSC_GAMC_INDEX_2_B) 347 + #define PLANE_POST_CSC_GAMC_INDEX(pipe, plane, i) _MMIO_PLANE_GAMC(plane, i, _PLANE_POST_CSC_GAMC_INDEX_1(pipe), \ 348 + _PLANE_POST_CSC_GAMC_INDEX_2(pipe)) 349 + 350 + #define _PLANE_POST_CSC_GAMC_DATA_1_A 0x704dc 351 + #define _PLANE_POST_CSC_GAMC_DATA_1_B 0x714dc 352 + #define _PLANE_POST_CSC_GAMC_DATA_2_A 0x705dc 353 + #define _PLANE_POST_CSC_GAMC_DATA_2_B 0x715dc 354 + #define _PLANE_POST_CSC_GAMC_DATA_1(pipe) _PIPE(pipe, _PLANE_POST_CSC_GAMC_DATA_1_A, \ 355 + _PLANE_POST_CSC_GAMC_DATA_1_B) 356 + #define _PLANE_POST_CSC_GAMC_DATA_2(pipe) _PIPE(pipe, _PLANE_POST_CSC_GAMC_DATA_2_A, \ 357 + _PLANE_POST_CSC_GAMC_DATA_2_B) 358 + #define PLANE_POST_CSC_GAMC_DATA(pipe, plane, i) _MMIO_PLANE_GAMC(plane, i, _PLANE_POST_CSC_GAMC_DATA_1(pipe), \ 359 + _PLANE_POST_CSC_GAMC_DATA_2(pipe)) 360 + 361 + #define _PLANE_PRE_CSC_GAMC_INDEX_ENH_1_A 0x701d0 362 + #define _PLANE_PRE_CSC_GAMC_INDEX_ENH_1_B 0x711d0 363 + #define _PLANE_PRE_CSC_GAMC_INDEX_ENH_2_A 0x702d0 364 + #define _PLANE_PRE_CSC_GAMC_INDEX_ENH_2_B 0x712d0 365 + #define _PLANE_PRE_CSC_GAMC_INDEX_ENH_1(pipe) _PIPE(pipe, _PLANE_PRE_CSC_GAMC_INDEX_ENH_1_A, \ 366 + _PLANE_PRE_CSC_GAMC_INDEX_ENH_1_B) 367 + #define _PLANE_PRE_CSC_GAMC_INDEX_ENH_2(pipe) _PIPE(pipe, _PLANE_PRE_CSC_GAMC_INDEX_ENH_2_A, \ 368 + _PLANE_PRE_CSC_GAMC_INDEX_ENH_2_B) 369 + #define PLANE_PRE_CSC_GAMC_INDEX_ENH(pipe, plane, i) _MMIO_PLANE_GAMC(plane, i, _PLANE_PRE_CSC_GAMC_INDEX_ENH_1(pipe), \ 370 + _PLANE_PRE_CSC_GAMC_INDEX_ENH_2(pipe)) 371 + #define PLANE_PAL_PREC_AUTO_INCREMENT REG_BIT(10) 372 + 373 + #define _PLANE_PRE_CSC_GAMC_DATA_ENH_1_A 0x701d4 374 + #define _PLANE_PRE_CSC_GAMC_DATA_ENH_1_B 0x711d4 375 + #define _PLANE_PRE_CSC_GAMC_DATA_ENH_2_A 0x702d4 376 + #define _PLANE_PRE_CSC_GAMC_DATA_ENH_2_B 0x712d4 377 + #define _PLANE_PRE_CSC_GAMC_DATA_ENH_1(pipe) _PIPE(pipe, _PLANE_PRE_CSC_GAMC_DATA_ENH_1_A, \ 378 + _PLANE_PRE_CSC_GAMC_DATA_ENH_1_B) 379 + #define _PLANE_PRE_CSC_GAMC_DATA_ENH_2(pipe) _PIPE(pipe, _PLANE_PRE_CSC_GAMC_DATA_ENH_2_A, \ 380 + _PLANE_PRE_CSC_GAMC_DATA_ENH_2_B) 381 + #define PLANE_PRE_CSC_GAMC_DATA_ENH(pipe, plane, i) _MMIO_PLANE_GAMC(plane, i, _PLANE_PRE_CSC_GAMC_DATA_ENH_1(pipe), \ 382 + _PLANE_PRE_CSC_GAMC_DATA_ENH_2(pipe)) 383 + 384 + #define _PLANE_PRE_CSC_GAMC_INDEX_1_A 0x704d0 385 + #define _PLANE_PRE_CSC_GAMC_INDEX_1_B 0x714d0 386 + #define _PLANE_PRE_CSC_GAMC_INDEX_2_A 0x705d0 387 + #define _PLANE_PRE_CSC_GAMC_INDEX_2_B 0x715d0 388 + #define _PLANE_PRE_CSC_GAMC_INDEX_1(pipe) _PIPE(pipe, _PLANE_PRE_CSC_GAMC_INDEX_1_A, \ 389 + _PLANE_PRE_CSC_GAMC_INDEX_1_B) 390 + #define _PLANE_PRE_CSC_GAMC_INDEX_2(pipe) _PIPE(pipe, _PLANE_PRE_CSC_GAMC_INDEX_2_A, \ 391 + _PLANE_PRE_CSC_GAMC_INDEX_2_B) 392 + #define PLANE_PRE_CSC_GAMC_INDEX(pipe, plane, i) _MMIO_PLANE_GAMC(plane, i, _PLANE_PRE_CSC_GAMC_INDEX_1(pipe), \ 393 + _PLANE_PRE_CSC_GAMC_INDEX_2(pipe)) 394 + 395 + #define _PLANE_PRE_CSC_GAMC_DATA_1_A 0x704d4 396 + #define _PLANE_PRE_CSC_GAMC_DATA_1_B 0x714d4 397 + #define _PLANE_PRE_CSC_GAMC_DATA_2_A 0x705d4 398 + #define _PLANE_PRE_CSC_GAMC_DATA_2_B 0x715d4 399 + #define _PLANE_PRE_CSC_GAMC_DATA_1(pipe) _PIPE(pipe, _PLANE_PRE_CSC_GAMC_DATA_1_A, \ 400 + _PLANE_PRE_CSC_GAMC_DATA_1_B) 401 + #define _PLANE_PRE_CSC_GAMC_DATA_2(pipe) _PIPE(pipe, _PLANE_PRE_CSC_GAMC_DATA_2_A, \ 402 + _PLANE_PRE_CSC_GAMC_DATA_2_B) 403 + #define PLANE_PRE_CSC_GAMC_DATA(pipe, plane, i) _MMIO_PLANE_GAMC(plane, i, _PLANE_PRE_CSC_GAMC_DATA_1(pipe), \ 404 + _PLANE_PRE_CSC_GAMC_DATA_2(pipe)) 294 405 295 406 #define _PLANE_CSC_RY_GY_1_A 0x70210 296 407 #define _PLANE_CSC_RY_GY_2_A 0x70310
+2
drivers/gpu/drm/xe/Makefile
··· 246 246 i915-display/intel_cdclk.o \ 247 247 i915-display/intel_cmtg.o \ 248 248 i915-display/intel_color.o \ 249 + i915-display/intel_colorop.o \ 250 + i915-display/intel_color_pipeline.o \ 249 251 i915-display/intel_combo_phy.o \ 250 252 i915-display/intel_connector.o \ 251 253 i915-display/intel_crtc.o \