提交 7fa620d5 编写于 作者: I Ilia Mirkin 提交者: Ben Skeggs

drm/nouveau/kms/nv10-nv40: add NV21 support to overlay

Signed-off-by: NIlia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
上级 9a6edc3a
...@@ -63,6 +63,7 @@ static uint32_t formats[] = { ...@@ -63,6 +63,7 @@ static uint32_t formats[] = {
DRM_FORMAT_YUYV, DRM_FORMAT_YUYV,
DRM_FORMAT_UYVY, DRM_FORMAT_UYVY,
DRM_FORMAT_NV12, DRM_FORMAT_NV12,
DRM_FORMAT_NV21,
}; };
/* Sine can be approximated with /* Sine can be approximated with
...@@ -159,16 +160,18 @@ nv10_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, ...@@ -159,16 +160,18 @@ nv10_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
nvif_wr32(dev, NV_PVIDEO_POINT_OUT(flip), crtc_y << 16 | crtc_x); nvif_wr32(dev, NV_PVIDEO_POINT_OUT(flip), crtc_y << 16 | crtc_x);
nvif_wr32(dev, NV_PVIDEO_SIZE_OUT(flip), crtc_h << 16 | crtc_w); nvif_wr32(dev, NV_PVIDEO_SIZE_OUT(flip), crtc_h << 16 | crtc_w);
if (fb->format->format != DRM_FORMAT_UYVY) if (fb->format->format == DRM_FORMAT_YUYV ||
fb->format->format == DRM_FORMAT_NV12)
format |= NV_PVIDEO_FORMAT_COLOR_LE_CR8YB8CB8YA8; format |= NV_PVIDEO_FORMAT_COLOR_LE_CR8YB8CB8YA8;
if (fb->format->format == DRM_FORMAT_NV12) if (fb->format->format == DRM_FORMAT_NV12 ||
fb->format->format == DRM_FORMAT_NV21)
format |= NV_PVIDEO_FORMAT_PLANAR; format |= NV_PVIDEO_FORMAT_PLANAR;
if (nv_plane->iturbt_709) if (nv_plane->iturbt_709)
format |= NV_PVIDEO_FORMAT_MATRIX_ITURBT709; format |= NV_PVIDEO_FORMAT_MATRIX_ITURBT709;
if (nv_plane->colorkey & (1 << 24)) if (nv_plane->colorkey & (1 << 24))
format |= NV_PVIDEO_FORMAT_DISPLAY_COLOR_KEY; format |= NV_PVIDEO_FORMAT_DISPLAY_COLOR_KEY;
if (fb->format->format == DRM_FORMAT_NV12) { if (format & NV_PVIDEO_FORMAT_PLANAR) {
nvif_wr32(dev, NV_PVIDEO_UVPLANE_BASE(flip), 0); nvif_wr32(dev, NV_PVIDEO_UVPLANE_BASE(flip), 0);
nvif_wr32(dev, NV_PVIDEO_UVPLANE_OFFSET_BUFF(flip), nvif_wr32(dev, NV_PVIDEO_UVPLANE_OFFSET_BUFF(flip),
nv_fb->nvbo->bo.offset + fb->offsets[1]); nv_fb->nvbo->bo.offset + fb->offsets[1]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册