[fbdev_backend] initialization of the first frame buffer

Pekka Paalanen ppaalanen at gmail.com
Tue Jun 11 06:37:05 PDT 2013


On Tue, 11 Jun 2013 14:35:05 +0200
Marc Chalain <marc.chalain at gmail.com> wrote:

> [PATCH] [compositor-fbdev]: set the yoffset value to 0
> The memory  buffer could be twice larger than the screen size to use
> double buffering.
> The application writes alternatively inside each middle of the memory.
> The 'yoffset' field of varinfo, is used to switch from a  memory part to
> the other.
> The value is not always initialized to 0.

Ok, now it is at least explained.

Your commit title should be something like:
fbdev: ensure yoffset is zero

instead of "[fbdev_backend] initialization of the first frame buffer",
just FYI.

> 
> ---
>  src/compositor-fbdev.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c
> index 9c3d17e..91d0623 100644
> --- a/src/compositor-fbdev.c
> +++ b/src/compositor-fbdev.c
> @@ -330,6 +330,11 @@ fbdev_query_screen_info(struct fbdev_output *output,
> int fd,
>          return -1;
>      }
> 
> +    if (varinfo.yoffset != 0) {
> +        varinfo.yoffset    = 0;
> +        if (ioctl(fd, FBIOPAN_DISPLAY, &varinfo) < 0)
> +            return -1;
> +    }

This is still a strange place to set it. A query function is not
expected to set, but I guess it will do since fbdev_set_screen_info()
is not called at startup I think.

>      return 1;
>  }
> 
> @@ -366,6 +371,7 @@ fbdev_set_screen_info(struct fbdev_output *output, int
> fd,
>      varinfo.blue.length = 8;
>      varinfo.blue.msb_right = 0;
> 
> +    varinfo.yoffset = 0;
>      /* Set the device's screen information. */
>      if (ioctl(fd, FBIOPUT_VSCREENINFO, &varinfo) < 0) {
>          return -1;

Thanks,
pq


More information about the wayland-devel mailing list