Bug 21487

Summary: V4L doesn't use Trident Backend Scaler on Trident CyberBlade/i1
Product: xorg Reporter: Dmitry Gryazin <gdu>
Component: Driver/TridentAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED INVALID QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium Keywords: patch
Version: git   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
xorg-video-trident patch
none
xorg-video-v4l patch none

Description Dmitry Gryazin 2009-04-30 00:44:39 UTC
Trident hardware Scaler fails to scale video.
It seems that something is wrong in this pipeline:

videogradder -> backend hardware scaler -> video-display.

Trident driver's hardware Scaler supports YUV format, but YUY2 palette.
xvinfo out:
....
id:0x32595559 (YUY2)
  guid: 59555932-0000-0010-8000-00aa00389b71
  bits perpixel: 16
  number of planes: 1
  type: YUV (packed)

I have found in V4L2 API specifications that it supports YUYV.
(http://v4l2spec.bytesex.org/spec-single/v4l2.html)

1. v4l_check_yuv function couldn't setup the pipeline to hardware scaler.
Why? The IDs of the formats are the same in Video card driver and V4L driver.

2. The default initial format in TRIDENTInitOffscreenImages function
is RV16. And it isn't supported by V4L video driver.

I have found trivial soultion:

1. Modify xf86-video-trident driver. Init ofscreen images by correct format in
TRIDENTInitOffscreenImages function.

2. Modify xf86-video-v4l subsystem-driver. Append YUY2 palette to the YUV
supported formats list with the YUYV's ID. It should works fine with modern
Video Cards, because they support both YUV formats.

[PATCH 1/2]

diff --git a/src/trident_video.c b/src/trident_video.c
index 7b6fb10..87e56ec 100644
--- a/src/trident_video.c
+++ b/src/trident_video.c
@@ -1132,7 +1132,7 @@ TRIDENTInitOffscreenImages(ScreenPtr pScreen)
     if(!(offscreenImages = xalloc(sizeof(XF86OffscreenImageRec))))
        return;

-    offscreenImages[0].image = &Images[0];
+    offscreenImages[0].image = &Images[2];
     offscreenImages[0].flags = VIDEO_OVERLAID_IMAGES | 
                               VIDEO_CLIP_TO_VIEWPORT;
     offscreenImages[0].alloc_surface = TRIDENTAllocateSurface;


[PATCH 2/2]

diff --git a/src/v4l.c b/src/v4l.c
index 9210a3f..1256ea9 100644
--- a/src/v4l.c
+++ b/src/v4l.c
@@ -865,6 +865,7 @@ static void v4l_check_yuv(ScrnInfoPtr pScrn, PortPrivPtr
pPPriv,
     } yuvlist[] = {
        { VIDEO_PALETTE_YUV422, 16, 0x32595559, XvPacked },
        { VIDEO_PALETTE_UYVY,   16, 0x59565955, XvPacked },
+       { VIDEO_PALETTE_YUYV,   16, 0x32595559, XvPacked },
        { 0 /* end of list */ },
     };
     ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
Comment 1 Dmitry Gryazin 2009-04-30 00:46:50 UTC
Created attachment 25291 [details] [review]
xorg-video-trident patch
Comment 2 Dmitry Gryazin 2009-04-30 00:47:46 UTC
Created attachment 25292 [details] [review]
xorg-video-v4l patch
Comment 3 Adam Jackson 2018-06-12 19:10:16 UTC
Mass closure: This bug has been untouched for more than six years, and is not
obviously still valid. Please reopen this bug or file a new report if you continue to experience issues with current releases.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.