[PATCH 4/4] glamor: Drop a bunch of glamor_priv == NULL checks.

Eric Anholt eric at anholt.net
Wed Jul 8 10:38:02 PDT 2015


Michel Dänzer <michel at daenzer.net> writes:

> On 08.07.2015 09:26, Eric Anholt wrote:
>> 
>> diff --git a/glamor/glamor_utils.h b/glamor/glamor_utils.h
>> index 0a7de82..a923b7a 100644
>> --- a/glamor/glamor_utils.h
>> +++ b/glamor/glamor_utils.h
>> @@ -756,8 +756,8 @@ glamor_translate_boxes(BoxPtr boxes, int nbox, int dx, int dy)
>>  						|| _depth_ == 30	\
>>  						|| _depth_ == 32)
>>  
>> -#define GLAMOR_PIXMAP_PRIV_IS_PICTURE(pixmap_priv) (pixmap_priv && pixmap_priv->is_picture == 1)
>> -#define GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)    (pixmap_priv && pixmap_priv->gl_fbo == GLAMOR_FBO_NORMAL)
>> +#define GLAMOR_PIXMAP_PRIV_IS_PICTURE(pixmap_priv) (pixmap_priv->is_picture == 1)
>> +#define GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)    (pixmap_priv->gl_fbo == GLAMOR_FBO_NORMAL)
>
> I guess these macros could be removed now, but that's for later.
>
> The series is
>
> Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>

Thanks!

The get_pixmap_priv_from_fd() function isn't attribute-const, so we want
to be using these macros instead of glamor_pixmap_has_fbo() generally,
since pixmap private lookups can't be CSEed.

We could expand the macros in the code, but before that I'm hoping to
get rid of the gl_fbo enum, too.  It feels like I'm close.
GLAMOR_PIXMAP_PRIV_IS_PICTURE is dead in another series that will arrive
soon.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20150708/f190ebe1/attachment.sig>


More information about the xorg-devel mailing list