[fbdev_backend] initialization of the first frame buffer

Marc Chalain marc.chalain at gmail.com
Tue Jun 11 05:35:05 PDT 2013


[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.

---
 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;
+    }
     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;
-- 
1.7.9.5



2013/6/10 Marc Chalain <marc.chalain at gmail.com>

> Ok I will try to write a better commit message.
> But for frame buffer understanding, the buffer is often allowed for a
> screen with the double of height as showed. Then is possible to set the
> buffer with two screens, one above the other. After we switch the display
> from the first middle buffer to the next one with "yoffset" and the
> FIBIOPAN_DISPLAY. Normally it's used to have double buffering and improve
> the number of frames per second (double buffering).
> But the problem is that yoffset is not always configured to 0 at the
> startup and we have to set it.
>
> I plan to add double buffering but in few days.
> Marc.
>
> PS: I have to support SurfaceFlinger (Android) as wayland client. It's the
> reason of my work. But I can stay a long time on my weston patches...
>
>
>
> 2013/6/10 Pekka Paalanen <ppaalanen at gmail.com>
>
>> On Fri, 7 Jun 2013 17:20:23 +0200
>> Marc Chalain <marc.chalain at gmail.com> wrote:
>>
>> > From 6553ed3ad9845113f3b2280e6fc94e2b326a7eca Mon Sep 17 00:00:00 2001
>> > From: mchalain <marc.chalain at gmail.com>
>> > Date: Fri, 7 Jun 2013 17:18:23 +0200
>> > Subject: [PATCH 2/2] [fbdev_backend] initialization of the first frame
>> > buffer
>> >
>> > ---
>> >  src/compositor-fbdev.c |    8 +++++++-
>> >  1 file changed, 7 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c
>> > index d6d911a..e6c761f 100644
>> > --- a/src/compositor-fbdev.c
>> > +++ b/src/compositor-fbdev.c
>> > @@ -277,7 +277,7 @@ calculate_pixman_format(struct fb_var_screeninfo
>> *vinfo,
>> >      if (finfo->visual == FB_VISUAL_DIRECTCOLOR)
>> >          build_cmap(vinfo, cmap);
>> >      else
>> > -     /* We only handle true-colour frame buffers at the moment. */
>> > +    /* We only handle true-colour frame buffers at the moment. */
>> >      if (finfo->visual != FB_VISUAL_TRUECOLOR || vinfo->grayscale != 0)
>> >          return 0;
>> >
>> > @@ -373,6 +373,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;
>> > +    }
>> >      return 1;
>> >  }
>> >
>> > @@ -409,6 +414,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;
>>
>> Hi Marc,
>>
>> I admit I am not familiar with the fbdev interface, but this patch is
>> missing a commit message. I have no clue what is going on here, and I
>> could not understand the note for this patch in the previous email.
>>
>> If you don't know what to write in a commit message, the following two
>> links give a good idea:
>>
>> https://wiki.openstack.org/wiki/GitCommitMessages#Information_in_commit_messages
>> http://who-t.blogspot.de/2009/12/on-commit-messages.html
>>
>> The same comment about a missing commit message applies to your
>> latest "DIRECTCOLOR" patch, too.
>>
>>
>> Thanks,
>> pq
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20130611/3e182238/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-compositor-fbdev-set-the-yoffset-value-to-0.patch
Type: application/octet-stream
Size: 1291 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20130611/3e182238/attachment.obj>


More information about the wayland-devel mailing list