From: Kai J. <b1...@fr...> - 2009-07-06 02:54:58
|
We can't suppose that all the user operating this x/yoffset will check it. If the user application transfer a negative x/yoffset into the fb driver, I suppose fb driver should do operation correctly. So here, I think checking x/yoffset to insure the virtual space not moving outside real screen is necessary. > On Tue, Jun 30, 2009 at 11:25:52AM +0800, Kai Jiang wrote: > >> xres,yres,xres_virtual,yres_virtual will be set in the display driver, they have actual value which match the screen(will not very huge). >> >> And here, these lines are not checking the overflowing, but checking whether the virtual space display is beyond the real screen. >> >> Take x boundary for example:(the screen x and virtual x relationship should be:) >> xres+xoffset<xres_vritual && xoffset>0 >> This insure that, in the real screen, there are virtual picture display in the screen. When we move the virtual picture to the left, the xoffset will be smaller and smaller >> to indicate the virtual picture is moving to the left. Finally, the xoffset will be zero when the screen left boundary and virtual picture left boundary overlap. When virtual display is still moving to the left, the xoffset will be negative. And what should be displayed in the gap between screen left boundary and virtual space left boundary? >> > > If you're storing negative values into xoffset/yoffset your application > is buggy. Just fix it. > > >> So here we have to check the whether the x/yoffset is smaller than zero. If the offset is smaller than zero, in the driver, we should not move the virtual screen any more. >> > > Checking for overflow will catch you buggy application's negative > values too. > > |