From: Alyssa Rosenzweig Date: Mon, 15 Jun 2020 13:20:39 +0000 (-0400) Subject: panfrost: Merge bifrost_bo/midgard_bo X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=32b171d6698893febc95f9a596bfd059158fe92d;p=mesa.git panfrost: Merge bifrost_bo/midgard_bo The content is difference but a BO is a BO. Let's reduce code repition between Midgard and Bifrost paths. Signed-off-by: Alyssa Rosenzweig Tested-by: Christian Hewitt Part-of: --- diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 8a8ba10e3a3..5a7658a910f 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -1375,11 +1375,11 @@ panfrost_get_tex_desc(struct panfrost_batch *batch, PAN_BO_ACCESS_SHARED | PAN_BO_ACCESS_READ | panfrost_bo_access_for_stage(st)); - panfrost_batch_add_bo(batch, view->midgard_bo, + panfrost_batch_add_bo(batch, view->bo, PAN_BO_ACCESS_SHARED | PAN_BO_ACCESS_READ | panfrost_bo_access_for_stage(st)); - return view->midgard_bo->gpu; + return view->bo->gpu; } static void @@ -1388,7 +1388,7 @@ panfrost_update_sampler_view(struct panfrost_sampler_view *view, { struct panfrost_resource *rsrc = pan_resource(view->base.texture); if (view->layout != rsrc->layout) { - panfrost_bo_unreference(view->midgard_bo); + panfrost_bo_unreference(view->bo); panfrost_create_sampler_view_bo(view, pctx, &rsrc->base); } } @@ -1421,7 +1421,7 @@ panfrost_emit_texture_descriptors(struct panfrost_batch *batch, PAN_BO_ACCESS_SHARED | PAN_BO_ACCESS_READ | panfrost_bo_access_for_stage(stage)); - panfrost_batch_add_bo(batch, view->bifrost_bo, + panfrost_batch_add_bo(batch, view->bo, PAN_BO_ACCESS_SHARED | PAN_BO_ACCESS_READ | panfrost_bo_access_for_stage(stage)); diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 436fae30577..fbbe6385972 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -954,7 +954,7 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so, so->base.u.tex.last_layer, type, prsrc->layout); - so->bifrost_bo = pan_bo_create(device, size, 0); + so->bo = pan_bo_create(device, size, 0); so->bifrost_descriptor = rzalloc(pctx, struct bifrost_texture_descriptor); panfrost_new_texture_bifrost( @@ -971,7 +971,7 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so, panfrost_translate_swizzle_4(composed_swizzle), prsrc->bo->gpu, prsrc->slices, - so->bifrost_bo); + so->bo); } else { unsigned size = panfrost_estimate_texture_payload_size( so->base.u.tex.first_level, @@ -981,10 +981,10 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so, type, prsrc->layout); size += sizeof(struct mali_texture_descriptor); - so->midgard_bo = pan_bo_create(device, size, 0); + so->bo = pan_bo_create(device, size, 0); panfrost_new_texture( - so->midgard_bo->cpu, + so->bo->cpu, texture->width0, texture->height0, texture->depth0, array_size, so->base.format, @@ -1055,8 +1055,7 @@ panfrost_sampler_view_destroy( struct panfrost_sampler_view *view = (struct panfrost_sampler_view *) pview; pipe_resource_reference(&pview->texture, NULL); - panfrost_bo_unreference(view->midgard_bo); - panfrost_bo_unreference(view->bifrost_bo); + panfrost_bo_unreference(view->bo); if (view->bifrost_descriptor) ralloc_free(view->bifrost_descriptor); ralloc_free(view); diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h index 30642964890..9a69b0eb549 100644 --- a/src/gallium/drivers/panfrost/pan_context.h +++ b/src/gallium/drivers/panfrost/pan_context.h @@ -263,8 +263,7 @@ struct panfrost_sampler_state { struct panfrost_sampler_view { struct pipe_sampler_view base; - struct panfrost_bo *midgard_bo; - struct panfrost_bo *bifrost_bo; + struct panfrost_bo *bo; struct bifrost_texture_descriptor *bifrost_descriptor; enum mali_texture_layout layout; };