Re: [PATCH 10/12] Add glamor back into the driver

Keith Packard
2014-07-31T06:23:05Z

[-- Attachment #1.1: Type: text/plain, Size: 2845 bytes --]

Eric Anholt <eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org> writes:

> Keith Packard <keithp-aN4HjG94KOLQT0dZR+AlfA@public.gmane.org> writes:
>
>> This adds glamor support back into the driver, but instad of going
>> through UXA, this uses it directly instead.
>
> This is hard to read with the conditionalizing all of the UXA code in
> the same commit as adding the glamor code. Then there are a bunch of
> unrelated whitespace changes, or flattening of a bunch of nested
> conditionals.

I'm not sure how to make the patch easier to review; I guess I could
make UXA conditional first? That would be 'crazy' in that the driver
would fail to ever work if you didn't ask for UXA, but might make the
patch easier to read?

> The only substantive problem I see is intel_glamor_set_pixmap_bo().

> The extra enum and temporary variable introduced here seems pretty
> pointless (even if that pattern had happened before).

Agreed. The problem is that 'DEFAULT_ACCEL_METHOD' is defined as
'GLAMOR', 'UXA' or 'NONE' by configure.ac. This seemed like the cleanest
solution in some ways. I also liked having the accel_type enum *not*
define acceleration types which weren't compiled into the driver; that
caught a few missing #ifdefs

> I don't think this will work -- glamor_egl uses a different fd from
> intel->bufmgr, so you're attaching some unrelated BO, if you're even
> that lucky.

This API uses the same FD as the intel bufmgr.

From intel_glamor.c:

if (!glamor_egl_init(scrn, intel->drmSubFD)) {

From glamor_egl.c:

Bool
glamor_egl_init(ScrnInfoPtr scrn, int fd)
...

glamor_egl->fd = fd;
...
glamor_egl->has_gem = glamor_egl_check_has_gem(fd);

...
Bool
glamor_egl_create_textured_pixmap(PixmapPtr pixmap, int handle, int stride)
...
if (glamor_egl->has_gem) {
if (!glamor_get_flink_name(glamor_egl->fd, handle, &name)) {

So, you pass in a GEM handle for the intel driver bufmgr and glamor
does the flink to get a global name.

We should be using an FD passing mechanism here instead, to avoid
creating more global names...

> No need to check for initiailization -- double-calling it is safe (as
> long as the size is consistent).

Thanks. Will fix.

>> void
>> @@ -258,18 +240,52 @@ intel_glamor_flush(intel_screen_private * intel)
>> ScreenPtr screen;
>>
>> screen = xf86ScrnToScreen(intel->scrn);
>> - if (intel->uxa_flags & UXA_USE_GLAMOR)
>> - glamor_block_handler(screen);
>> + glamor_block_handler(screen);
>> }
>
> glamor_block_handler() is pretty awfully named. We should do something
> about that.

Suggestions welcome :-)

Thanks for the careful review.

--
keith.packard-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org

[-- Attachment #1.2: Type: application/pgp-signature, Size: 810 bytes --]

[-- Attachment #2: Type: text/plain, Size: 219 bytes --]

_______________________________________________
xorg-devel-go0+a7rfsptAfugRpC6u6w@public.gmane.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel