Bug 13274

Summary: XVideo 24bit RGB image causes server crash.
Product: xorg Reporter: Kusanagi Kouichi <slash>
Component: Driver/RadeonAssignee: xf86-video-ati maintainers <xorg-driver-ati>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: blocker    
Priority: medium    
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
patch for this bug.
none
patch take 2
none
testcase none

Description Kusanagi Kouichi 2007-11-16 04:38:26 UTC
If I put 24bit RGB image with XvPutImage(), server is crashed with signal 11.
This occurs only when DRI and DMA are enabled.
Comment 1 Kusanagi Kouichi 2007-11-16 04:41:35 UTC
Created attachment 12591 [details] [review]
patch for this bug.
Comment 2 Michel Dänzer 2007-11-21 05:34:28 UTC
Thanks for the patch.

> -		src += hpass * srcPitch;
> -		dptr += hpass * bufPitch;
> +		src += srcPitch;
> +		buf += bufPitch;

Looks like this is the essential fix? It shouldn't be necessary to add the buf variable though.


> -	      dptr[0]=((sptr[0])<<24)|((sptr[1])<<16)|(sptr[2]);
> +#if X_BYTE_ORDER == X_BIG_ENDIAN
> +	      dptr[0]=((sptr[0])<<16)|((sptr[1])<<8)|(sptr[2]);
> +#else
> +	      dptr[0]=((sptr[2])<<16)|((sptr[1])<<8)|(sptr[0]);
> +#endif

Are you sure these changes are correct for both byte orders? Is your system big or little endian?
Comment 3 Kusanagi Kouichi 2007-11-22 00:27:24 UTC
> Looks like this is the essential fix? It shouldn't be necessary to add the buf
> variable though.

To add buf is necessary. I confirmed it.


> Are you sure these changes are correct for both byte orders? Is your system big
> or little endian?

I'm not sure that this is correct for big endian.
My system is little endian.
Comment 4 Michel Dänzer 2007-11-22 04:01:49 UTC
(In reply to comment #3)
> To add buf is necessary. I confirmed it.

Something like

		dptr += bufPitch / 4;

should do, doesn't it?


> I'm not sure that this is correct for big endian.
> My system is little endian.

I doubt the byte order of a 3-byte format depends on endianness directly. Do you have a testcase I can try?
Comment 5 Kusanagi Kouichi 2007-11-22 22:11:49 UTC
Created attachment 12693 [details] [review]
patch take 2

Is this better than previous one?
Comment 6 Kusanagi Kouichi 2007-11-22 22:14:39 UTC
Created attachment 12694 [details]
testcase

> I doubt the byte order of a 3-byte format depends on endianness directly. Do
> you have a testcase I can try?

Testcase is attached. It should display red, green and blue on top, middle and bottom respectively.
Comment 7 Michel Dänzer 2007-11-23 01:24:56 UTC
Thanks for the new patch and the testcase. I'll fix it up (if necessary) on my PowerBook and push to Git when I get time.
Comment 8 Michel Dänzer 2007-12-02 08:30:23 UTC
Fixes pushed.

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.