[Mesa-dev] [PATCH 1/3] virgl: move bind-flags to virgl_winsys.h

Gert Wollny gert.wollny at collabora.com
Mon Jul 16 11:34:59 UTC 2018


Am Montag, den 16.07.2018, 12:23 +0200 schrieb Erik Faye-Lund:
> virglrenderer's virgl_hw.h doesn't contain these, and it's the
> virgl winsys that cares about these, so let's move them there.
> 
> This reduces the diff between the two different versions of
> virgl_hw.h, and should make it easier to upgrade the file in
> the future.
> 
> Signed-off-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
> ---
>  src/gallium/drivers/virgl/virgl_hw.h       | 12 ------------
>  src/gallium/drivers/virgl/virgl_resource.h |  2 ++
>  src/gallium/drivers/virgl/virgl_winsys.h   | 12 ++++++++++++
>  3 files changed, 14 insertions(+), 12 deletions(-)
> 
> diff --git a/src/gallium/drivers/virgl/virgl_hw.h
> b/src/gallium/drivers/virgl/virgl_hw.h
> index 157267558a..d0df23e2f6 100644
> --- a/src/gallium/drivers/virgl/virgl_hw.h
> +++ b/src/gallium/drivers/virgl/virgl_hw.h
> @@ -202,18 +202,6 @@ enum virgl_formats {
>  #define VIRGL_CAP_TGSI_INVARIANT       (1 << 0)
>  #define VIRGL_CAP_TEXTURE_VIEW         (1 << 1)
>  
> -#define VIRGL_BIND_DEPTH_STENCIL (1 << 0)
> -#define VIRGL_BIND_RENDER_TARGET (1 << 1)
> -#define VIRGL_BIND_SAMPLER_VIEW  (1 << 3)
> -#define VIRGL_BIND_VERTEX_BUFFER (1 << 4)
> -#define VIRGL_BIND_INDEX_BUFFER  (1 << 5)
> -#define VIRGL_BIND_CONSTANT_BUFFER (1 << 6)
> -#define VIRGL_BIND_DISPLAY_TARGET (1 << 7)
> -#define VIRGL_BIND_STREAM_OUTPUT (1 << 11)
> -#define VIRGL_BIND_CURSOR        (1 << 16)
> -#define VIRGL_BIND_CUSTOM        (1 << 17)
> -#define VIRGL_BIND_SCANOUT       (1 << 18)
> -

In virglrenderer there is a set of VREND_RES_* that are mostly the
same, so I assume that they should be in sync (I wouldn't bet on it
though). If it can be resolved that these two sets are independent of
each other then the patch is 
  Reviewed-By: Gert Wollny <gert.wollny at collabora.com>

Otherwise it might be better to move the VREND_RES_* defines into
virgl_hw.h in virglrenderer and rename so that at one point the two
virgl_hw.h files will have the same content.

>  struct virgl_caps_bool_set1 {
>          unsigned indep_blend_enable:1;
>          unsigned indep_blend_func:1;
> diff --git a/src/gallium/drivers/virgl/virgl_resource.h
> b/src/gallium/drivers/virgl/virgl_resource.h
> index bab9bcb9b4..d9ad4733b4 100644
> --- a/src/gallium/drivers/virgl/virgl_resource.h
> +++ b/src/gallium/drivers/virgl/virgl_resource.h
> @@ -30,6 +30,8 @@
>  #include "util/u_transfer.h"
>  
>  #include "virgl_hw.h"
> +#include "virgl_winsys.h"
> +
>  #define VR_MAX_TEXTURE_2D_LEVELS 15
>  
>  struct winsys_handle;
> diff --git a/src/gallium/drivers/virgl/virgl_winsys.h
> b/src/gallium/drivers/virgl/virgl_winsys.h
> index 99ab4d3840..acd68c060e 100644
> --- a/src/gallium/drivers/virgl/virgl_winsys.h
> +++ b/src/gallium/drivers/virgl/virgl_winsys.h
> @@ -42,6 +42,18 @@ struct virgl_cmd_buf {
>     uint32_t *buf;
>  };
>  
> +#define VIRGL_BIND_DEPTH_STENCIL (1 << 0)
> +#define VIRGL_BIND_RENDER_TARGET (1 << 1)
> +#define VIRGL_BIND_SAMPLER_VIEW  (1 << 3)
> +#define VIRGL_BIND_VERTEX_BUFFER (1 << 4)
> +#define VIRGL_BIND_INDEX_BUFFER  (1 << 5)
> +#define VIRGL_BIND_CONSTANT_BUFFER (1 << 6)
> +#define VIRGL_BIND_DISPLAY_TARGET (1 << 7)
> +#define VIRGL_BIND_STREAM_OUTPUT (1 << 11)
> +#define VIRGL_BIND_CURSOR        (1 << 16)
> +#define VIRGL_BIND_CUSTOM        (1 << 17)
> +#define VIRGL_BIND_SCANOUT       (1 << 18)
> +
>  struct virgl_winsys {
>     unsigned pci_id;
>  


More information about the mesa-dev mailing list