[Mesa-dev] [PATCH 4/8] intel: prepare for dri images having more than plane

Eric Anholt eric at anholt.net
Mon Apr 22 10:06:19 PDT 2013


"Pohjolainen, Topi" <topi.pohjolainen at intel.com> writes:

> On Tue, Apr 16, 2013 at 04:57:49PM -0700, Eric Anholt wrote:
>> Topi Pohjolainen <topi.pohjolainen at intel.com> writes:
>> > +      if (image->regions[i]->bo)
>> > +         intel_region_release(&image->regions[i]);
>> 
>> Why are you looking at the BO for deciding whether to free the region?
>> A region should always have a BO.  If you're trying to null-check the
>> region, intel_region_release already does that.
>
> As I switched to using a fixed sized array of regions (holding up-to-three
> planes), the images having one or two planes would have the rest of the regions
> initialized to zero. And I simply decided to use the 'bo'-pointer as telling if
> the region was in use or not.

The struct has an array of region pointers, and "there's no region"
should be region[i] == NULL, not region[i]->bo == NULL.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130422/34fed4a5/attachment.pgp>


More information about the mesa-dev mailing list