@@ -505,30 +505,19 @@ static void ilk_color_commit_noarm(const struct intel_crtc_state *crtc_state)
505
505
506
506
static void i9xx_color_commit_arm (const struct intel_crtc_state * crtc_state )
507
507
{
508
- struct intel_crtc * crtc = to_intel_crtc (crtc_state -> uapi .crtc );
509
- struct drm_i915_private * dev_priv = to_i915 (crtc -> base .dev );
510
- enum pipe pipe = crtc -> pipe ;
511
- u32 val ;
512
-
513
- val = intel_de_read (dev_priv , PIPECONF (pipe ));
514
- val &= ~PIPECONF_GAMMA_MODE_MASK_I9XX ;
515
- val |= PIPECONF_GAMMA_MODE (crtc_state -> gamma_mode );
516
- intel_de_write (dev_priv , PIPECONF (pipe ), val );
508
+ /* update PIPECONF GAMMA_MODE */
509
+ i9xx_set_pipeconf (crtc_state );
517
510
}
518
511
519
512
static void ilk_color_commit_arm (const struct intel_crtc_state * crtc_state )
520
513
{
521
514
struct intel_crtc * crtc = to_intel_crtc (crtc_state -> uapi .crtc );
522
515
struct drm_i915_private * dev_priv = to_i915 (crtc -> base .dev );
523
- enum pipe pipe = crtc -> pipe ;
524
- u32 val ;
525
516
526
- val = intel_de_read (dev_priv , PIPECONF (pipe ));
527
- val &= ~PIPECONF_GAMMA_MODE_MASK_ILK ;
528
- val |= PIPECONF_GAMMA_MODE (crtc_state -> gamma_mode );
529
- intel_de_write (dev_priv , PIPECONF (pipe ), val );
517
+ /* update PIPECONF GAMMA_MODE */
518
+ ilk_set_pipeconf (crtc_state );
530
519
531
- intel_de_write_fw (dev_priv , PIPE_CSC_MODE (pipe ),
520
+ intel_de_write_fw (dev_priv , PIPE_CSC_MODE (crtc -> pipe ),
532
521
crtc_state -> csc_mode );
533
522
}
534
523
@@ -852,7 +841,7 @@ static void glk_load_degamma_lut(const struct intel_crtc_state *crtc_state)
852
841
struct intel_crtc * crtc = to_intel_crtc (crtc_state -> uapi .crtc );
853
842
struct drm_i915_private * dev_priv = to_i915 (crtc -> base .dev );
854
843
enum pipe pipe = crtc -> pipe ;
855
- int i , lut_size = INTEL_INFO (dev_priv )-> color .degamma_lut_size ;
844
+ int i , lut_size = INTEL_INFO (dev_priv )-> display . color .degamma_lut_size ;
856
845
const struct drm_color_lut * lut = crtc_state -> hw .degamma_lut -> data ;
857
846
858
847
/*
@@ -894,7 +883,7 @@ static void glk_load_degamma_lut_linear(const struct intel_crtc_state *crtc_stat
894
883
struct intel_crtc * crtc = to_intel_crtc (crtc_state -> uapi .crtc );
895
884
struct drm_i915_private * dev_priv = to_i915 (crtc -> base .dev );
896
885
enum pipe pipe = crtc -> pipe ;
897
- int i , lut_size = INTEL_INFO (dev_priv )-> color .degamma_lut_size ;
886
+ int i , lut_size = INTEL_INFO (dev_priv )-> display . color .degamma_lut_size ;
898
887
899
888
/*
900
889
* When setting the auto-increment bit, the hardware seems to
@@ -1346,10 +1335,10 @@ static int check_luts(const struct intel_crtc_state *crtc_state)
1346
1335
return - EINVAL ;
1347
1336
}
1348
1337
1349
- degamma_length = INTEL_INFO (dev_priv )-> color .degamma_lut_size ;
1350
- gamma_length = INTEL_INFO (dev_priv )-> color .gamma_lut_size ;
1351
- degamma_tests = INTEL_INFO (dev_priv )-> color .degamma_lut_tests ;
1352
- gamma_tests = INTEL_INFO (dev_priv )-> color .gamma_lut_tests ;
1338
+ degamma_length = INTEL_INFO (dev_priv )-> display . color .degamma_lut_size ;
1339
+ gamma_length = INTEL_INFO (dev_priv )-> display . color .gamma_lut_size ;
1340
+ degamma_tests = INTEL_INFO (dev_priv )-> display . color .degamma_lut_tests ;
1341
+ gamma_tests = INTEL_INFO (dev_priv )-> display . color .gamma_lut_tests ;
1353
1342
1354
1343
if (check_lut_size (degamma_lut , degamma_length ) ||
1355
1344
check_lut_size (gamma_lut , gamma_length ))
@@ -1885,7 +1874,7 @@ static void i9xx_read_luts(struct intel_crtc_state *crtc_state)
1885
1874
static struct drm_property_blob * i965_read_lut_10p6 (struct intel_crtc * crtc )
1886
1875
{
1887
1876
struct drm_i915_private * dev_priv = to_i915 (crtc -> base .dev );
1888
- int i , lut_size = INTEL_INFO (dev_priv )-> color .gamma_lut_size ;
1877
+ int i , lut_size = INTEL_INFO (dev_priv )-> display . color .gamma_lut_size ;
1889
1878
enum pipe pipe = crtc -> pipe ;
1890
1879
struct drm_property_blob * blob ;
1891
1880
struct drm_color_lut * lut ;
@@ -1928,7 +1917,7 @@ static void i965_read_luts(struct intel_crtc_state *crtc_state)
1928
1917
static struct drm_property_blob * chv_read_cgm_gamma (struct intel_crtc * crtc )
1929
1918
{
1930
1919
struct drm_i915_private * dev_priv = to_i915 (crtc -> base .dev );
1931
- int i , lut_size = INTEL_INFO (dev_priv )-> color .gamma_lut_size ;
1920
+ int i , lut_size = INTEL_INFO (dev_priv )-> display . color .gamma_lut_size ;
1932
1921
enum pipe pipe = crtc -> pipe ;
1933
1922
struct drm_property_blob * blob ;
1934
1923
struct drm_color_lut * lut ;
@@ -1989,7 +1978,7 @@ static struct drm_property_blob *ilk_read_lut_8(struct intel_crtc *crtc)
1989
1978
static struct drm_property_blob * ilk_read_lut_10 (struct intel_crtc * crtc )
1990
1979
{
1991
1980
struct drm_i915_private * dev_priv = to_i915 (crtc -> base .dev );
1992
- int i , lut_size = INTEL_INFO (dev_priv )-> color .gamma_lut_size ;
1981
+ int i , lut_size = INTEL_INFO (dev_priv )-> display . color .gamma_lut_size ;
1993
1982
enum pipe pipe = crtc -> pipe ;
1994
1983
struct drm_property_blob * blob ;
1995
1984
struct drm_color_lut * lut ;
@@ -2040,7 +2029,7 @@ static struct drm_property_blob *bdw_read_lut_10(struct intel_crtc *crtc,
2040
2029
{
2041
2030
struct drm_i915_private * dev_priv = to_i915 (crtc -> base .dev );
2042
2031
int i , hw_lut_size = ivb_lut_10_size (prec_index );
2043
- int lut_size = INTEL_INFO (dev_priv )-> color .gamma_lut_size ;
2032
+ int lut_size = INTEL_INFO (dev_priv )-> display . color .gamma_lut_size ;
2044
2033
enum pipe pipe = crtc -> pipe ;
2045
2034
struct drm_property_blob * blob ;
2046
2035
struct drm_color_lut * lut ;
@@ -2093,7 +2082,7 @@ static struct drm_property_blob *
2093
2082
icl_read_lut_multi_segment (struct intel_crtc * crtc )
2094
2083
{
2095
2084
struct drm_i915_private * dev_priv = to_i915 (crtc -> base .dev );
2096
- int i , lut_size = INTEL_INFO (dev_priv )-> color .gamma_lut_size ;
2085
+ int i , lut_size = INTEL_INFO (dev_priv )-> display . color .gamma_lut_size ;
2097
2086
enum pipe pipe = crtc -> pipe ;
2098
2087
struct drm_property_blob * blob ;
2099
2088
struct drm_color_lut * lut ;
@@ -2230,7 +2219,7 @@ static const struct intel_color_funcs ilk_color_funcs = {
2230
2219
void intel_color_init (struct intel_crtc * crtc )
2231
2220
{
2232
2221
struct drm_i915_private * dev_priv = to_i915 (crtc -> base .dev );
2233
- bool has_ctm = INTEL_INFO (dev_priv )-> color .degamma_lut_size != 0 ;
2222
+ bool has_ctm = INTEL_INFO (dev_priv )-> display . color .degamma_lut_size != 0 ;
2234
2223
2235
2224
drm_mode_crtc_set_gamma_size (& crtc -> base , 256 );
2236
2225
@@ -2261,7 +2250,7 @@ void intel_color_init(struct intel_crtc *crtc)
2261
2250
}
2262
2251
2263
2252
drm_crtc_enable_color_mgmt (& crtc -> base ,
2264
- INTEL_INFO (dev_priv )-> color .degamma_lut_size ,
2253
+ INTEL_INFO (dev_priv )-> display . color .degamma_lut_size ,
2265
2254
has_ctm ,
2266
- INTEL_INFO (dev_priv )-> color .gamma_lut_size );
2255
+ INTEL_INFO (dev_priv )-> display . color .gamma_lut_size );
2267
2256
}
0 commit comments