[Mesa-dev] [PATCH 2/3] svga: add new svga_winsys_context::get_command_buffer_size()

Charmaine Lee charmainel at vmware.com
Mon Feb 29 21:52:07 UTC 2016


>From: Brian Paul <brianp at vmware.com>
>Sent: Monday, February 29, 2016 1:28 PM
>To: mesa-dev at lists.freedesktop.org
>Cc: Charmaine Lee
>Subject: [PATCH 2/3] svga: add new svga_winsys_context::get_command_buffer_size()

>To ask how large the current command buffer is.  Will be used for
>a new GALLIUM_HUD graph.
>---
> src/gallium/drivers/svga/svga_winsys.h    | 6 ++++++
> src/gallium/winsys/svga/drm/vmw_context.c | 8 ++++++++
> 2 files changed, 14 insertions(+)

>diff --git a/src/gallium/drivers/svga/svga_winsys.h b/src/gallium/drivers/svga/svga_winsys.h
>index 2238d18..7da2c4e 100644
>--- a/src/gallium/drivers/svga/svga_winsys.h
>+++ b/src/gallium/drivers/svga/svga_winsys.h
>@@ -109,6 +109,12 @@ struct svga_winsys_context
>              uint32_t nr_bytes, uint32_t nr_relocs );
>
>    /**
>+    * Returns current size of command buffer, in bytes.
>+    */
>+   unsigned
>+   (*get_command_buffer_size)(struct svga_winsys_context *swc);
>+
>+   /**
>     * Emit a relocation for a host surface.
>     *
>     * @param flags bitmask of SVGA_RELOC_* flags
>diff --git a/src/gallium/winsys/svga/drm/vmw_context.c b/src/gallium/winsys/svga/drm/vmw_context.c
>index dae121e..3944733 100644
>--- a/src/gallium/winsys/svga/drm/vmw_context.c
>+++ b/src/gallium/winsys/svga/drm/vmw_context.c
>@@ -315,6 +315,13 @@ vmw_swc_reserve(struct svga_winsys_context *swc,
>    return vswc->command.buffer + vswc->command.used;
> }
>
>+static unsigned
>+vmw_wddm_swc_get_command_buffer_size(struct svga_winsys_context *swc)
>+{
>+   const struct vmw_svga_winsys_context *vswc = vmw_svga_winsys_context(swc);
>+   return vswc->command.used;
>+}
>+
> static void
> vmw_swc_context_relocation(struct svga_winsys_context *swc,
>                           uint32 *cid)
>@@ -761,6 +768,7 @@ vmw_svga_winsys_context_create(struct svga_winsys_screen *sws)
>
>    vswc->base.destroy = vmw_swc_destroy;
>    vswc->base.reserve = vmw_swc_reserve;
>+   vswc->base.get_command_buffer_size = vmw_wddm_swc_get_command_buffer_size;
>    vswc->base.surface_relocation = vmw_swc_surface_relocation;
>    vswc->base.region_relocation = vmw_swc_region_relocation;
>    vswc->base.mob_relocation = vmw_swc_mob_relocation;
>--
>1.9.1

Rename vmw_wddm_swc_get_command_buffer_size to vmw_swc_get_command_buffer_size.
Other than that, the series looks fine to me.

Reviewed-by: Charmaine Lee <charmainel at vmware.com>



More information about the mesa-dev mailing list