summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tegra/plane.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2018-01-08 15:40:44 +0300
committerThierry Reding <treding@nvidia.com>2018-01-08 15:44:17 +0300
commit5467a8b8da9890e6216dd786e7f65cce5f23d014 (patch)
tree5549c0940dc05cbaa6b0263f11f346f97b1ec809 /drivers/gpu/drm/tegra/plane.c
parentebae8d07435ae91314f4a28d69b530d09c625815 (diff)
downloadlinux-5467a8b8da9890e6216dd786e7f65cce5f23d014.tar.xz
drm/tegra: dc: Restore YUV overlay support
Commit ebae8d07435a ("drm/tegra: dc: Implement legacy blending") broke support for YUV overlays by accident. The reason is that YUV formats are considered opaque because they have no alpha component, but on the other hand no corresponding format with an alpha component can be returned. In the case of YUV formats, the opaque format is the same as the alpha format, so add the special case to restore YUV overlay support. Reported-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/drm/tegra/plane.c')
-rw-r--r--drivers/gpu/drm/tegra/plane.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/tegra/plane.c b/drivers/gpu/drm/tegra/plane.c
index 154b4d337d0a..36a06a993698 100644
--- a/drivers/gpu/drm/tegra/plane.c
+++ b/drivers/gpu/drm/tegra/plane.c
@@ -276,6 +276,11 @@ bool tegra_plane_format_has_alpha(unsigned int format)
int tegra_plane_format_get_alpha(unsigned int opaque, unsigned int *alpha)
{
+ if (tegra_plane_format_is_yuv(opaque, NULL)) {
+ *alpha = opaque;
+ return 0;
+ }
+
switch (opaque) {
case WIN_COLOR_DEPTH_B5G5R5X1:
*alpha = WIN_COLOR_DEPTH_B5G5R5A1;