Skip to content

Commit

Permalink
drm/nv10/plane: some chipsets don't support NV12
Browse files Browse the repository at this point in the history
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ilia Mirkin authored and Ben Skeggs committed Dec 3, 2013
1 parent 050828e commit efffa98
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions drivers/gpu/drm/nouveau/dispnv04/overlay.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ struct nouveau_plane {
};

static uint32_t formats[] = {
DRM_FORMAT_NV12,
DRM_FORMAT_UYVY,
DRM_FORMAT_NV12,
};

/* Sine can be approximated with
Expand Down Expand Up @@ -254,14 +254,25 @@ nv10_overlay_init(struct drm_device *device)
{
struct nouveau_device *dev = nouveau_dev(device);
struct nouveau_plane *plane = kzalloc(sizeof(struct nouveau_plane), GFP_KERNEL);
int num_formats = ARRAY_SIZE(formats);
int ret;

if (!plane)
return;

switch (dev->chipset) {
case 0x10:
case 0x11:
case 0x15:
case 0x1a:
case 0x20:
num_formats = 1;
break;
}

ret = drm_plane_init(device, &plane->base, 3 /* both crtc's */,
&nv10_plane_funcs,
formats, ARRAY_SIZE(formats), false);
formats, num_formats, false);
if (ret)
goto err;

Expand Down

0 comments on commit efffa98

Please sign in to comment.