Bug 11499 - Mplayer's vo gl:yuv=2 broken on radeon rv410 (PCIE)
Summary: Mplayer's vo gl:yuv=2 broken on radeon rv410 (PCIE)
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/r300 (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-08 11:37 UTC by Andrew Randrianasulu
Modified: 2007-10-07 13:59 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Xorg log (52.02 KB, text/plain)
2007-07-08 11:40 UTC, Andrew Randrianasulu
Details
glxinfo -v -l (10.15 KB, text/plain)
2007-07-08 11:41 UTC, Andrew Randrianasulu
Details
two mplayers (286.67 KB, image/jpeg)
2007-07-08 11:48 UTC, Andrew Randrianasulu
Details
part from MPlayer's debug output (-v) (4.09 KB, text/html)
2007-07-08 11:51 UTC, Andrew Randrianasulu
Details
Fragment program, used by mplayer for YV12 -> RGB conversion (820 bytes, text/html)
2007-07-08 11:52 UTC, Andrew Randrianasulu
Details
patch to use writemask in tex instruction (935 bytes, patch)
2007-10-05 08:28 UTC, Jerome Glisse
Details | Splinter Review

Description Andrew Randrianasulu 2007-07-08 11:37:45 UTC
I'm trying to watch video via MPlayer's OpenGL video output. All works fine if i use software colorspace conversion. But i have wrong colors if any fragment-prog based colorspace conversions in use (-vo gl:yuv=[2|3|4]). With software OpenGL (Mesa-6.5.3) same version of MPlayer works fine.

I'll attach Xorg.0.log, screenshot showing two MPlayer windows and glxinfo.
Comment 1 Andrew Randrianasulu 2007-07-08 11:40:21 UTC
Created attachment 10618 [details]
Xorg log
Comment 2 Andrew Randrianasulu 2007-07-08 11:41:42 UTC
Created attachment 10619 [details]
glxinfo -v -l
Comment 3 Andrew Randrianasulu 2007-07-08 11:48:26 UTC
Created attachment 10620 [details]
two mplayers

Upper window with software colorspace conversion, lower window with wrong colors
Comment 4 Andrew Randrianasulu 2007-07-08 11:51:01 UTC
Created attachment 10621 [details]
part from MPlayer's debug output (-v)
Comment 5 Andrew Randrianasulu 2007-07-08 11:52:48 UTC
Created attachment 10622 [details]
Fragment program, used by mplayer for YV12 -> RGB conversion
Comment 6 Oliver McFadden 2007-07-09 03:11:47 UTC
I noticed some of the other formats seem to be black and white. I guess this is not supposed to happen either?  I would guess it's either a bad texture format; I have seen blue patches on argb8888, or a bad fragment program; I think there are some cases where swizzle is broken...  Where does mplayer install the fragment and vertex programs? 
Comment 7 Andrew Randrianasulu 2007-07-09 07:30:42 UTC
some conversion types shouldn't work on r300 dri (like old Ati_fragment_shader method, #5, and NV-specific method #1)

some OpenGL functions are in mplayer/libvo/gl_common.c mplayer/libvo/vo_gl.c

Comment 8 Loïc Molinari 2007-10-04 09:21:07 UTC
The fragment programs used for color space conversion from planar YUV to RGB by mplayer with the methods 2, 3 and 4 are using TEX instructions with writemasks, and it seems the R300 driver does not use that information. I have had the exact same issue in a project (Pigment) using a color space conversion program, and have worked it around writing a fragment program using one more TEMP.

I took a look at the code and did not find the registers to handle that feature.
Comment 9 Andrew Randrianasulu 2007-10-04 11:59:08 UTC
(In reply to comment #8)
> The fragment programs used for color space conversion from planar YUV to RGB by
> mplayer with the methods 2, 3 and 4 are using TEX instructions with writemasks,
> and it seems the R300 driver does not use that information. I have had the
> exact same issue in a project (Pigment) using a color space conversion program,
> and have worked it around writing a fragment program using one more TEMP.
> 
> I took a look at the code and did not find the registers to handle that
> feature.
> 

Thanks for explanation! What do you think is better - fix mplayer side or try to reverse engineering closed-source ati driver? For me, fixing  R300 DRI side is preferable, but i don't know how long this will take ....
Comment 10 Jerome Glisse 2007-10-05 08:28:51 UTC
Created attachment 11908 [details] [review]
patch to use writemask in tex instruction

Does the attached patch (i just tested that it does compile haven't
the hw right now) fix this issue (once you rebuilded mesa you might
need to install newly build libGL and co with new r300_dri.so).
Comment 11 Andrew Randrianasulu 2007-10-06 05:42:23 UTC
(In reply to comment #10)
> Created an attachment (id=11908) [details]
> patch to use writemask in tex instruction
> 
> Does the attached patch (i just tested that it does compile haven't
> the hw right now) fix this issue (once you rebuilded mesa you might
> need to install newly build libGL and co with new r300_dri.so).
> 

Yes, it works!
Comment 12 Jerome Glisse 2007-10-07 13:59:53 UTC
Ok, i have pushed the fix, closing the bug.


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.