Re: [RFC PATCH] video: Use fb_sys_write rather than open-coding in drivers
From: Tomi Valkeinen
Date: Wed Feb 12 2014 - 01:54:53 EST
On 11/02/14 21:07, Ryan Mallon wrote:
> On 12/02/14 03:06, Tomi Valkeinen wrote:
>
>> On 20/09/13 10:06, Ryan Mallon wrote:
>>> Several video drivers open code the fb_write write function with code
>>> which is very similar to fb_sys_write. Replace the open code versions
>>> with calls to fb_sys_write. An fb_sync callback is added to each of
>>> the drivers.
>>>
>>> Signed-off-by: Ryan Mallon <rmallon@xxxxxxxxx>
>>> ---
>>
>> Doesn't this change the behavior so that fb_write does no longer update
>> the display, but fb_sync does? I don't think fb_sync is even meant to
>> update the display, it's meant to wait for an update to finish. Then
>> again, I'm not sure about that, all I see in fb.h is "wait for blit
>> idle, optional"
>
>
> fb_write() in fbmem.c calls ->fb_sync() after ->fb_write(), and I've set
> the fb_sync() for each of the drivers, so the behaviour should be
> unchanged for writes.
>
> The fb_sync() function is also called by fb_read() and
> fb_get_buffer_offset() (if FB_PIXMAP_SYNC flag is set). I don't know if
> that will adversely affect behaviour.
Well, by just looking at the function names the drivers' fb_syncs call,
it sounds to me that with your patch fb_sync will update the LCD, i.e.
send data to it. Doing that in fb_read sounds totally wrong.
> Note that I haven't actually tested this code since I don't have any of
> the hardware. It was just something I noticed while digging through
> framebuffer driver code.
Ok. Well, I think it's safer to drop these, then, if it's not 100% clear
that there are no unwanted side effects.
Tomi
Attachment:
signature.asc
Description: OpenPGP digital signature