diff options
author | Ilia Mirkin <imirkin@alum.mit.edu> | 2013-11-15 11:26:43 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-12-03 08:28:54 -0500 |
commit | efffa9841cf42ae8350d421070cea962b063df8c (patch) | |
tree | 7460826b8b488af212f072091c73ba5b6edc4ba4 /drivers/gpu/drm/nouveau/dispnv04 | |
parent | 050828e9563d03cbaab950c16ae4aebaa02ff0de (diff) |
drm/nv10/plane: some chipsets don't support NV12
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/dispnv04')
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv04/overlay.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv04/overlay.c b/drivers/gpu/drm/nouveau/dispnv04/overlay.c index c14afb794147..32e7064b819b 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/overlay.c +++ b/drivers/gpu/drm/nouveau/dispnv04/overlay.c | |||
@@ -58,8 +58,8 @@ struct nouveau_plane { | |||
58 | }; | 58 | }; |
59 | 59 | ||
60 | static uint32_t formats[] = { | 60 | static uint32_t formats[] = { |
61 | DRM_FORMAT_NV12, | ||
62 | DRM_FORMAT_UYVY, | 61 | DRM_FORMAT_UYVY, |
62 | DRM_FORMAT_NV12, | ||
63 | }; | 63 | }; |
64 | 64 | ||
65 | /* Sine can be approximated with | 65 | /* Sine can be approximated with |
@@ -254,14 +254,25 @@ nv10_overlay_init(struct drm_device *device) | |||
254 | { | 254 | { |
255 | struct nouveau_device *dev = nouveau_dev(device); | 255 | struct nouveau_device *dev = nouveau_dev(device); |
256 | struct nouveau_plane *plane = kzalloc(sizeof(struct nouveau_plane), GFP_KERNEL); | 256 | struct nouveau_plane *plane = kzalloc(sizeof(struct nouveau_plane), GFP_KERNEL); |
257 | int num_formats = ARRAY_SIZE(formats); | ||
257 | int ret; | 258 | int ret; |
258 | 259 | ||
259 | if (!plane) | 260 | if (!plane) |
260 | return; | 261 | return; |
261 | 262 | ||
263 | switch (dev->chipset) { | ||
264 | case 0x10: | ||
265 | case 0x11: | ||
266 | case 0x15: | ||
267 | case 0x1a: | ||
268 | case 0x20: | ||
269 | num_formats = 1; | ||
270 | break; | ||
271 | } | ||
272 | |||
262 | ret = drm_plane_init(device, &plane->base, 3 /* both crtc's */, | 273 | ret = drm_plane_init(device, &plane->base, 3 /* both crtc's */, |
263 | &nv10_plane_funcs, | 274 | &nv10_plane_funcs, |
264 | formats, ARRAY_SIZE(formats), false); | 275 | formats, num_formats, false); |
265 | if (ret) | 276 | if (ret) |
266 | goto err; | 277 | goto err; |
267 | 278 | ||