[Mesa-dev] [PATCH 2/7] i965: Remove the create_raw_surface vtbl hook.
Kristian Høgsberg
krh at bitplanet.net
Fri Feb 27 08:54:45 PST 2015
On Sat, Jan 17, 2015 at 3:04 PM, Francisco Jerez <currojerez at riseup.net> wrote:
> It's a wrapper around emit_buffer_surface_state with format=RAW, pitch=1,
> rw=true and the remaining arguments ordered differently. There's no point in
> having a separate vtbl pointer for that.
Yeah, I agree, that can go.
Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>
> ---
> src/mesa/drivers/dri/i965/brw_binding_tables.c | 8 +++++---
> src/mesa/drivers/dri/i965/brw_context.h | 6 ------
> src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 6 +++---
> src/mesa/drivers/dri/i965/gen7_wm_surface_state.c | 19 -------------------
> src/mesa/drivers/dri/i965/gen8_surface_state.c | 16 ----------------
> 5 files changed, 8 insertions(+), 47 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_binding_tables.c b/src/mesa/drivers/dri/i965/brw_binding_tables.c
> index ea82e71..08e4191 100644
> --- a/src/mesa/drivers/dri/i965/brw_binding_tables.c
> +++ b/src/mesa/drivers/dri/i965/brw_binding_tables.c
> @@ -68,9 +68,11 @@ brw_upload_binding_table(struct brw_context *brw,
> } else {
> /* Upload a new binding table. */
> if (INTEL_DEBUG & DEBUG_SHADER_TIME) {
> - brw->vtbl.create_raw_surface(
> - brw, brw->shader_time.bo, 0, brw->shader_time.bo->size,
> - &stage_state->surf_offset[prog_data->binding_table.shader_time_start], true);
> + brw->vtbl.emit_buffer_surface_state(
> + brw, &stage_state->surf_offset[
> + prog_data->binding_table.shader_time_start],
> + brw->shader_time.bo, 0, BRW_SURFACEFORMAT_RAW,
> + brw->shader_time.bo->size, 1, true);
> }
>
> uint32_t *bind = brw_state_batch(brw, AUB_TRACE_BINDING_TABLE,
> diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
> index 6195d3d..d21e175 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.h
> +++ b/src/mesa/drivers/dri/i965/brw_context.h
> @@ -962,12 +962,6 @@ struct brw_context
> void (*update_null_renderbuffer_surface)(struct brw_context *brw,
> unsigned unit);
>
> - void (*create_raw_surface)(struct brw_context *brw,
> - drm_intel_bo *bo,
> - uint32_t offset,
> - uint32_t size,
> - uint32_t *out_offset,
> - bool rw);
> void (*emit_buffer_surface_state)(struct brw_context *brw,
> uint32_t *out_offset,
> drm_intel_bo *bo,
> diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> index ece352b..e5f2058 100644
> --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> @@ -920,9 +920,9 @@ brw_upload_abo_surfaces(struct brw_context *brw,
> drm_intel_bo *bo = intel_bufferobj_buffer(
> brw, intel_bo, binding->Offset, intel_bo->Base.Size - binding->Offset);
>
> - brw->vtbl.create_raw_surface(brw, bo, binding->Offset,
> - bo->size - binding->Offset,
> - &surf_offsets[i], true);
> + brw->vtbl.emit_buffer_surface_state(brw, &surf_offsets[i], bo,
> + binding->Offset, BRW_SURFACEFORMAT_RAW,
> + bo->size - binding->Offset, 1, true);
> }
>
> if (prog->NumAtomicBuffers)
> diff --git a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
> index 24547d9..1421ac4 100644
> --- a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
> +++ b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
> @@ -370,24 +370,6 @@ gen7_update_texture_surface(struct gl_context *ctx,
> }
>
> /**
> - * Create a raw surface for untyped R/W access.
> - */
> -static void
> -gen7_create_raw_surface(struct brw_context *brw, drm_intel_bo *bo,
> - uint32_t offset, uint32_t size,
> - uint32_t *out_offset, bool rw)
> -{
> - gen7_emit_buffer_surface_state(brw,
> - out_offset,
> - bo,
> - offset,
> - BRW_SURFACEFORMAT_RAW,
> - size,
> - 1,
> - true /* rw */);
> -}
> -
> -/**
> * Creates a null renderbuffer surface.
> *
> * This is used when the shader doesn't write to any color output. An FB
> @@ -563,6 +545,5 @@ gen7_init_vtable_surface_functions(struct brw_context *brw)
> brw->vtbl.update_renderbuffer_surface = gen7_update_renderbuffer_surface;
> brw->vtbl.update_null_renderbuffer_surface =
> gen7_update_null_renderbuffer_surface;
> - brw->vtbl.create_raw_surface = gen7_create_raw_surface;
> brw->vtbl.emit_buffer_surface_state = gen7_emit_buffer_surface_state;
> }
> diff --git a/src/mesa/drivers/dri/i965/gen8_surface_state.c b/src/mesa/drivers/dri/i965/gen8_surface_state.c
> index 8d4e180..9ddbbad 100644
> --- a/src/mesa/drivers/dri/i965/gen8_surface_state.c
> +++ b/src/mesa/drivers/dri/i965/gen8_surface_state.c
> @@ -274,21 +274,6 @@ gen8_update_texture_surface(struct gl_context *ctx,
> I915_GEM_DOMAIN_SAMPLER, 0);
> }
>
> -static void
> -gen8_create_raw_surface(struct brw_context *brw, drm_intel_bo *bo,
> - uint32_t offset, uint32_t size,
> - uint32_t *out_offset, bool rw)
> -{
> - gen8_emit_buffer_surface_state(brw,
> - out_offset,
> - bo,
> - offset,
> - BRW_SURFACEFORMAT_RAW,
> - size,
> - 1,
> - true /* rw */);
> -}
> -
> /**
> * Creates a null renderbuffer surface.
> *
> @@ -460,6 +445,5 @@ gen8_init_vtable_surface_functions(struct brw_context *brw)
> brw->vtbl.update_renderbuffer_surface = gen8_update_renderbuffer_surface;
> brw->vtbl.update_null_renderbuffer_surface =
> gen8_update_null_renderbuffer_surface;
> - brw->vtbl.create_raw_surface = gen8_create_raw_surface;
> brw->vtbl.emit_buffer_surface_state = gen8_emit_buffer_surface_state;
> }
> --
> 2.1.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list