From 2c8fe1a6820e526d500f721662ae02b352a8f706 Mon Sep 17 00:00:00 2001 From: Joonyoung Shim Date: Mon, 28 Jul 2014 09:31:21 +0900 Subject: [PATCH] drm: add checking DRM_FORMAT_NV12MT If user NV12MT uses as pixel format, the Addfb2 ioctl is failed because of missing to check DRM_FORMAT_NV12MT. The NV12MT pixel format is supported by exynos4 and some qualcomm chipset and it is used by exynos drm driver. Change-Id: I94435dc3bff96377b9dd295d469e862ac637c6bc Signed-off-by: Joonyoung Shim --- drivers/gpu/drm/drm_crtc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index ae9c4dd..276e6d1 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -2292,6 +2292,7 @@ static int format_check(const struct drm_mode_fb_cmd2 *r) case DRM_FORMAT_NV61: case DRM_FORMAT_NV24: case DRM_FORMAT_NV42: + case DRM_FORMAT_NV12MT: case DRM_FORMAT_YUV410: case DRM_FORMAT_YVU410: case DRM_FORMAT_YUV411: @@ -3682,6 +3683,7 @@ int drm_format_num_planes(uint32_t format) case DRM_FORMAT_NV61: case DRM_FORMAT_NV24: case DRM_FORMAT_NV42: + case DRM_FORMAT_NV12MT: return 2; default: return 1; @@ -3717,6 +3719,7 @@ int drm_format_plane_cpp(uint32_t format, int plane) case DRM_FORMAT_NV61: case DRM_FORMAT_NV24: case DRM_FORMAT_NV42: + case DRM_FORMAT_NV12MT: return plane ? 2 : 1; case DRM_FORMAT_YUV410: case DRM_FORMAT_YVU410: @@ -3760,6 +3763,7 @@ int drm_format_horz_chroma_subsampling(uint32_t format) case DRM_FORMAT_NV21: case DRM_FORMAT_NV16: case DRM_FORMAT_NV61: + case DRM_FORMAT_NV12MT: case DRM_FORMAT_YUV422: case DRM_FORMAT_YVU422: case DRM_FORMAT_YUV420: @@ -3789,6 +3793,7 @@ int drm_format_vert_chroma_subsampling(uint32_t format) case DRM_FORMAT_YVU420: case DRM_FORMAT_NV12: case DRM_FORMAT_NV21: + case DRM_FORMAT_NV12MT: return 2; default: return 1; -- 2.7.4