[Mesa-dev] [PATCH 6/8] i965: Drop some duplicated code in DRI winsys BO updates.

Eric Anholt eric at anholt.net
Tue Feb 18 09:54:29 PST 2014


Kenneth Graunke <kenneth at whitecape.org> writes:

> On 02/14/2014 03:00 PM, Eric Anholt wrote:
> [snip]
>> @@ -666,78 +667,6 @@ intel_miptree_create_for_bo(struct brw_context *brw,
>>     return mt;
>>  }
>>  
>> -
>> -/**
>> - * For a singlesample DRI2 buffer, this simply wraps the given region with a miptree.
>> - *
>> - * For a multisample DRI2 buffer, this wraps the given region with
>> - * a singlesample miptree, then creates a multisample miptree into which the
>> - * singlesample miptree is embedded as a child.
>> - */
>> -struct intel_mipmap_tree*
>> -intel_miptree_create_for_dri2_buffer(struct brw_context *brw,
>> -                                     unsigned dri_attachment,
>> -                                     mesa_format format,
>> -                                     uint32_t num_samples,
>> -                                     struct intel_region *region)
>> -{
>> -   struct intel_mipmap_tree *singlesample_mt = NULL;
>> -   struct intel_mipmap_tree *multisample_mt = NULL;
>> -
>> -   /* Only the front and back buffers, which are color buffers, are shared
>> -    * through DRI2.
>> -    */
>> -   assert(dri_attachment == __DRI_BUFFER_BACK_LEFT ||
>> -          dri_attachment == __DRI_BUFFER_FRONT_LEFT ||
>> -          dri_attachment == __DRI_BUFFER_FAKE_FRONT_LEFT);
>> -   assert(_mesa_get_format_base_format(format) == GL_RGB ||
>> -          _mesa_get_format_base_format(format) == GL_RGBA);
>> -
>> -   singlesample_mt = intel_miptree_create_for_bo(brw,
>> -                                                 region->bo,
>> -                                                 format,
>> -                                                 0,
>> -                                                 region->width,
>> -                                                 region->height,
>> -                                                 region->pitch,
>> -                                                 region->tiling);
>> -   if (!singlesample_mt)
>> -      return NULL;
>> -   singlesample_mt->region->name = region->name;
>
> The singlesample_mt->region->name = region->name line is missing from
> the new code.  I doubt it actually matters, but figured I'd point it out
> in case it wasn't intentional.

It wasn't intentional, and it would have broken the optimization in
intel_process_dri2_buffer().  Thanks!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140218/d22b83c6/attachment.pgp>


More information about the mesa-dev mailing list