[Mesa-dev] [PATCH 1/2] i965: Extract region use from hiz depth buffer

Chad Versace chad.versace at linux.intel.com
Thu Sep 26 11:16:52 PDT 2013


On 09/26/2013 10:37 AM, Chad Versace wrote:
> On 09/22/2013 10:37 AM, Ben Widawsky wrote:
>> Starting with Ivybridge, the hierarchical had relaxed requirements for
>                             ^^^^^^^^^^^^^^^
> "the hierarchical" doesn't make sense. Just call it "the HiZ buffer" or
> "the hiz buffer".
>
>> its allocation. Following a "simple" formula in the bspec was all you
>> needed to satisfy the requirement.
>>
>> To prepare the code for this, extract all places where the miptree was
>> used, when we really only needed the region. This allows an upcoming
>> patch to simply allocate the region, and not the whole miptree.
>  >
>> CC: Chad Versace <chad.versace at linux.intel.com>
>> Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
>> ---
>>   src/mesa/drivers/dri/i965/brw_misc_state.c    |  8 +++---
>>   src/mesa/drivers/dri/i965/gen6_blorp.cpp      |  2 +-
>>   src/mesa/drivers/dri/i965/gen7_blorp.cpp      |  2 +-
>>   src/mesa/drivers/dri/i965/gen7_misc_state.c   |  6 ++---
>>   src/mesa/drivers/dri/i965/intel_fbo.c         |  4 +--
>>   src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 35 +++++++++++++++------------
>>   src/mesa/drivers/dri/i965/intel_mipmap_tree.h |  5 +++-
>>   7 files changed, 34 insertions(+), 28 deletions(-)



>> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
>> index d718125..7473570 100644
>> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
>> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
>> @@ -414,7 +414,10 @@ struct intel_mipmap_tree
>>       * To determine if hiz is enabled, do not check this pointer. Instead, use
>>       * intel_miptree_slice_has_hiz().
>>       */
>> -   struct intel_mipmap_tree *hiz_mt;
>> +   struct {
>> +      struct intel_mipmap_tree *mt;
>> +      struct intel_region *region;
>> +   } hiz_depth_buffer;
>
> The name 'hiz_depth_buffer' has a redundancy, because the hiz buffer
> can accompany only a depth buffer. Let's shorten the name to
> 'hiz_buffer'.
>
> Also, you need to update the comment above this hunk to reflect the
> new data structure.

Ken reminded me of some ongoing plans we have in Mesa. We plan to kill intel_region
and replace it with... nothing. Instead of embedding an intel_region into
intel_mipmap_tree::hiz_buffer, we should embed a raw drm_intel_bo and its pitch.
That is,

   struct {
     struct intel_mipmap_tree *mt;
     drm_intel_bo *bo;
     uint32_t pitch;
   } hiz_buffer;




More information about the mesa-dev mailing list