mirror of https://gitee.com/openkylin/linux.git
drm/sun4i: frontend: Add support for packed YUV422 input formats
This introduces support for packed YUV formats with 4:2:2 sampling using the frontend. Definitions are introduced for the data format and pixel sequence input format register values. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190118145133.21281-9-paul.kocialkowski@bootlin.com
This commit is contained in:
parent
b38f61f52e
commit
34d896ed1b
|
@ -133,6 +133,8 @@ sun4i_frontend_drm_format_to_input_fmt(const struct drm_format_info *format,
|
||||||
{
|
{
|
||||||
if (!format->is_yuv)
|
if (!format->is_yuv)
|
||||||
*val = SUN4I_FRONTEND_INPUT_FMT_DATA_FMT_RGB;
|
*val = SUN4I_FRONTEND_INPUT_FMT_DATA_FMT_RGB;
|
||||||
|
else if (drm_format_info_is_yuv_sampling_422(format))
|
||||||
|
*val = SUN4I_FRONTEND_INPUT_FMT_DATA_FMT_YUV422;
|
||||||
else
|
else
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
@ -160,10 +162,26 @@ sun4i_frontend_drm_format_to_input_sequence(const struct drm_format_info *format
|
||||||
*val = SUN4I_FRONTEND_INPUT_FMT_DATA_PS_BGRX;
|
*val = SUN4I_FRONTEND_INPUT_FMT_DATA_PS_BGRX;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
case DRM_FORMAT_UYVY:
|
||||||
|
*val = SUN4I_FRONTEND_INPUT_FMT_DATA_PS_UYVY;
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
case DRM_FORMAT_VYUY:
|
||||||
|
*val = SUN4I_FRONTEND_INPUT_FMT_DATA_PS_VYUY;
|
||||||
|
return 0;
|
||||||
|
|
||||||
case DRM_FORMAT_XRGB8888:
|
case DRM_FORMAT_XRGB8888:
|
||||||
*val = SUN4I_FRONTEND_INPUT_FMT_DATA_PS_XRGB;
|
*val = SUN4I_FRONTEND_INPUT_FMT_DATA_PS_XRGB;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
case DRM_FORMAT_YUYV:
|
||||||
|
*val = SUN4I_FRONTEND_INPUT_FMT_DATA_PS_YUYV;
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
case DRM_FORMAT_YVYU:
|
||||||
|
*val = SUN4I_FRONTEND_INPUT_FMT_DATA_PS_YVYU;
|
||||||
|
return 0;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
@ -187,7 +205,11 @@ static int sun4i_frontend_drm_format_to_output_fmt(uint32_t fmt, u32 *val)
|
||||||
|
|
||||||
static const uint32_t sun4i_frontend_formats[] = {
|
static const uint32_t sun4i_frontend_formats[] = {
|
||||||
DRM_FORMAT_BGRX8888,
|
DRM_FORMAT_BGRX8888,
|
||||||
|
DRM_FORMAT_UYVY,
|
||||||
|
DRM_FORMAT_VYUY,
|
||||||
DRM_FORMAT_XRGB8888,
|
DRM_FORMAT_XRGB8888,
|
||||||
|
DRM_FORMAT_YUYV,
|
||||||
|
DRM_FORMAT_YVYU,
|
||||||
};
|
};
|
||||||
|
|
||||||
bool sun4i_frontend_format_is_supported(uint32_t fmt, uint64_t modifier)
|
bool sun4i_frontend_format_is_supported(uint32_t fmt, uint64_t modifier)
|
||||||
|
|
|
@ -27,7 +27,12 @@
|
||||||
|
|
||||||
#define SUN4I_FRONTEND_INPUT_FMT_REG 0x04c
|
#define SUN4I_FRONTEND_INPUT_FMT_REG 0x04c
|
||||||
#define SUN4I_FRONTEND_INPUT_FMT_DATA_MOD_PACKED (1 << 8)
|
#define SUN4I_FRONTEND_INPUT_FMT_DATA_MOD_PACKED (1 << 8)
|
||||||
|
#define SUN4I_FRONTEND_INPUT_FMT_DATA_FMT_YUV422 (1 << 4)
|
||||||
#define SUN4I_FRONTEND_INPUT_FMT_DATA_FMT_RGB (5 << 4)
|
#define SUN4I_FRONTEND_INPUT_FMT_DATA_FMT_RGB (5 << 4)
|
||||||
|
#define SUN4I_FRONTEND_INPUT_FMT_DATA_PS_UYVY 0
|
||||||
|
#define SUN4I_FRONTEND_INPUT_FMT_DATA_PS_YUYV 1
|
||||||
|
#define SUN4I_FRONTEND_INPUT_FMT_DATA_PS_VYUY 2
|
||||||
|
#define SUN4I_FRONTEND_INPUT_FMT_DATA_PS_YVYU 3
|
||||||
#define SUN4I_FRONTEND_INPUT_FMT_DATA_PS_BGRX 0
|
#define SUN4I_FRONTEND_INPUT_FMT_DATA_PS_BGRX 0
|
||||||
#define SUN4I_FRONTEND_INPUT_FMT_DATA_PS_XRGB 1
|
#define SUN4I_FRONTEND_INPUT_FMT_DATA_PS_XRGB 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue