sna/video: Disable the existing sprite when switching CRTCs

After starting a new video on another CRTC, disable the old one as we
currently only track the single video port. However, showing a video
split across multiple CRTCs would be a useful extension in the future.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-08-23 02:25:34 +01:00
parent 509e7aaf84
commit fc4e81726d
1 changed files with 11 additions and 1 deletions

View File

@ -201,6 +201,8 @@ sna_video_sprite_show(struct sna *sna,
{
struct drm_mode_set_plane s;
/* XXX handle video spanning multiple CRTC */
VG_CLEAR(s);
s.plane_id = sna_crtc_to_plane(crtc);
@ -300,7 +302,15 @@ sna_video_sprite_show(struct sna *sna,
}
frame->bo->domain = DOMAIN_NONE;
video->plane = s.plane_id;
if (video->plane != s.plane_id) {
if (video->plane) {
memset(&s, 0, sizeof(s));
s.plane_id = video->plane;
drmIoctl(video->sna->kgem.fd, DRM_IOCTL_MODE_SETPLANE, &s);
}
video->plane = s.plane_id;
}
if (video->bo != frame->bo) {
if (video->bo)