mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-25 02:32:08 +03:00
UPSTREAM: drm/tegra: hub: Fix YUV support
The driver currently exposes several YUV formats but fails to properly program all the registers needed to display such formats. Add the right programming sequences so that overlay windows can be used to accelerate color format conversions in multimedia playback use-cases. Change-Id: I0c508936e022557e02670d114933ba3865048b85 Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2545953 Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com> Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
Laxman Dewangan
parent
99b2dfcad0
commit
fbce3f1d95
@@ -376,7 +376,20 @@ int tegra_plane_format(u32 fourcc, u32 *format, u32 *swap)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool tegra_plane_format_is_yuv(unsigned int format, bool *planar)
|
||||
bool tegra_plane_format_is_indexed(unsigned int format)
|
||||
{
|
||||
switch (format) {
|
||||
case WIN_COLOR_DEPTH_P1:
|
||||
case WIN_COLOR_DEPTH_P2:
|
||||
case WIN_COLOR_DEPTH_P4:
|
||||
case WIN_COLOR_DEPTH_P8:
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool tegra_plane_format_is_yuv(unsigned int format, bool *planar, unsigned int *bpc)
|
||||
{
|
||||
switch (format) {
|
||||
case WIN_COLOR_DEPTH_YCbCr422:
|
||||
@@ -384,6 +397,9 @@ bool tegra_plane_format_is_yuv(unsigned int format, bool *planar)
|
||||
if (planar)
|
||||
*planar = false;
|
||||
|
||||
if (bpc)
|
||||
*bpc = 8;
|
||||
|
||||
return true;
|
||||
|
||||
case WIN_COLOR_DEPTH_YCbCr420P:
|
||||
@@ -397,6 +413,9 @@ bool tegra_plane_format_is_yuv(unsigned int format, bool *planar)
|
||||
if (planar)
|
||||
*planar = true;
|
||||
|
||||
if (bpc)
|
||||
*bpc = 8;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -422,7 +441,7 @@ static bool __drm_format_has_alpha(u32 format)
|
||||
static int tegra_plane_format_get_alpha(unsigned int opaque,
|
||||
unsigned int *alpha)
|
||||
{
|
||||
if (tegra_plane_format_is_yuv(opaque, NULL)) {
|
||||
if (tegra_plane_format_is_yuv(opaque, NULL, NULL)) {
|
||||
*alpha = opaque;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user