<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" content="1" /><style type="text/css">p, li { white-space: pre-wrap; }</style></head><body style=" font-family:'DejaVu Sans'; font-size:8pt; font-weight:400; font-style:normal;">On piątek 19 czerwca 2009 18:40:48 Barry Scott wrote:<br>
> Łukasz Kuryło wrote:<br>
> > > > Or maybe after transformation to crtc coordinates, crtc->y is <br>
> > unnecesary?<br>
> > > We need someone that knows what crtc->y is used for to comment.<br>
> > > Then fixing the code to match will be simple.<br>
> > ><br>
> > > Barry<br>
> ><br>
> ><br>
> > I've updated my odg drawing. I'm thinking this should be good approach:<br>
> ><br>
> ><br>
> > box_in_crtc_coordinates = *box;<br>
> > if (crtc->transform_in_use)<br>
> > pixman_f_transform_bounds (&crtc->f_framebuffer_to_crtc, <br>
> > &box_in_crtc_coordinates);<br>
> > y1 = (box_in_crtc_coordinates.y1 <= 0) ? 0 : box_in_crtc_coordinates.y1;<br>
> > y2 = (box_in_crtc_coordinates.y2 <= crtc_last_scanline) ? <br>
> > box_in_crtc_coordinates.y2 : crtc_last_scanline;<br>
> ><br>
> ><br>
> > My assumption here is that after transformation to crtc space all <br>
> > coordinates of the box are relative to "upper left" corner of given <br>
> > crtc (if rotated 180 than it's lower right corner, etc.) anyway <br>
> > relative to first scanline.<br>
> > With this assumption box_in_crtc_coordinates.y1 can be negative. All <br>
> > thats left is that we need to now how many scanlines crt has. In <br>
> > normal case thats crtcbox.y2 - crtcbox.y1.<br>
> > But when rotation is added we need to calculate that in other way. Or <br>
> > maybe that information is available somewhere without calculation?<br>
> That's good to know what the crtc-y is for.<br>
> I agree it should not be used at all as the transformation will bring <br>
> the box<br>
> into the valid range of lines for the crtc.<br>
It will NOT! pixman_f_transform_bounds does NOT clip box to selected crt area. It return smallest box <br>
My only assumption was that after transformation all coordinates are relative to crtc origin (first pixel of first scanline). But I'm not sure of that.<br>
I need to dig more in code to see what kind of tranformations are handled by crtc->f_framebuffer_to_crtc. <br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>> <br>
> I do not think you need to defense about y1 or y2 being out of range.<br>
Thats exactly what was necessary for me to work on dualhead configuration with dead space. On other configurations regions are probably already clipped to crt area.<br>
> The transformation must always give you valid line numbers. In which case:<br>
> <br>
> box_in_crtc_coordinates = *box;<br>
> if (crtc->transform_in_use)<br>
> pixman_f_transform_bounds (&crtc->f_framebuffer_to_crtc, <br>
> &box_in_crtc_coordinates);<br>
> y1 = box_in_crtc_coordinates.y1<br>
> y2 = box_in_crtc_coordinates.y2<br>
> <br>
> is all that is needed.<br>
> <br>
> If this is correct the patch to DRI2 did not need its defensive code either.<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>I don't agree as mentioned above.<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>> <br>
> Of course adding asserts would enforce this API contract on the <br>
> transformation.<br>
> <br>
> Barry<br>
> <br>
> <br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p></body></html>