brcm2708: update to latest patches from the RPi foundation
[openwrt/staging/wigyori.git] / target / linux / brcm2708 / patches-4.14 / 950-0182-drm-vc4-Add-support-for-NV21-and-NV61.patch
1 From 4c974447d05dc0295676b2ba4554351bf77886f6 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Thu, 16 Nov 2017 14:22:31 +0000
4 Subject: [PATCH 182/454] drm/vc4: Add support for NV21 and NV61.
5
6 NV12 (YUV420 2 plane) and NV16 (YUV422 2 plane) were
7 supported, but NV21 and NV61 (same but with Cb and Cr
8 swapped) weren't. Add them.
9
10 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
11 Signed-off-by: Eric Anholt <eric@anholt.net>
12 Reviewed-by: Eric Anholt <eric@anholt.net>
13 Link: https://patchwork.freedesktop.org/patch/msgid/1f50799525e3401551dff2b0b2828b9ab892f75f.1510841336.git.dave.stevenson@raspberrypi.org
14 (cherry picked from commit cb20dd170d6a7d41e0f347998771b0e0db183438)
15 ---
16 drivers/gpu/drm/vc4/vc4_plane.c | 10 ++++++++++
17 1 file changed, 10 insertions(+)
18
19 --- a/drivers/gpu/drm/vc4/vc4_plane.c
20 +++ b/drivers/gpu/drm/vc4/vc4_plane.c
21 @@ -153,10 +153,20 @@ static const struct hvs_format {
22 .pixel_order = HVS_PIXEL_ORDER_XYCBCR,
23 },
24 {
25 + .drm = DRM_FORMAT_NV21,
26 + .hvs = HVS_PIXEL_FORMAT_YCBCR_YUV420_2PLANE,
27 + .pixel_order = HVS_PIXEL_ORDER_XYCRCB,
28 + },
29 + {
30 .drm = DRM_FORMAT_NV16,
31 .hvs = HVS_PIXEL_FORMAT_YCBCR_YUV422_2PLANE,
32 .pixel_order = HVS_PIXEL_ORDER_XYCBCR,
33 },
34 + {
35 + .drm = DRM_FORMAT_NV61,
36 + .hvs = HVS_PIXEL_FORMAT_YCBCR_YUV422_2PLANE,
37 + .pixel_order = HVS_PIXEL_ORDER_XYCRCB,
38 + },
39 };
40
41 static const struct hvs_format *vc4_get_hvs_format(u32 drm_format)