[waffle] [RFC] Add display support to GBM backend
Chad Versace
chad.versace at intel.com
Tue Dec 16 18:00:23 PST 2014
On 12/12/2014 12:21 PM, Frank Henigman wrote:
> On Wed, Nov 19, 2014 at 2:38 PM, Chad Versace <chad.versace at intel.com> wrote:
>>> +bool
>>> +wgbm_window_swap_buffers(struct wcore_window *wc_self)
>>> +{
>>> + //XXX detect driver before invoking driver-specific code -
>>> gbm_device_get_backend_name() doesn't help, it returns "drm"
>>> +
>>> + if (!wegl_window_swap_buffers(wc_self))
>>> + return false;
>>> +
>>> + //XXX display or window config, not env var
>>> + // O:original, possibly buggy behavior (no lock/release), F:flip,
>>> C:copy
>>> + // otherwise: no display (but still lock/release)
>>
>>
>> Regarding MODE="O", Waffle now does lock/release for
>> wgbm_window_swap_buffers.
>> Let's make MODE="O" be equivalent to MODE="", which selects the default
>> behavior:
>> lock/release but don't post to display.
>>
>> Of course, we need better names than "O", "F", and "C". Assuming that we
>> associate these attributes with window and not the display (which might be
>> a bad assumption), how do these names sound to you?
>>
>> name: WAFFLE_GBM_WINDOW_DISPLAY_MODE
>> values:
>> WAFFLE_GBM_WINDOW_DISPLAY_NONE (default)
>> WAFFLE_GBM_WINDOW_DISPLAY_FLIP
>> WAFFLE_GBM_WINDOW_DISPLAY_COPY
>>
>> Question: Why do you want COPY mode? Is the purpose to exercise the
>> implementation pattern of Chrome's partial display update?
>
> Unless I'm mistaken it's the only way (on i915 at least) to have a
> window smaller than full screen. FLIP will scan out of the same
> buffers we render into, and it looks like i915 requires the scan out
> buffer to be >= the mode size. In COPY mode you can have any size
> render buffer and it gets copied (and clipped to) the scan out buffer.
> Maybe this doesn't need to be a user-settable option.
Ok. That makes sense.
> I've assumed double buffering, is that ok? It looks like waffle
> doesn't have a way to request single buffering.
In Waffle, double-buffer is the default. Double vs single buffering is controlled
with the WAFFLE_DOUBLE_BUFFERED attribute passed to waffle_config_choose().
>> Question: Do you think these display-mode attributes should be associated
>> with
>> the waffle_display or waffle_window? I'm leaning towards the window, because
>> I see no reason to prevent distinct windows from having distinct
>> display-modes.
>
> It's not obvious what should happen if there are multiple FLIP and
> COPY windows. Maybe another reason to leave out this setting. On the
> topic of multiple windows we might someday want to control position,
> size, stacking... though I'm in no hurry to implement an entire window
> system.
> If we do leave out WAFFLE_GBM_WINDOW_DISPLAY_MODE then I guess
> waffle_window_show() determines whether or not a window is displayed?
Hmmm... I'm unsure what the best solution is here. Of course, we don't
want to implement a full window system API. But I also don't think
waffle_window_show() should show the GBM window by default. That would
break common Piglit use cases. Piglit users often run with Waffle's
GBM backend, using rendernodes, and expect the Piglit run to not clobber
the current X session in which they're doing their development.
So, I think we still need some option similar to WAFFLE_GBM_DISPLAY_MODE.
But I don't know if it should allow the granularity of specifying COPY
vs FLIP. Possibly we could initially define two display modes,
WAFFLE_GBM_DISPLAY_MODE_OFF and WAFFLE_GBM_DISPLAY_MODE_AUTO, and
later add COPY and FLIP if we feel it's necessary.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 884 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/waffle/attachments/20141216/e0357b2c/attachment.sig>
More information about the waffle
mailing list