[Intel-gfx] [patch] Fix XV scan line calculation when rotated

Łukasz Kuryło lukasz.kurylo at gmail.com
Fri Jun 19 15:18:56 CEST 2009


> > Or maybe after transformation to crtc coordinates, crtc->y is unnecesary?
> We need someone that knows what crtc->y is used for to comment.
> Then fixing the code to match will be simple.
> 
> Barry

I've updated my odg drawing. I'm thinking this should be good approach:

box_in_crtc_coordinates = *box;
if (crtc->transform_in_use)
	pixman_f_transform_bounds (&crtc->f_framebuffer_to_crtc, &box_in_crtc_coordinates);
y1 = (box_in_crtc_coordinates.y1 <= 0) ? 0 : box_in_crtc_coordinates.y1;
y2 = (box_in_crtc_coordinates.y2 <= crtc_last_scanline) ? box_in_crtc_coordinates.y2 : crtc_last_scanline;

My assumption here is that after transformation to crtc space all coordinates of the box are relative to "upper left" corner of given crtc (if rotated 180 than it's lower right corner, etc.) anyway relative to first scanline. 
With this assumption box_in_crtc_coordinates.y1 can be negative. All thats left is that we need to now how many scanlines crt has. In normal case thats crtcbox.y2 - crtcbox.y1. 
But when rotation is added we need to calculate that in other way. Or maybe that information is available somewhere without calculation?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20090619/e6ddc76b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ctrcScanlines.odg
Type: application/vnd.oasis.opendocument.graphics
Size: 16804 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20090619/e6ddc76b/attachment.odg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20090619/e6ddc76b/attachment.sig>


More information about the Intel-gfx mailing list