diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2015-02-23 10:11:49 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-03-19 12:26:25 -0400 |
commit | 67ba31d3528e2460b2243b2d139b70fa479602e8 (patch) | |
tree | db280d4956d9c12d0a53aed43f2955d30e4aabca | |
parent | 6b94aea01d4f96235e947892f6c39f837045e741 (diff) |
drm/radeon: add an output_csc property
This adds the drm property for output csc (e.g.,
transform of output display colorspace). Currently
only common ones (TV RGB, BT.601, BT.709) are supported,
but bypass and tv rgb are really the only useful ones at
the moment. Additionally we could expose a user adjustable
matrix in the future.
This commit just adds the property. The hw support will
be added in subsequent patches.
bug:
https://bugs.freedesktop.org/show_bug.cgi?id=83226
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_display.c | 13 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_mode.h | 9 |
2 files changed, 22 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index 913fafa597ad..d57dfb954257 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c | |||
@@ -1382,6 +1382,13 @@ static struct drm_prop_enum_list radeon_dither_enum_list[] = | |||
1382 | { RADEON_FMT_DITHER_ENABLE, "on" }, | 1382 | { RADEON_FMT_DITHER_ENABLE, "on" }, |
1383 | }; | 1383 | }; |
1384 | 1384 | ||
1385 | static struct drm_prop_enum_list radeon_output_csc_enum_list[] = | ||
1386 | { { RADEON_OUTPUT_CSC_BYPASS, "bypass" }, | ||
1387 | { RADEON_OUTPUT_CSC_TVRGB, "tvrgb" }, | ||
1388 | { RADEON_OUTPUT_CSC_YCBCR601, "ycbcr601" }, | ||
1389 | { RADEON_OUTPUT_CSC_YCBCR709, "ycbcr709" }, | ||
1390 | }; | ||
1391 | |||
1385 | static int radeon_modeset_create_props(struct radeon_device *rdev) | 1392 | static int radeon_modeset_create_props(struct radeon_device *rdev) |
1386 | { | 1393 | { |
1387 | int sz; | 1394 | int sz; |
@@ -1444,6 +1451,12 @@ static int radeon_modeset_create_props(struct radeon_device *rdev) | |||
1444 | "dither", | 1451 | "dither", |
1445 | radeon_dither_enum_list, sz); | 1452 | radeon_dither_enum_list, sz); |
1446 | 1453 | ||
1454 | sz = ARRAY_SIZE(radeon_output_csc_enum_list); | ||
1455 | rdev->mode_info.output_csc_property = | ||
1456 | drm_property_create_enum(rdev->ddev, 0, | ||
1457 | "output_csc", | ||
1458 | radeon_output_csc_enum_list, sz); | ||
1459 | |||
1447 | return 0; | 1460 | return 0; |
1448 | } | 1461 | } |
1449 | 1462 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h index 920a8be8abad..67d4f776147d 100644 --- a/drivers/gpu/drm/radeon/radeon_mode.h +++ b/drivers/gpu/drm/radeon/radeon_mode.h | |||
@@ -85,6 +85,13 @@ enum radeon_hpd_id { | |||
85 | RADEON_HPD_NONE = 0xff, | 85 | RADEON_HPD_NONE = 0xff, |
86 | }; | 86 | }; |
87 | 87 | ||
88 | enum radeon_output_csc { | ||
89 | RADEON_OUTPUT_CSC_BYPASS = 0, | ||
90 | RADEON_OUTPUT_CSC_TVRGB = 1, | ||
91 | RADEON_OUTPUT_CSC_YCBCR601 = 2, | ||
92 | RADEON_OUTPUT_CSC_YCBCR709 = 3, | ||
93 | }; | ||
94 | |||
88 | #define RADEON_MAX_I2C_BUS 16 | 95 | #define RADEON_MAX_I2C_BUS 16 |
89 | 96 | ||
90 | /* radeon gpio-based i2c | 97 | /* radeon gpio-based i2c |
@@ -255,6 +262,8 @@ struct radeon_mode_info { | |||
255 | struct drm_property *audio_property; | 262 | struct drm_property *audio_property; |
256 | /* FMT dithering */ | 263 | /* FMT dithering */ |
257 | struct drm_property *dither_property; | 264 | struct drm_property *dither_property; |
265 | /* Output CSC */ | ||
266 | struct drm_property *output_csc_property; | ||
258 | /* hardcoded DFP edid from BIOS */ | 267 | /* hardcoded DFP edid from BIOS */ |
259 | struct edid *bios_hardcoded_edid; | 268 | struct edid *bios_hardcoded_edid; |
260 | int bios_hardcoded_edid_size; | 269 | int bios_hardcoded_edid_size; |