[Mesa-dev] [PATCH 1/5] st/dri: simplify throttling code

2019-04-22 Thread Marek Olšák
From: Marek Olšák 

---
 src/gallium/state_trackers/dri/dri2.c | 4 +---
 src/gallium/state_trackers/dri/dri_drawable.c | 2 +-
 src/gallium/state_trackers/dri/dri_screen.h   | 3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/gallium/state_trackers/dri/dri2.c 
b/src/gallium/state_trackers/dri/dri2.c
index efb43c0d797..7edef415505 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -1926,24 +1926,22 @@ dri2_init_screen(__DRIscreen * sPriv)
 
   pscreen = pipe_loader_create_screen(screen->dev);
}
 
if (!pscreen)
goto release_pipe;
 
throttle_ret = pipe_loader_configuration(screen->dev, DRM_CONF_THROTTLE);
dmabuf_ret = pipe_loader_configuration(screen->dev, DRM_CONF_SHARE_FD);
 
-   if (throttle_ret && throttle_ret->val.val_int != -1) {
-  screen->throttling_enabled = TRUE;
+   if (throttle_ret && throttle_ret->val.val_int > 0)
   screen->default_throttle_frames = throttle_ret->val.val_int;
-   }
 
if (pscreen->resource_create_with_modifiers)
   dri2ImageExtension.createImageWithModifiers =
  dri2_create_image_with_modifiers;
 
if (dmabuf_ret && dmabuf_ret->val.val_bool) {
   uint64_t cap;
 
   if (drmGetCap(sPriv->fd, DRM_CAP_PRIME, ) == 0 &&
   (cap & DRM_PRIME_CAP_IMPORT)) {
diff --git a/src/gallium/state_trackers/dri/dri_drawable.c 
b/src/gallium/state_trackers/dri/dri_drawable.c
index 92047584224..26bfdbecc53 100644
--- a/src/gallium/state_trackers/dri/dri_drawable.c
+++ b/src/gallium/state_trackers/dri/dri_drawable.c
@@ -540,21 +540,21 @@ dri_flush(__DRIcontext *cPriv,
   pipe->flush_resource(pipe, drawable->textures[ST_ATTACHMENT_BACK_LEFT]);
}
 
flush_flags = 0;
if (flags & __DRI2_FLUSH_CONTEXT)
   flush_flags |= ST_FLUSH_FRONT;
if (reason == __DRI2_THROTTLE_SWAPBUFFER)
   flush_flags |= ST_FLUSH_END_OF_FRAME;
 
/* Flush the context and throttle if needed. */
-   if (dri_screen(ctx->sPriv)->throttling_enabled &&
+   if (dri_screen(ctx->sPriv)->default_throttle_frames &&
drawable &&
(reason == __DRI2_THROTTLE_SWAPBUFFER ||
 reason == __DRI2_THROTTLE_FLUSHFRONT)) {
   /* Throttle.
*
* This pulls a fence off the throttling queue and waits for it if the
* number of fences on the throttling queue has reached the desired
* number.
*
* Then flushes to insert a fence at the current rendering position, and
diff --git a/src/gallium/state_trackers/dri/dri_screen.h 
b/src/gallium/state_trackers/dri/dri_screen.h
index 30bde45ce42..85372cb97c8 100644
--- a/src/gallium/state_trackers/dri/dri_screen.h
+++ b/src/gallium/state_trackers/dri/dri_screen.h
@@ -50,22 +50,21 @@ struct dri_screen
 {
/* st_api */
struct st_manager base;
struct st_api *st_api;
 
/* on old libGL's invalidate doesn't get called as it should */
boolean broken_invalidate;
 
/* dri */
__DRIscreen *sPriv;
-   boolean throttling_enabled;
-   int default_throttle_frames;
+   unsigned default_throttle_frames;
 
struct st_config_options options;
 
/* Which postprocessing filters are enabled. */
unsigned pp_enabled[PP_FILTERS];
 
/* drm */
int fd;
boolean can_share_buffer;
 
-- 
2.17.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH 5/5] gallium: replace drm_driver_descriptor::configuration with driconf_xml

2019-04-22 Thread Marek Olšák
From: Marek Olšák 

PIPE_CAPs are better.
---
 .../auxiliary/pipe-loader/pipe_loader.c   | 16 +
 .../auxiliary/pipe-loader/pipe_loader.h   | 10 
 .../auxiliary/pipe-loader/pipe_loader_drm.c   | 40 +++--
 .../auxiliary/pipe-loader/pipe_loader_priv.h  |  3 +-
 .../auxiliary/pipe-loader/pipe_loader_sw.c|  7 +--
 .../auxiliary/target-helpers/drm_helper.h | 58 +++
 .../target-helpers/drm_helper_public.h| 13 +
 .../include/state_tracker/drm_driver.h| 45 +++---
 src/gallium/targets/pipe-loader/pipe_i915.c   |  7 +--
 src/gallium/targets/pipe-loader/pipe_msm.c|  7 +--
 .../targets/pipe-loader/pipe_nouveau.c|  7 +--
 src/gallium/targets/pipe-loader/pipe_r300.c   |  7 +--
 src/gallium/targets/pipe-loader/pipe_r600.c   |  7 +--
 .../targets/pipe-loader/pipe_radeonsi.c   | 21 ++-
 src/gallium/targets/pipe-loader/pipe_vmwgfx.c |  7 +--
 15 files changed, 45 insertions(+), 210 deletions(-)

diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.c 
b/src/gallium/auxiliary/pipe-loader/pipe_loader.c
index fc8ee8e8dcd..29718a2aa20 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.c
@@ -80,39 +80,29 @@ pipe_loader_release(struct pipe_loader_device **devs, int 
ndev)
 void
 pipe_loader_base_release(struct pipe_loader_device **dev)
 {
driDestroyOptionCache(&(*dev)->option_cache);
driDestroyOptionInfo(&(*dev)->option_info);
 
FREE(*dev);
*dev = NULL;
 }
 
-const struct drm_conf_ret *
-pipe_loader_configuration(struct pipe_loader_device *dev,
-  enum drm_conf conf)
-{
-   return dev->ops->configuration(dev, conf);
-}
-
 void
 pipe_loader_load_options(struct pipe_loader_device *dev)
 {
if (dev->option_info.info)
   return;
 
-   const char *xml_options = gallium_driinfo_xml;
-   const struct drm_conf_ret *xml_options_conf =
-  pipe_loader_configuration(dev, DRM_CONF_XML_OPTIONS);
-
-   if (xml_options_conf)
-  xml_options = xml_options_conf->val.val_pointer;
+   const char *xml_options = dev->ops->get_driconf_xml(dev);
+   if (!xml_options)
+  xml_options = gallium_driinfo_xml;
 
driParseOptionInfo(>option_info, xml_options);
driParseConfigFiles(>option_cache, >option_info, 0,
dev->driver_name, NULL);
 }
 
 char *
 pipe_loader_get_driinfo_xml(const char *driver_name)
 {
 #ifdef HAVE_LIBDRM
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.h 
b/src/gallium/auxiliary/pipe-loader/pipe_loader.h
index 9b264145347..a0d9c8a7dec 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader.h
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.h
@@ -83,30 +83,20 @@ int
 pipe_loader_probe(struct pipe_loader_device **devs, int ndev);
 
 /**
  * Create a pipe_screen for the specified device.
  *
  * \param dev Device the screen will be created for.
  */
 struct pipe_screen *
 pipe_loader_create_screen(struct pipe_loader_device *dev);
 
-/**
- * Query the configuration parameters for the specified device.
- *
- * \param dev Device that will be queried.
- * \param conf The drm_conf id of the option to be queried.
- */
-const struct drm_conf_ret *
-pipe_loader_configuration(struct pipe_loader_device *dev,
-  enum drm_conf conf);
-
 /**
  * Ensure that dev->option_cache is initialized appropriately for the driver.
  *
  * This function can be called multiple times.
  *
  * \param dev Device for which options should be loaded.
  */
 void
 pipe_loader_load_options(struct pipe_loader_device *dev);
 
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c 
b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
index 7aa733d5f59..3006f78311a 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
@@ -62,103 +62,88 @@ struct pipe_loader_drm_device {
 
 #define pipe_loader_drm_device(dev) ((struct pipe_loader_drm_device *)dev)
 
 static const struct pipe_loader_ops pipe_loader_drm_ops;
 
 #ifdef GALLIUM_STATIC_TARGETS
 static const struct drm_driver_descriptor driver_descriptors[] = {
 {
 .driver_name = "i915",
 .create_screen = pipe_i915_create_screen,
-.configuration = pipe_default_configuration_query,
 },
 {
 .driver_name = "iris",
 .create_screen = pipe_iris_create_screen,
-.configuration = pipe_iris_configuration_query,
+.driconf_xml = _driconf_xml,
 },
 {
 .driver_name = "nouveau",
 .create_screen = pipe_nouveau_create_screen,
-.configuration = pipe_default_configuration_query,
 },
 {
 .driver_name = "r300",
 .create_screen = pipe_r300_create_screen,
-.configuration = pipe_default_configuration_query,
 },
 {
 .driver_name = "r600",
 .create_screen = pipe_r600_create_screen,
-.configuration = pipe_default_configuration_query,
 

[Mesa-dev] [PATCH 2/5] st/dri: flush before throttling in SwapBuffers

2019-04-22 Thread Marek Olšák
From: Marek Olšák 

for better CPU-GPU parallelism
---
 src/gallium/state_trackers/dri/dri_drawable.c | 20 +--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/gallium/state_trackers/dri/dri_drawable.c 
b/src/gallium/state_trackers/dri/dri_drawable.c
index 26bfdbecc53..c1de3bed9dd 100644
--- a/src/gallium/state_trackers/dri/dri_drawable.c
+++ b/src/gallium/state_trackers/dri/dri_drawable.c
@@ -555,33 +555,33 @@ dri_flush(__DRIcontext *cPriv,
*
* This pulls a fence off the throttling queue and waits for it if the
* number of fences on the throttling queue has reached the desired
* number.
*
* Then flushes to insert a fence at the current rendering position, and
* pushes that fence on the queue. This requires that the 
st_context_iface
* flush method returns a fence even if there are no commands to flush.
*/
   struct pipe_screen *screen = drawable->screen->base.screen;
-  struct pipe_fence_handle *fence;
+  struct pipe_fence_handle *oldest_fence, *new_fence = NULL;
 
-  fence = swap_fences_pop_front(drawable);
-  if (fence) {
- (void) screen->fence_finish(screen, NULL, fence, 
PIPE_TIMEOUT_INFINITE);
- screen->fence_reference(screen, , NULL);
-  }
+  st->flush(st, flush_flags, _fence);
 
-  st->flush(st, flush_flags, );
+  oldest_fence = swap_fences_pop_front(drawable);
+  if (oldest_fence) {
+ screen->fence_finish(screen, NULL, oldest_fence, 
PIPE_TIMEOUT_INFINITE);
+ screen->fence_reference(screen, _fence, NULL);
+  }
 
-  if (fence) {
- swap_fences_push_back(drawable, fence);
- screen->fence_reference(screen, , NULL);
+  if (new_fence) {
+ swap_fences_push_back(drawable, new_fence);
+ screen->fence_reference(screen, _fence, NULL);
   }
}
else if (flags & (__DRI2_FLUSH_DRAWABLE | __DRI2_FLUSH_CONTEXT)) {
   st->flush(st, flush_flags, NULL);
}
 
if (drawable) {
   drawable->flushing = FALSE;
}
 
-- 
2.17.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH 4/5] gallium: replace DRM_CONF_SHARE_FD with PIPE_CAP_DMABUF

2019-04-22 Thread Marek Olšák
From: Marek Olšák 

---
 src/gallium/auxiliary/target-helpers/drm_helper.h | 11 ---
 src/gallium/auxiliary/util/u_screen.c |  7 +++
 src/gallium/docs/source/screen.rst|  2 ++
 src/gallium/include/pipe/p_defines.h  |  1 +
 src/gallium/include/state_tracker/drm_driver.h|  6 --
 src/gallium/state_trackers/dri/dri2.c |  5 +
 src/gallium/targets/d3dadapter9/drm.c |  4 +---
 src/gallium/targets/pipe-loader/pipe_i915.c   | 11 ---
 src/gallium/targets/pipe-loader/pipe_msm.c| 11 ---
 src/gallium/targets/pipe-loader/pipe_nouveau.c| 11 ---
 src/gallium/targets/pipe-loader/pipe_r300.c   | 11 ---
 src/gallium/targets/pipe-loader/pipe_r600.c   | 11 ---
 src/gallium/targets/pipe-loader/pipe_radeonsi.c   |  7 ---
 src/gallium/targets/pipe-loader/pipe_vmwgfx.c | 11 ---
 14 files changed, 12 insertions(+), 97 deletions(-)

diff --git a/src/gallium/auxiliary/target-helpers/drm_helper.h 
b/src/gallium/auxiliary/target-helpers/drm_helper.h
index a89c47e4861..101e0e2c22c 100644
--- a/src/gallium/auxiliary/target-helpers/drm_helper.h
+++ b/src/gallium/auxiliary/target-helpers/drm_helper.h
@@ -1,33 +1,22 @@
 #ifndef DRM_HELPER_H
 #define DRM_HELPER_H
 
 #include 
 #include "target-helpers/inline_debug_helper.h"
 #include "target-helpers/drm_helper_public.h"
 #include "state_tracker/drm_driver.h"
 #include "util/xmlpool.h"
 
-static const struct drm_conf_ret share_fd_ret = {
-   .type = DRM_CONF_BOOL,
-   .val.val_bool = true,
-};
-
 const struct drm_conf_ret *
 pipe_default_configuration_query(enum drm_conf conf)
 {
-   switch (conf) {
-   case DRM_CONF_SHARE_FD:
-  return _fd_ret;
-   default:
-  break;
-   }
return NULL;
 }
 
 #ifdef GALLIUM_I915
 #include "i915/drm/i915_drm_public.h"
 #include "i915/i915_public.h"
 
 struct pipe_screen *
 pipe_i915_create_screen(int fd, const struct pipe_screen_config *config)
 {
diff --git a/src/gallium/auxiliary/util/u_screen.c 
b/src/gallium/auxiliary/util/u_screen.c
index 6864c76c355..8857cf2beef 100644
--- a/src/gallium/auxiliary/util/u_screen.c
+++ b/src/gallium/auxiliary/util/u_screen.c
@@ -348,14 +348,21 @@ u_pipe_screen_get_param_defaults(struct pipe_screen 
*pscreen,
case PIPE_CAP_MAX_VARYINGS:
   return 8;
 
case PIPE_CAP_COMPUTE_GRID_INFO_LAST_BLOCK:
   return 0;
 
case PIPE_CAP_COMPUTE_SHADER_DERIVATIVES:
case PIPE_CAP_MAX_FRAMES_IN_FLIGHT:
   return 0;
 
+   case PIPE_CAP_DMABUF:
+#ifdef PIPE_OS_LINUX
+  return 1;
+#else
+  return 0;
+#endif
+
default:
   unreachable("bad PIPE_CAP_*");
}
 }
diff --git a/src/gallium/docs/source/screen.rst 
b/src/gallium/docs/source/screen.rst
index 20ee9a29c34..fdcdcecb0f2 100644
--- a/src/gallium/docs/source/screen.rst
+++ b/src/gallium/docs/source/screen.rst
@@ -512,20 +512,22 @@ The integer capabilities:
 * ``PIPE_CAP_TGSI_SKIP_SHRINK_IO_ARRAYS``:  Whether the TGSI pass to shrink IO
   arrays should be skipped and enforce keeping the declared array sizes 
instead.
   A driver might rely on the input mapping that was defined with the original
   GLSL code.
 * ``PIPE_CAP_IMAGE_LOAD_FORMATTED``: True if a format for image loads does not 
need to be specified in the shader IR
 * ``PIPE_CAP_PREFER_COMPUTE_BLIT_FOR_MULTIMEDIA``: Whether VDPAU, VAAPI, and
   OpenMAX should use a compute-based blit instead of pipe_context::blit.
 * ``PIPE_CAP_MAX_FRAMES_IN_FLIGHT``: Maximum number of frames that state
   trackers should allow to be in flight before throttling pipe_context
   execution. 0 = throttling is disabled.
+* ``PIPE_CAP_DMABUF``: Whether Linux DMABUF handles are supported by
+  resource_from_handle and resource_get_handle.
 
 .. _pipe_capf:
 
 PIPE_CAPF_*
 
 
 The floating-point capabilities are:
 
 * ``PIPE_CAPF_MAX_LINE_WIDTH``: The maximum width of a regular line.
 * ``PIPE_CAPF_MAX_LINE_WIDTH_AA``: The maximum width of a smoothed line.
diff --git a/src/gallium/include/pipe/p_defines.h 
b/src/gallium/include/pipe/p_defines.h
index e626193ccaf..a1514b6d9a2 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -874,20 +874,21 @@ enum pipe_cap
PIPE_CAP_RGB_OVERRIDE_DST_ALPHA_BLEND,
PIPE_CAP_DEST_SURFACE_SRGB_CONTROL,
PIPE_CAP_NIR_COMPACT_ARRAYS,
PIPE_CAP_MAX_VARYINGS,
PIPE_CAP_COMPUTE_GRID_INFO_LAST_BLOCK,
PIPE_CAP_COMPUTE_SHADER_DERIVATIVES,
PIPE_CAP_TGSI_SKIP_SHRINK_IO_ARRAYS,
PIPE_CAP_IMAGE_LOAD_FORMATTED,
PIPE_CAP_PREFER_COMPUTE_BLIT_FOR_MULTIMEDIA,
PIPE_CAP_MAX_FRAMES_IN_FLIGHT,
+   PIPE_CAP_DMABUF,
 };
 
 /**
  * Possible bits for PIPE_CAP_CONTEXT_PRIORITY_MASK param, which should
  * return a bitmask of the supported priorities.  If the driver does not
  * support prioritized contexts, it can return 0.
  *
  * Note that these match __DRI2_RENDER_HAS_CONTEXT_PRIORITY_*
  */
 #define PIPE_CONTEXT_PRIORITY_LOW (1 << 

[Mesa-dev] [PATCH 3/5] gallium: replace DRM_CONF_THROTTLE with PIPE_CAP_MAX_FRAMES_IN_FLIGHT

2019-04-22 Thread Marek Olšák
From: Marek Olšák 

---
 src/gallium/auxiliary/target-helpers/drm_helper.h |  7 ---
 src/gallium/auxiliary/util/u_screen.c |  1 +
 src/gallium/docs/source/screen.rst|  3 +++
 src/gallium/drivers/freedreno/freedreno_screen.c  |  3 +++
 src/gallium/drivers/i915/i915_screen.c|  3 +++
 src/gallium/drivers/nouveau/nv30/nv30_screen.c|  3 +++
 src/gallium/drivers/nouveau/nv50/nv50_screen.c|  3 +++
 src/gallium/drivers/nouveau/nvc0/nvc0_screen.c|  3 +++
 src/gallium/drivers/r300/r300_screen.c|  3 +++
 src/gallium/drivers/r600/r600_pipe.c  |  3 +++
 src/gallium/drivers/radeonsi/si_get.c |  3 +++
 src/gallium/drivers/svga/svga_screen.c|  2 ++
 src/gallium/include/pipe/p_defines.h  |  1 +
 src/gallium/include/state_tracker/drm_driver.h|  4 
 src/gallium/state_trackers/dri/dri2.c |  8 +++-
 src/gallium/targets/d3dadapter9/drm.c | 10 +++---
 src/gallium/targets/pipe-loader/pipe_i915.c   |  7 ---
 src/gallium/targets/pipe-loader/pipe_msm.c|  7 ---
 src/gallium/targets/pipe-loader/pipe_nouveau.c|  7 ---
 src/gallium/targets/pipe-loader/pipe_r300.c   |  7 ---
 src/gallium/targets/pipe-loader/pipe_r600.c   |  7 ---
 src/gallium/targets/pipe-loader/pipe_radeonsi.c   |  7 ---
 src/gallium/targets/pipe-loader/pipe_vmwgfx.c |  7 ---
 23 files changed, 37 insertions(+), 72 deletions(-)

diff --git a/src/gallium/auxiliary/target-helpers/drm_helper.h 
b/src/gallium/auxiliary/target-helpers/drm_helper.h
index b98e17c3d9a..a89c47e4861 100644
--- a/src/gallium/auxiliary/target-helpers/drm_helper.h
+++ b/src/gallium/auxiliary/target-helpers/drm_helper.h
@@ -1,35 +1,28 @@
 #ifndef DRM_HELPER_H
 #define DRM_HELPER_H
 
 #include 
 #include "target-helpers/inline_debug_helper.h"
 #include "target-helpers/drm_helper_public.h"
 #include "state_tracker/drm_driver.h"
 #include "util/xmlpool.h"
 
-static const struct drm_conf_ret throttle_ret = {
-   .type = DRM_CONF_INT,
-   .val.val_int = 2,
-};
-
 static const struct drm_conf_ret share_fd_ret = {
.type = DRM_CONF_BOOL,
.val.val_bool = true,
 };
 
 const struct drm_conf_ret *
 pipe_default_configuration_query(enum drm_conf conf)
 {
switch (conf) {
-   case DRM_CONF_THROTTLE:
-  return _ret;
case DRM_CONF_SHARE_FD:
   return _fd_ret;
default:
   break;
}
return NULL;
 }
 
 #ifdef GALLIUM_I915
 #include "i915/drm/i915_drm_public.h"
diff --git a/src/gallium/auxiliary/util/u_screen.c 
b/src/gallium/auxiliary/util/u_screen.c
index c5e264d2673..6864c76c355 100644
--- a/src/gallium/auxiliary/util/u_screen.c
+++ b/src/gallium/auxiliary/util/u_screen.c
@@ -345,16 +345,17 @@ u_pipe_screen_get_param_defaults(struct pipe_screen 
*pscreen,
case PIPE_CAP_DEST_SURFACE_SRGB_CONTROL:
   return 1;
 
case PIPE_CAP_MAX_VARYINGS:
   return 8;
 
case PIPE_CAP_COMPUTE_GRID_INFO_LAST_BLOCK:
   return 0;
 
case PIPE_CAP_COMPUTE_SHADER_DERIVATIVES:
+   case PIPE_CAP_MAX_FRAMES_IN_FLIGHT:
   return 0;
 
default:
   unreachable("bad PIPE_CAP_*");
}
 }
diff --git a/src/gallium/docs/source/screen.rst 
b/src/gallium/docs/source/screen.rst
index 41008816ee2..20ee9a29c34 100644
--- a/src/gallium/docs/source/screen.rst
+++ b/src/gallium/docs/source/screen.rst
@@ -509,20 +509,23 @@ The integer capabilities:
 * ``PIPE_CAP_COMPUTE_GRID_INFO_LAST_BLOCK``: Whether pipe_grid_info::last_block
   is implemented by the driver. See struct pipe_grid_info for more details.
 * ``PIPE_CAP_COMPUTE_SHADER_DERIVATIVE``: True if the driver supports 
derivatives (and texture lookups with implicit derivatives) in compute shaders.
 * ``PIPE_CAP_TGSI_SKIP_SHRINK_IO_ARRAYS``:  Whether the TGSI pass to shrink IO
   arrays should be skipped and enforce keeping the declared array sizes 
instead.
   A driver might rely on the input mapping that was defined with the original
   GLSL code.
 * ``PIPE_CAP_IMAGE_LOAD_FORMATTED``: True if a format for image loads does not 
need to be specified in the shader IR
 * ``PIPE_CAP_PREFER_COMPUTE_BLIT_FOR_MULTIMEDIA``: Whether VDPAU, VAAPI, and
   OpenMAX should use a compute-based blit instead of pipe_context::blit.
+* ``PIPE_CAP_MAX_FRAMES_IN_FLIGHT``: Maximum number of frames that state
+  trackers should allow to be in flight before throttling pipe_context
+  execution. 0 = throttling is disabled.
 
 .. _pipe_capf:
 
 PIPE_CAPF_*
 
 
 The floating-point capabilities are:
 
 * ``PIPE_CAPF_MAX_LINE_WIDTH``: The maximum width of a regular line.
 * ``PIPE_CAPF_MAX_LINE_WIDTH_AA``: The maximum width of a smoothed line.
diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c 
b/src/gallium/drivers/freedreno/freedreno_screen.c
index 40dc16f82cd..69264dbd741 100644
--- a/src/gallium/drivers/freedreno/freedreno_screen.c
+++ b/src/gallium/drivers/freedreno/freedreno_screen.c
@@ -371,20 +371,23 @@ 

[Mesa-dev] [PATCH 4/5] gallium: replace DRM_CONF_SHARE_FD with PIPE_CAP_DMABUF

2019-04-22 Thread Marek Olšák
From: Marek Olšák 

---
 src/gallium/auxiliary/target-helpers/drm_helper.h | 11 ---
 src/gallium/auxiliary/util/u_screen.c |  7 +++
 src/gallium/docs/source/screen.rst|  2 ++
 src/gallium/include/pipe/p_defines.h  |  1 +
 src/gallium/include/state_tracker/drm_driver.h|  6 --
 src/gallium/state_trackers/dri/dri2.c |  5 +
 src/gallium/targets/d3dadapter9/drm.c |  4 +---
 src/gallium/targets/pipe-loader/pipe_i915.c   | 11 ---
 src/gallium/targets/pipe-loader/pipe_msm.c| 11 ---
 src/gallium/targets/pipe-loader/pipe_nouveau.c| 11 ---
 src/gallium/targets/pipe-loader/pipe_r300.c   | 11 ---
 src/gallium/targets/pipe-loader/pipe_r600.c   | 11 ---
 src/gallium/targets/pipe-loader/pipe_radeonsi.c   |  7 ---
 src/gallium/targets/pipe-loader/pipe_vmwgfx.c | 11 ---
 14 files changed, 12 insertions(+), 97 deletions(-)

diff --git a/src/gallium/auxiliary/target-helpers/drm_helper.h 
b/src/gallium/auxiliary/target-helpers/drm_helper.h
index a89c47e4861..101e0e2c22c 100644
--- a/src/gallium/auxiliary/target-helpers/drm_helper.h
+++ b/src/gallium/auxiliary/target-helpers/drm_helper.h
@@ -1,33 +1,22 @@
 #ifndef DRM_HELPER_H
 #define DRM_HELPER_H
 
 #include 
 #include "target-helpers/inline_debug_helper.h"
 #include "target-helpers/drm_helper_public.h"
 #include "state_tracker/drm_driver.h"
 #include "util/xmlpool.h"
 
-static const struct drm_conf_ret share_fd_ret = {
-   .type = DRM_CONF_BOOL,
-   .val.val_bool = true,
-};
-
 const struct drm_conf_ret *
 pipe_default_configuration_query(enum drm_conf conf)
 {
-   switch (conf) {
-   case DRM_CONF_SHARE_FD:
-  return _fd_ret;
-   default:
-  break;
-   }
return NULL;
 }
 
 #ifdef GALLIUM_I915
 #include "i915/drm/i915_drm_public.h"
 #include "i915/i915_public.h"
 
 struct pipe_screen *
 pipe_i915_create_screen(int fd, const struct pipe_screen_config *config)
 {
diff --git a/src/gallium/auxiliary/util/u_screen.c 
b/src/gallium/auxiliary/util/u_screen.c
index 6864c76c355..8857cf2beef 100644
--- a/src/gallium/auxiliary/util/u_screen.c
+++ b/src/gallium/auxiliary/util/u_screen.c
@@ -348,14 +348,21 @@ u_pipe_screen_get_param_defaults(struct pipe_screen 
*pscreen,
case PIPE_CAP_MAX_VARYINGS:
   return 8;
 
case PIPE_CAP_COMPUTE_GRID_INFO_LAST_BLOCK:
   return 0;
 
case PIPE_CAP_COMPUTE_SHADER_DERIVATIVES:
case PIPE_CAP_MAX_FRAMES_IN_FLIGHT:
   return 0;
 
+   case PIPE_CAP_DMABUF:
+#ifdef PIPE_OS_LINUX
+  return 1;
+#else
+  return 0;
+#endif
+
default:
   unreachable("bad PIPE_CAP_*");
}
 }
diff --git a/src/gallium/docs/source/screen.rst 
b/src/gallium/docs/source/screen.rst
index 20ee9a29c34..fdcdcecb0f2 100644
--- a/src/gallium/docs/source/screen.rst
+++ b/src/gallium/docs/source/screen.rst
@@ -512,20 +512,22 @@ The integer capabilities:
 * ``PIPE_CAP_TGSI_SKIP_SHRINK_IO_ARRAYS``:  Whether the TGSI pass to shrink IO
   arrays should be skipped and enforce keeping the declared array sizes 
instead.
   A driver might rely on the input mapping that was defined with the original
   GLSL code.
 * ``PIPE_CAP_IMAGE_LOAD_FORMATTED``: True if a format for image loads does not 
need to be specified in the shader IR
 * ``PIPE_CAP_PREFER_COMPUTE_BLIT_FOR_MULTIMEDIA``: Whether VDPAU, VAAPI, and
   OpenMAX should use a compute-based blit instead of pipe_context::blit.
 * ``PIPE_CAP_MAX_FRAMES_IN_FLIGHT``: Maximum number of frames that state
   trackers should allow to be in flight before throttling pipe_context
   execution. 0 = throttling is disabled.
+* ``PIPE_CAP_DMABUF``: Whether Linux DMABUF handles are supported by
+  resource_from_handle and resource_get_handle.
 
 .. _pipe_capf:
 
 PIPE_CAPF_*
 
 
 The floating-point capabilities are:
 
 * ``PIPE_CAPF_MAX_LINE_WIDTH``: The maximum width of a regular line.
 * ``PIPE_CAPF_MAX_LINE_WIDTH_AA``: The maximum width of a smoothed line.
diff --git a/src/gallium/include/pipe/p_defines.h 
b/src/gallium/include/pipe/p_defines.h
index e626193ccaf..a1514b6d9a2 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -874,20 +874,21 @@ enum pipe_cap
PIPE_CAP_RGB_OVERRIDE_DST_ALPHA_BLEND,
PIPE_CAP_DEST_SURFACE_SRGB_CONTROL,
PIPE_CAP_NIR_COMPACT_ARRAYS,
PIPE_CAP_MAX_VARYINGS,
PIPE_CAP_COMPUTE_GRID_INFO_LAST_BLOCK,
PIPE_CAP_COMPUTE_SHADER_DERIVATIVES,
PIPE_CAP_TGSI_SKIP_SHRINK_IO_ARRAYS,
PIPE_CAP_IMAGE_LOAD_FORMATTED,
PIPE_CAP_PREFER_COMPUTE_BLIT_FOR_MULTIMEDIA,
PIPE_CAP_MAX_FRAMES_IN_FLIGHT,
+   PIPE_CAP_DMABUF,
 };
 
 /**
  * Possible bits for PIPE_CAP_CONTEXT_PRIORITY_MASK param, which should
  * return a bitmask of the supported priorities.  If the driver does not
  * support prioritized contexts, it can return 0.
  *
  * Note that these match __DRI2_RENDER_HAS_CONTEXT_PRIORITY_*
  */
 #define PIPE_CONTEXT_PRIORITY_LOW (1 << 

[Mesa-dev] [PATCH 5/5] gallium: replace drm_driver_descriptor::configuration with driconf_xml

2019-04-22 Thread Marek Olšák
From: Marek Olšák 

The configuration callback duplicated the PIPE_CAP system.
---
 .../auxiliary/pipe-loader/pipe_loader.c   | 16 +
 .../auxiliary/pipe-loader/pipe_loader.h   | 10 
 .../auxiliary/pipe-loader/pipe_loader_drm.c   | 40 +++--
 .../auxiliary/pipe-loader/pipe_loader_priv.h  |  3 +-
 .../auxiliary/pipe-loader/pipe_loader_sw.c|  7 +--
 .../auxiliary/target-helpers/drm_helper.h | 58 +++
 .../target-helpers/drm_helper_public.h| 13 +
 .../include/state_tracker/drm_driver.h| 45 +++---
 src/gallium/targets/pipe-loader/pipe_i915.c   |  7 +--
 src/gallium/targets/pipe-loader/pipe_msm.c|  7 +--
 .../targets/pipe-loader/pipe_nouveau.c|  7 +--
 src/gallium/targets/pipe-loader/pipe_r300.c   |  7 +--
 src/gallium/targets/pipe-loader/pipe_r600.c   |  7 +--
 .../targets/pipe-loader/pipe_radeonsi.c   | 21 ++-
 src/gallium/targets/pipe-loader/pipe_vmwgfx.c |  7 +--
 15 files changed, 45 insertions(+), 210 deletions(-)

diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.c 
b/src/gallium/auxiliary/pipe-loader/pipe_loader.c
index fc8ee8e8dcd..29718a2aa20 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.c
@@ -80,39 +80,29 @@ pipe_loader_release(struct pipe_loader_device **devs, int 
ndev)
 void
 pipe_loader_base_release(struct pipe_loader_device **dev)
 {
driDestroyOptionCache(&(*dev)->option_cache);
driDestroyOptionInfo(&(*dev)->option_info);
 
FREE(*dev);
*dev = NULL;
 }
 
-const struct drm_conf_ret *
-pipe_loader_configuration(struct pipe_loader_device *dev,
-  enum drm_conf conf)
-{
-   return dev->ops->configuration(dev, conf);
-}
-
 void
 pipe_loader_load_options(struct pipe_loader_device *dev)
 {
if (dev->option_info.info)
   return;
 
-   const char *xml_options = gallium_driinfo_xml;
-   const struct drm_conf_ret *xml_options_conf =
-  pipe_loader_configuration(dev, DRM_CONF_XML_OPTIONS);
-
-   if (xml_options_conf)
-  xml_options = xml_options_conf->val.val_pointer;
+   const char *xml_options = dev->ops->get_driconf_xml(dev);
+   if (!xml_options)
+  xml_options = gallium_driinfo_xml;
 
driParseOptionInfo(>option_info, xml_options);
driParseConfigFiles(>option_cache, >option_info, 0,
dev->driver_name, NULL);
 }
 
 char *
 pipe_loader_get_driinfo_xml(const char *driver_name)
 {
 #ifdef HAVE_LIBDRM
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.h 
b/src/gallium/auxiliary/pipe-loader/pipe_loader.h
index 9b264145347..a0d9c8a7dec 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader.h
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.h
@@ -83,30 +83,20 @@ int
 pipe_loader_probe(struct pipe_loader_device **devs, int ndev);
 
 /**
  * Create a pipe_screen for the specified device.
  *
  * \param dev Device the screen will be created for.
  */
 struct pipe_screen *
 pipe_loader_create_screen(struct pipe_loader_device *dev);
 
-/**
- * Query the configuration parameters for the specified device.
- *
- * \param dev Device that will be queried.
- * \param conf The drm_conf id of the option to be queried.
- */
-const struct drm_conf_ret *
-pipe_loader_configuration(struct pipe_loader_device *dev,
-  enum drm_conf conf);
-
 /**
  * Ensure that dev->option_cache is initialized appropriately for the driver.
  *
  * This function can be called multiple times.
  *
  * \param dev Device for which options should be loaded.
  */
 void
 pipe_loader_load_options(struct pipe_loader_device *dev);
 
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c 
b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
index 7aa733d5f59..3006f78311a 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
@@ -62,103 +62,88 @@ struct pipe_loader_drm_device {
 
 #define pipe_loader_drm_device(dev) ((struct pipe_loader_drm_device *)dev)
 
 static const struct pipe_loader_ops pipe_loader_drm_ops;
 
 #ifdef GALLIUM_STATIC_TARGETS
 static const struct drm_driver_descriptor driver_descriptors[] = {
 {
 .driver_name = "i915",
 .create_screen = pipe_i915_create_screen,
-.configuration = pipe_default_configuration_query,
 },
 {
 .driver_name = "iris",
 .create_screen = pipe_iris_create_screen,
-.configuration = pipe_iris_configuration_query,
+.driconf_xml = _driconf_xml,
 },
 {
 .driver_name = "nouveau",
 .create_screen = pipe_nouveau_create_screen,
-.configuration = pipe_default_configuration_query,
 },
 {
 .driver_name = "r300",
 .create_screen = pipe_r300_create_screen,
-.configuration = pipe_default_configuration_query,
 },
 {
 .driver_name = "r600",
 .create_screen = pipe_r600_create_screen,
-.configuration = 

[Mesa-dev] [PATCH 1/5] st/dri: simplify throttling code

2019-04-22 Thread Marek Olšák
From: Marek Olšák 

---
 src/gallium/state_trackers/dri/dri2.c | 4 +---
 src/gallium/state_trackers/dri/dri_drawable.c | 2 +-
 src/gallium/state_trackers/dri/dri_screen.h   | 3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/gallium/state_trackers/dri/dri2.c 
b/src/gallium/state_trackers/dri/dri2.c
index efb43c0d797..7edef415505 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -1926,24 +1926,22 @@ dri2_init_screen(__DRIscreen * sPriv)
 
   pscreen = pipe_loader_create_screen(screen->dev);
}
 
if (!pscreen)
goto release_pipe;
 
throttle_ret = pipe_loader_configuration(screen->dev, DRM_CONF_THROTTLE);
dmabuf_ret = pipe_loader_configuration(screen->dev, DRM_CONF_SHARE_FD);
 
-   if (throttle_ret && throttle_ret->val.val_int != -1) {
-  screen->throttling_enabled = TRUE;
+   if (throttle_ret && throttle_ret->val.val_int > 0)
   screen->default_throttle_frames = throttle_ret->val.val_int;
-   }
 
if (pscreen->resource_create_with_modifiers)
   dri2ImageExtension.createImageWithModifiers =
  dri2_create_image_with_modifiers;
 
if (dmabuf_ret && dmabuf_ret->val.val_bool) {
   uint64_t cap;
 
   if (drmGetCap(sPriv->fd, DRM_CAP_PRIME, ) == 0 &&
   (cap & DRM_PRIME_CAP_IMPORT)) {
diff --git a/src/gallium/state_trackers/dri/dri_drawable.c 
b/src/gallium/state_trackers/dri/dri_drawable.c
index 92047584224..26bfdbecc53 100644
--- a/src/gallium/state_trackers/dri/dri_drawable.c
+++ b/src/gallium/state_trackers/dri/dri_drawable.c
@@ -540,21 +540,21 @@ dri_flush(__DRIcontext *cPriv,
   pipe->flush_resource(pipe, drawable->textures[ST_ATTACHMENT_BACK_LEFT]);
}
 
flush_flags = 0;
if (flags & __DRI2_FLUSH_CONTEXT)
   flush_flags |= ST_FLUSH_FRONT;
if (reason == __DRI2_THROTTLE_SWAPBUFFER)
   flush_flags |= ST_FLUSH_END_OF_FRAME;
 
/* Flush the context and throttle if needed. */
-   if (dri_screen(ctx->sPriv)->throttling_enabled &&
+   if (dri_screen(ctx->sPriv)->default_throttle_frames &&
drawable &&
(reason == __DRI2_THROTTLE_SWAPBUFFER ||
 reason == __DRI2_THROTTLE_FLUSHFRONT)) {
   /* Throttle.
*
* This pulls a fence off the throttling queue and waits for it if the
* number of fences on the throttling queue has reached the desired
* number.
*
* Then flushes to insert a fence at the current rendering position, and
diff --git a/src/gallium/state_trackers/dri/dri_screen.h 
b/src/gallium/state_trackers/dri/dri_screen.h
index 30bde45ce42..85372cb97c8 100644
--- a/src/gallium/state_trackers/dri/dri_screen.h
+++ b/src/gallium/state_trackers/dri/dri_screen.h
@@ -50,22 +50,21 @@ struct dri_screen
 {
/* st_api */
struct st_manager base;
struct st_api *st_api;
 
/* on old libGL's invalidate doesn't get called as it should */
boolean broken_invalidate;
 
/* dri */
__DRIscreen *sPriv;
-   boolean throttling_enabled;
-   int default_throttle_frames;
+   unsigned default_throttle_frames;
 
struct st_config_options options;
 
/* Which postprocessing filters are enabled. */
unsigned pp_enabled[PP_FILTERS];
 
/* drm */
int fd;
boolean can_share_buffer;
 
-- 
2.17.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH 2/5] st/dri: flush before throttling in SwapBuffers

2019-04-22 Thread Marek Olšák
From: Marek Olšák 

for better CPU-GPU parallelism
---
 src/gallium/state_trackers/dri/dri_drawable.c | 20 +--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/gallium/state_trackers/dri/dri_drawable.c 
b/src/gallium/state_trackers/dri/dri_drawable.c
index 26bfdbecc53..c1de3bed9dd 100644
--- a/src/gallium/state_trackers/dri/dri_drawable.c
+++ b/src/gallium/state_trackers/dri/dri_drawable.c
@@ -555,33 +555,33 @@ dri_flush(__DRIcontext *cPriv,
*
* This pulls a fence off the throttling queue and waits for it if the
* number of fences on the throttling queue has reached the desired
* number.
*
* Then flushes to insert a fence at the current rendering position, and
* pushes that fence on the queue. This requires that the 
st_context_iface
* flush method returns a fence even if there are no commands to flush.
*/
   struct pipe_screen *screen = drawable->screen->base.screen;
-  struct pipe_fence_handle *fence;
+  struct pipe_fence_handle *oldest_fence, *new_fence = NULL;
 
-  fence = swap_fences_pop_front(drawable);
-  if (fence) {
- (void) screen->fence_finish(screen, NULL, fence, 
PIPE_TIMEOUT_INFINITE);
- screen->fence_reference(screen, , NULL);
-  }
+  st->flush(st, flush_flags, _fence);
 
-  st->flush(st, flush_flags, );
+  oldest_fence = swap_fences_pop_front(drawable);
+  if (oldest_fence) {
+ screen->fence_finish(screen, NULL, oldest_fence, 
PIPE_TIMEOUT_INFINITE);
+ screen->fence_reference(screen, _fence, NULL);
+  }
 
-  if (fence) {
- swap_fences_push_back(drawable, fence);
- screen->fence_reference(screen, , NULL);
+  if (new_fence) {
+ swap_fences_push_back(drawable, new_fence);
+ screen->fence_reference(screen, _fence, NULL);
   }
}
else if (flags & (__DRI2_FLUSH_DRAWABLE | __DRI2_FLUSH_CONTEXT)) {
   st->flush(st, flush_flags, NULL);
}
 
if (drawable) {
   drawable->flushing = FALSE;
}
 
-- 
2.17.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH 3/5] gallium: replace DRM_CONF_THROTTLE with PIPE_CAP_MAX_FRAMES_IN_FLIGHT

2019-04-22 Thread Marek Olšák
From: Marek Olšák 

---
 src/gallium/auxiliary/target-helpers/drm_helper.h |  7 ---
 src/gallium/auxiliary/util/u_screen.c |  1 +
 src/gallium/docs/source/screen.rst|  3 +++
 src/gallium/drivers/freedreno/freedreno_screen.c  |  3 +++
 src/gallium/drivers/i915/i915_screen.c|  3 +++
 src/gallium/drivers/nouveau/nv30/nv30_screen.c|  3 +++
 src/gallium/drivers/nouveau/nv50/nv50_screen.c|  3 +++
 src/gallium/drivers/nouveau/nvc0/nvc0_screen.c|  3 +++
 src/gallium/drivers/r300/r300_screen.c|  3 +++
 src/gallium/drivers/r600/r600_pipe.c  |  3 +++
 src/gallium/drivers/radeonsi/si_get.c |  3 +++
 src/gallium/drivers/svga/svga_screen.c|  2 ++
 src/gallium/include/pipe/p_defines.h  |  1 +
 src/gallium/include/state_tracker/drm_driver.h|  4 
 src/gallium/state_trackers/dri/dri2.c |  8 +++-
 src/gallium/targets/d3dadapter9/drm.c | 10 +++---
 src/gallium/targets/pipe-loader/pipe_i915.c   |  7 ---
 src/gallium/targets/pipe-loader/pipe_msm.c|  7 ---
 src/gallium/targets/pipe-loader/pipe_nouveau.c|  7 ---
 src/gallium/targets/pipe-loader/pipe_r300.c   |  7 ---
 src/gallium/targets/pipe-loader/pipe_r600.c   |  7 ---
 src/gallium/targets/pipe-loader/pipe_radeonsi.c   |  7 ---
 src/gallium/targets/pipe-loader/pipe_vmwgfx.c |  7 ---
 23 files changed, 37 insertions(+), 72 deletions(-)

diff --git a/src/gallium/auxiliary/target-helpers/drm_helper.h 
b/src/gallium/auxiliary/target-helpers/drm_helper.h
index b98e17c3d9a..a89c47e4861 100644
--- a/src/gallium/auxiliary/target-helpers/drm_helper.h
+++ b/src/gallium/auxiliary/target-helpers/drm_helper.h
@@ -1,35 +1,28 @@
 #ifndef DRM_HELPER_H
 #define DRM_HELPER_H
 
 #include 
 #include "target-helpers/inline_debug_helper.h"
 #include "target-helpers/drm_helper_public.h"
 #include "state_tracker/drm_driver.h"
 #include "util/xmlpool.h"
 
-static const struct drm_conf_ret throttle_ret = {
-   .type = DRM_CONF_INT,
-   .val.val_int = 2,
-};
-
 static const struct drm_conf_ret share_fd_ret = {
.type = DRM_CONF_BOOL,
.val.val_bool = true,
 };
 
 const struct drm_conf_ret *
 pipe_default_configuration_query(enum drm_conf conf)
 {
switch (conf) {
-   case DRM_CONF_THROTTLE:
-  return _ret;
case DRM_CONF_SHARE_FD:
   return _fd_ret;
default:
   break;
}
return NULL;
 }
 
 #ifdef GALLIUM_I915
 #include "i915/drm/i915_drm_public.h"
diff --git a/src/gallium/auxiliary/util/u_screen.c 
b/src/gallium/auxiliary/util/u_screen.c
index c5e264d2673..6864c76c355 100644
--- a/src/gallium/auxiliary/util/u_screen.c
+++ b/src/gallium/auxiliary/util/u_screen.c
@@ -345,16 +345,17 @@ u_pipe_screen_get_param_defaults(struct pipe_screen 
*pscreen,
case PIPE_CAP_DEST_SURFACE_SRGB_CONTROL:
   return 1;
 
case PIPE_CAP_MAX_VARYINGS:
   return 8;
 
case PIPE_CAP_COMPUTE_GRID_INFO_LAST_BLOCK:
   return 0;
 
case PIPE_CAP_COMPUTE_SHADER_DERIVATIVES:
+   case PIPE_CAP_MAX_FRAMES_IN_FLIGHT:
   return 0;
 
default:
   unreachable("bad PIPE_CAP_*");
}
 }
diff --git a/src/gallium/docs/source/screen.rst 
b/src/gallium/docs/source/screen.rst
index 41008816ee2..20ee9a29c34 100644
--- a/src/gallium/docs/source/screen.rst
+++ b/src/gallium/docs/source/screen.rst
@@ -509,20 +509,23 @@ The integer capabilities:
 * ``PIPE_CAP_COMPUTE_GRID_INFO_LAST_BLOCK``: Whether pipe_grid_info::last_block
   is implemented by the driver. See struct pipe_grid_info for more details.
 * ``PIPE_CAP_COMPUTE_SHADER_DERIVATIVE``: True if the driver supports 
derivatives (and texture lookups with implicit derivatives) in compute shaders.
 * ``PIPE_CAP_TGSI_SKIP_SHRINK_IO_ARRAYS``:  Whether the TGSI pass to shrink IO
   arrays should be skipped and enforce keeping the declared array sizes 
instead.
   A driver might rely on the input mapping that was defined with the original
   GLSL code.
 * ``PIPE_CAP_IMAGE_LOAD_FORMATTED``: True if a format for image loads does not 
need to be specified in the shader IR
 * ``PIPE_CAP_PREFER_COMPUTE_BLIT_FOR_MULTIMEDIA``: Whether VDPAU, VAAPI, and
   OpenMAX should use a compute-based blit instead of pipe_context::blit.
+* ``PIPE_CAP_MAX_FRAMES_IN_FLIGHT``: Maximum number of frames that state
+  trackers should allow to be in flight before throttling pipe_context
+  execution. 0 = throttling is disabled.
 
 .. _pipe_capf:
 
 PIPE_CAPF_*
 
 
 The floating-point capabilities are:
 
 * ``PIPE_CAPF_MAX_LINE_WIDTH``: The maximum width of a regular line.
 * ``PIPE_CAPF_MAX_LINE_WIDTH_AA``: The maximum width of a smoothed line.
diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c 
b/src/gallium/drivers/freedreno/freedreno_screen.c
index 40dc16f82cd..69264dbd741 100644
--- a/src/gallium/drivers/freedreno/freedreno_screen.c
+++ b/src/gallium/drivers/freedreno/freedreno_screen.c
@@ -371,20 +371,23 @@ 

[Mesa-dev] [Bug 110431] Please add support for GL_EXT_gpu_shader4 (including on non-core profiles)

2019-04-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=110431

--- Comment #2 from Timothy Arceri  ---
Merge request for this extension:

https://gitlab.freedesktop.org/mesa/mesa/merge_requests/667

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [Bug 110492] Mesa reports old GLSL version to programms using an older OpenGL version

2019-04-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=110492

Timothy Arceri  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #1 from Timothy Arceri  ---


*** This bug has been marked as a duplicate of bug 110431 ***

-- 
You are receiving this mail because:
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [Bug 110431] Please add support for GL_EXT_gpu_shader4 (including on non-core profiles)

2019-04-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=110431

Timothy Arceri  changed:

   What|Removed |Added

 CC||com...@live.de

--- Comment #1 from Timothy Arceri  ---
*** Bug 110492 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [Bug 110462] Epic Games Launcher renders nothing with "-opengl" option

2019-04-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=110462

--- Comment #5 from Timothy Arceri  ---
(In reply to Danylo from comment #3)
> It creates several contexts (from apitrace):
> 
> glXCreateContextAttribsARB(dpy = 0x7e1e57b0, config = 0x7e875070,
> share_context = 0x7e9c0450, direct = True, attrib_list =
> [GLX_CONTEXT_MAJOR_VERSION_ARB, 3, GLX_CONTEXT_MINOR_VERSION_ARB, 2,
> GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
> GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB, 0]) =
> 0x7ebf4410
> 
> glXCreateContextAttribsARB(dpy = 0x7e1e57b0, config = 0x7e875070,
> share_context = NULL, direct = True, attrib_list =
> [GLX_CONTEXT_MAJOR_VERSION_ARB, 4, GLX_CONTEXT_MINOR_VERSION_ARB, 4, 0]) =
> 0x7ec33570
> 
> glXCreateContextAttribsARB(dpy = 0x7e1e57b0, config = 0x7e875070,
> share_context = NULL, direct = True, attrib_list =
> [GLX_CONTEXT_MAJOR_VERSION_ARB, 4, GLX_CONTEXT_MINOR_VERSION_ARB, 4,
> GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB, 0]) = 0x7f526c0010d0
> 
> So for 3.2 it requests compat profile. For 4.4 - it doesn't and it uses 4.4
> context to render the interface.

As far as I recall apitrace records the profile it was given not the profile
that the application requests.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH] s3tc-errors: Fix GCC unused-variable warning.

2019-04-22 Thread Vinson Lee
s3tc-errors.c: In function ‘test_format’:
s3tc-errors.c:175:9: warning: unused variable ‘format2’ [-Wunused-variable]
  GLenum format2;
 ^~~

Fixes: d433792407e7 ("s3tc-errors: port to gles31")
Signed-off-by: Vinson Lee 
---
 tests/texturing/s3tc-errors.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/texturing/s3tc-errors.c b/tests/texturing/s3tc-errors.c
index ccc0be9a785f..6b2658c9a1d1 100644
--- a/tests/texturing/s3tc-errors.c
+++ b/tests/texturing/s3tc-errors.c
@@ -171,8 +171,8 @@ test_format(int width, int height, GLfloat *image, GLenum 
requested_format)
 {
 #ifdef PIGLIT_USE_OPENGL
GLubyte *compressed_image;
-#endif
GLenum format2;
+#endif
int x, y, w, h;
GLuint tex;
bool pass = true;
-- 
2.19.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] Add an ASSERTED macro to use in place of MAYBE_UNUSED?

2019-04-22 Thread Kristian Høgsberg
On Mon, Apr 22, 2019 at 3:11 PM Matt Turner  wrote:
>
> On Mon, Apr 22, 2019 at 1:09 PM Kristian Høgsberg  wrote:
> >
> > On Mon, Apr 22, 2019 at 12:11 PM Jason Ekstrand  
> > wrote:
> > >
> > > All,
> > >
> > > I've seen discussions come up several times lately about whether you 
> > > should use MAYBE_UNUSED or UNUSED in what scenario and why do we have two 
> > > of them anyway.  That got me thinking a bit.  Maybe what we actually want 
> > > instead of MAYBE_UNUSED is something like this:
> > >
> > > #ifdef NDEBUG
> > > #define ASSERTED UNUSED
> > > #else
> > > #define ASSERTED
> > > #endif
> > >
> > > That way, if you only need a parameter for asserts, you can declare it 
> > > ASSERTED and it won't warn in release builds will still throw a warning 
> > > if you do a debug build which doesn't use it.  Of course, there are other 
> > > times when something is validly MAYBE_UNUSED such as auto-generated code 
> > > or the genX code we use on Intel.  However, this provides additional 
> > > meaning and means the compiler warnings are still useful even after 
> > > you've relegated a value to assert-only.
> > >
> > > Thoughts?  I'm also open to a better name; that's the best I could do in 
> > > 5 minutes.
> >
> > I think that's going in the wrong direction - if anything I think that
> > having both UNUSED and MAYBE_UNUSED is redundant and feel that just
> > UNUSED would be fine. __attribute__((unused)) doesn't mean "strictly
> > not used", it means "don't warn if this isn't used".
>
> I agree that having both UNUSED and MAYBE_UNUSED is silly and I would
> be happy to see MAYBE_UNUSED go away.
>
> I think the advantage of Jason's proposal is that we are alerted if
> there is actually dead code. E.g., if we remove the assert that used a
> variable, we currently won't get a warning from the compiler that the
> variable is unused. At least in release builds we would, if we did
> what Jason suggests.
>
> Maybe we do what Jason suggests and then remove MAYBE_UNUSED?

Right... I see now, that's sounds reasonable.

Kristian
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] Add an ASSERTED macro to use in place of MAYBE_UNUSED?

2019-04-22 Thread Eric Anholt
Jason Ekstrand  writes:

> All,
>
> I've seen discussions come up several times lately about whether you should
> use MAYBE_UNUSED or UNUSED in what scenario and why do we have two of them
> anyway.  That got me thinking a bit.  Maybe what we actually want instead
> of MAYBE_UNUSED is something like this:
>
> #ifdef NDEBUG
> #define ASSERTED UNUSED
> #else
> #define ASSERTED
> #endif
>
> That way, if you only need a parameter for asserts, you can declare it
> ASSERTED and it won't warn in release builds will still throw a warning if
> you do a debug build which doesn't use it.  Of course, there are other
> times when something is validly MAYBE_UNUSED such as auto-generated code or
> the genX code we use on Intel.  However, this provides additional meaning
> and means the compiler warnings are still useful even after you've
> relegated a value to assert-only.
>
> Thoughts?  I'm also open to a better name; that's the best I could do in 5
> minutes.

We should delete one or the other of the current ones and not have
different names to need to know for the same underlying function
attribute.  I'd prefer deleting MAYBE_UNUSED (UNUSED is less typing and
the name of the underlying attribute), but would go either way.


signature.asc
Description: PGP signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] Add an ASSERTED macro to use in place of MAYBE_UNUSED?

2019-04-22 Thread Matt Turner
On Mon, Apr 22, 2019 at 1:09 PM Kristian Høgsberg  wrote:
>
> On Mon, Apr 22, 2019 at 12:11 PM Jason Ekstrand  wrote:
> >
> > All,
> >
> > I've seen discussions come up several times lately about whether you should 
> > use MAYBE_UNUSED or UNUSED in what scenario and why do we have two of them 
> > anyway.  That got me thinking a bit.  Maybe what we actually want instead 
> > of MAYBE_UNUSED is something like this:
> >
> > #ifdef NDEBUG
> > #define ASSERTED UNUSED
> > #else
> > #define ASSERTED
> > #endif
> >
> > That way, if you only need a parameter for asserts, you can declare it 
> > ASSERTED and it won't warn in release builds will still throw a warning if 
> > you do a debug build which doesn't use it.  Of course, there are other 
> > times when something is validly MAYBE_UNUSED such as auto-generated code or 
> > the genX code we use on Intel.  However, this provides additional meaning 
> > and means the compiler warnings are still useful even after you've 
> > relegated a value to assert-only.
> >
> > Thoughts?  I'm also open to a better name; that's the best I could do in 5 
> > minutes.
>
> I think that's going in the wrong direction - if anything I think that
> having both UNUSED and MAYBE_UNUSED is redundant and feel that just
> UNUSED would be fine. __attribute__((unused)) doesn't mean "strictly
> not used", it means "don't warn if this isn't used".

I agree that having both UNUSED and MAYBE_UNUSED is silly and I would
be happy to see MAYBE_UNUSED go away.

I think the advantage of Jason's proposal is that we are alerted if
there is actually dead code. E.g., if we remove the assert that used a
variable, we currently won't get a warning from the compiler that the
variable is unused. At least in release builds we would, if we did
what Jason suggests.

Maybe we do what Jason suggests and then remove MAYBE_UNUSED?
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [Mesa-stable] [PATCH v2] st: require compatible driver in autotools

2019-04-22 Thread Dylan Baker
Emil, I'll pull this if you want, 100% up to you.

Dylan

Quoting Alyssa Ross (2019-04-19 11:53:24)
> The meson build system already has these checks. I've just copied them
> to autotools.
> 
> Without this, state trackers could be enabled when building with the
> following set of options, which resulted in a compile error due to VL
> being built without DRM.
> 
>  --enable-autotools
>  --with-platforms=x11
>  --with-dri-drivers=
>  --with-gallium-drivers=swrast
>  --disable-glx
>  --disable-dri3
>  --disable-gbm
> 
> The compile error was:
> 
> vl/vl_winsys_dri.c:36:10: fatal error: xf86drm.h: No such file or 
> directory
>  #include 
>   ^~~
> compilation terminated.
> 
> Cc: mesa-sta...@lists.freedesktop.org
> ---
> This version of the patch adds the check to OMX tizonia, which I had
> previously missed.
> 
>  configure.ac | 341 +++
>  1 file changed, 183 insertions(+), 158 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 1ef68fe68e6..ee8658ffc8c 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -2341,6 +2341,164 @@ if test -n "$with_gallium_drivers" -a 
> "x$with_gallium_drivers" != xswrast; then
>  fi
>  fi
> 
> +dnl Duplicates in GALLIUM_DRIVERS_DIRS are removed by sorting it after this 
> block
> +if test -n "$with_gallium_drivers"; then
> +gallium_drivers=`IFS=', '; echo $with_gallium_drivers`
> +for driver in $gallium_drivers; do
> +case "x$driver" in
> +xsvga)
> +HAVE_GALLIUM_SVGA=yes
> +require_libdrm "svga"
> +;;
> +xi915)
> +HAVE_GALLIUM_I915=yes
> +PKG_CHECK_MODULES([I915], [libdrm >= $LIBDRM_INTEL_REQUIRED 
> libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
> +require_libdrm "Gallium i915"
> +;;
> +xr300)
> +HAVE_GALLIUM_R300=yes
> +PKG_CHECK_MODULES([RADEON], [libdrm >= $LIBDRM_RADEON_REQUIRED 
> libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
> +require_libdrm "r300"
> +r300_require_llvm "r300"
> +;;
> +xr600)
> +HAVE_GALLIUM_R600=yes
> +PKG_CHECK_MODULES([RADEON], [libdrm >= $LIBDRM_RADEON_REQUIRED 
> libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
> +require_libdrm "r600"
> +if test "x$enable_llvm" = xyes; then
> +radeon_llvm_check $LLVM_REQUIRED_R600 "r600"
> +
> +llvm_add_component "asmparser" "r600"
> +llvm_add_component "bitreader" "r600"
> +fi
> +;;
> +xradeonsi)
> +HAVE_GALLIUM_RADEONSI=yes
> +PKG_CHECK_MODULES([RADEON], [libdrm >= $LIBDRM_RADEON_REQUIRED 
> libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
> +PKG_CHECK_MODULES([AMDGPU], [libdrm >= $LIBDRM_AMDGPU_REQUIRED 
> libdrm_amdgpu >= $LIBDRM_AMDGPU_REQUIRED])
> +require_libdrm "radeonsi"
> +radeon_llvm_check $LLVM_REQUIRED_RADEONSI "radeonsi"
> +if test "x$enable_egl" = xyes; then
> +require_basic_egl "radeonsi"
> +fi
> +;;
> +xnouveau)
> +HAVE_GALLIUM_NOUVEAU=yes
> +PKG_CHECK_MODULES([NOUVEAU], [libdrm >= $LIBDRM_NOUVEAU_REQUIRED 
> libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
> +require_libdrm "nouveau"
> +;;
> +xfreedreno)
> +HAVE_GALLIUM_FREEDRENO=yes
> +require_libdrm "freedreno"
> +;;
> +xetnaviv)
> +HAVE_GALLIUM_ETNAVIV=yes
> +PKG_CHECK_MODULES([ETNAVIV], [libdrm >= $LIBDRM_ETNAVIV_REQUIRED 
> libdrm_etnaviv >= $LIBDRM_ETNAVIV_REQUIRED])
> +require_libdrm "etnaviv"
> +;;
> +xtegra)
> +HAVE_GALLIUM_TEGRA=yes
> +require_libdrm "tegra"
> +;;
> +xswrast)
> +HAVE_GALLIUM_SOFTPIPE=yes
> +if test "x$enable_llvm" = xyes; then
> +HAVE_GALLIUM_LLVMPIPE=yes
> +fi
> +;;
> +xswr)
> +llvm_require_version $LLVM_REQUIRED_SWR "swr"
> +
> +if test "x$HAVE_CXX11" != "xyes"; then
> +AC_MSG_ERROR([swr requires c++11 support])
> +fi
> +
> +swr_require_cxx_feature_flags "AVX" "defined(__AVX__)" \
> +
> ",-target-cpu=sandybridge,-mavx,-march=core-avx,-tp=sandybridge" \
> +SWR_AVX_CXXFLAGS
> +AC_SUBST([SWR_AVX_CXXFLAGS])
> +
> +swr_archs=`IFS=', '; echo $with_swr_archs`
> +for arch in $swr_archs; do
> +case "x$arch" in
> +xavx)
> +HAVE_SWR_AVX=yes
> +;;
> +xavx2)
> +swr_require_cxx_feature_flags "AVX2" "defined(__AVX2__)" 
> \
> +",-target-cpu=haswell,-mavx2 -mfma -mbmi2 
> 

[Mesa-dev] [Bug 100105] Make Theano OpenCL support work on Clover and RadeonSI

2019-04-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=100105

--- Comment #10 from b...@besd.de  ---
Just to make extra sure its most likely a problem with clover I installed the
AMD legacy opencl driver in parallel (works fine):

DEVICE="opencl1:0" python3 -c "import pygpu;pygpu.test()"
pygpu is installed in
/usr/local/lib/python3.6/dist-packages/pygpu-0.7.6+20.g9cec614-py3.6-linux-x86_64.egg/pygpu
NumPy version 1.16.3
NumPy relaxed strides checking option: True
NumPy is installed in /home/nano/.local/lib/python3.6/site-packages/numpy
Python version 3.6.7 (default, Oct 22 2018, 11:32:17) [GCC 8.2.0]
nose version 1.3.7
*** Testing for Baffin
mpi4py found: True

Re: [Mesa-dev] [PATCH v2 2/2] radeon/vcn: fix width alignment for hevc encoding

2019-04-22 Thread Zhang, Boyuan
Both patches are
Reviewed-by: Boyuan Zhang 

Thanks,
Boyuan

-Original Message-
From: mesa-dev  On Behalf Of Lei Zhou
Sent: April 18, 2019 12:14 PM
To: mesa-dev@lists.freedesktop.org
Subject: [Mesa-dev] [PATCH v2 2/2] radeon/vcn: fix width alignment for hevc 
encoding

The width alignment for HEVC encoding should be 64 due to hardware requirement. 
This will fix conformance_window_flag in SPS.

v2 (Zhang, Boyuan):
 - add marcos to define width alignment for hevc and h264

Signed-off-by: Lei Zhou 
---
 src/gallium/drivers/radeon/radeon_vcn_enc.c | 4 ++--
 src/gallium/drivers/radeon/radeon_vcn_enc.h | 3 +++
 src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c | 4 ++--
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc.c 
b/src/gallium/drivers/radeon/radeon_vcn_enc.c
index 7d64a28a405..a882bba502c 100644
--- a/src/gallium/drivers/radeon/radeon_vcn_enc.c
+++ b/src/gallium/drivers/radeon/radeon_vcn_enc.c
@@ -51,7 +51,7 @@ static void radeon_vcn_enc_get_param(struct radeon_encoder 
*enc, struct pipe_pic
   enc->enc_pic.not_referenced = pic->not_referenced;
   enc->enc_pic.is_idr = (pic->picture_type == 
PIPE_H264_ENC_PICTURE_TYPE_IDR);
   enc->enc_pic.crop_left = 0;
-  enc->enc_pic.crop_right = (align(enc->base.width, 16) - enc->base.width) 
/ 2;
+  enc->enc_pic.crop_right = (align(enc->base.width, 
+ RENCODE_H264_WIDTH_ALIGN) - enc->base.width) / 2;
   enc->enc_pic.crop_top = 0;
   enc->enc_pic.crop_bottom = (align(enc->base.height, 16) - 
enc->base.height) / 2;
} else if (u_reduce_video_profile(picture->profile) == 
PIPE_VIDEO_FORMAT_HEVC) { @@ -66,7 +66,7 @@ static void 
radeon_vcn_enc_get_param(struct radeon_encoder *enc, struct pipe_pic
   enc->enc_pic.is_idr = (pic->picture_type == 
PIPE_H265_ENC_PICTURE_TYPE_IDR) ||
 (pic->picture_type == 
PIPE_H265_ENC_PICTURE_TYPE_I);
   enc->enc_pic.crop_left = 0;
-  enc->enc_pic.crop_right = (align(enc->base.width, 16) - enc->base.width) 
/ 2;
+  enc->enc_pic.crop_right = (align(enc->base.width, 
+ RENCODE_HEVC_WIDTH_ALIGN) - enc->base.width) / 2;
   enc->enc_pic.crop_top = 0;
   enc->enc_pic.crop_bottom = (align(enc->base.height, 16) - 
enc->base.height) / 2;
   enc->enc_pic.general_tier_flag = pic->seq.general_tier_flag; diff --git 
a/src/gallium/drivers/radeon/radeon_vcn_enc.h 
b/src/gallium/drivers/radeon/radeon_vcn_enc.h
index 04685c69af1..fadc74cc898 100644
--- a/src/gallium/drivers/radeon/radeon_vcn_enc.h
+++ b/src/gallium/drivers/radeon/radeon_vcn_enc.h
@@ -148,6 +148,9 @@
 #define RENCODE_FEEDBACK_BUFFER_MODE_LINEAR0
 #define RENCODE_FEEDBACK_BUFFER_MODE_CIRCULAR  1
 
+#define RENCODE_H264_WIDTH_ALIGN16
+#define RENCODE_HEVC_WIDTH_ALIGN64
+
 typedef struct rvcn_enc_session_info_s
 {
 uint32_t   interface_version;
diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c 
b/src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c
index 7f5b1909344..388df42909f 100644
--- a/src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c
+++ b/src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c
@@ -212,7 +212,7 @@ static void radeon_enc_task_info(struct radeon_encoder 
*enc, bool need_feedback)  static void radeon_enc_session_init(struct 
radeon_encoder *enc)  {
enc->enc_pic.session_init.encode_standard = 
RENCODE_ENCODE_STANDARD_H264;
-   enc->enc_pic.session_init.aligned_picture_width = 
align(enc->base.width, 16);
+   enc->enc_pic.session_init.aligned_picture_width = 
+align(enc->base.width, RENCODE_H264_WIDTH_ALIGN);
enc->enc_pic.session_init.aligned_picture_height = 
align(enc->base.height, 16);
enc->enc_pic.session_init.padding_width = 
enc->enc_pic.session_init.aligned_picture_width - enc->base.width;
enc->enc_pic.session_init.padding_height = 
enc->enc_pic.session_init.aligned_picture_height - enc->base.height; @@ -233,7 
+233,7 @@ static void radeon_enc_session_init(struct radeon_encoder *enc)  
static void radeon_enc_session_init_hevc(struct radeon_encoder *enc)  {
enc->enc_pic.session_init.encode_standard = 
RENCODE_ENCODE_STANDARD_HEVC;
-   enc->enc_pic.session_init.aligned_picture_width = 
align(enc->base.width, 64);
+   enc->enc_pic.session_init.aligned_picture_width = 
+align(enc->base.width, RENCODE_HEVC_WIDTH_ALIGN);
enc->enc_pic.session_init.aligned_picture_height = 
align(enc->base.height, 16);
enc->enc_pic.session_init.padding_width = 
enc->enc_pic.session_init.aligned_picture_width - enc->base.width;
enc->enc_pic.session_init.padding_height = 
enc->enc_pic.session_init.aligned_picture_height - enc->base.height;
--
2.21.0



___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list

[Mesa-dev] [Bug 100105] Make Theano OpenCL support work on Clover and RadeonSI

2019-04-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=100105

--- Comment #9 from b...@besd.de  ---
Just in case it is of any importance:
clinfo
Number of platforms   1
  Platform Name   Clover
  Platform Vendor Mesa
  Platform VersionOpenCL 1.1 Mesa 19.1.0-devel
(git-a6ccc4c 2019-04-21 bionic-oibaf-ppa)
  Platform ProfileFULL_PROFILE
  Platform Extensions cl_khr_icd
  Platform Extensions function suffix MESA

  Platform Name   Clover
Number of devices 1
  Device Name Radeon RX 560 Series
(POLARIS11, DRM 3.30.0, 5.1.0-rc5+, LLVM 8.0.0)
  Device Vendor   AMD
  Device Vendor ID0x1002
  Device Version  OpenCL 1.1 Mesa 19.1.0-devel
(git-a6ccc4c 2019-04-21 bionic-oibaf-ppa)
  Driver Version  19.1.0-devel
  Device OpenCL C Version OpenCL C 1.1 
  Device Type GPU
  Device Profile  FULL_PROFILE
  Device AvailableYes
  Compiler Available  Yes
  Max compute units   16
  Max clock frequency 1300MHz
  Max work item dimensions3
  Max work item sizes 256x256x256
  Max work group size 256
  Preferred work group size multiple  64
  Preferred / native vector sizes 
char16 / 16  
short8 / 8   
int  4 / 4   
long 2 / 2   
half 8 / 8   
(cl_khr_fp16)
float4 / 4   
double   2 / 2   
(cl_khr_fp64)
  Half-precision Floating-point support   (cl_khr_fp16)
Denormals No
Infinity and NANs Yes
Round to nearest  Yes
Round to zero No
Round to infinity No
IEEE754-2008 fused multiply-add   No
Support is emulated in software   No
  Single-precision Floating-point support (core)
Denormals No
Infinity and NANs Yes
Round to nearest  Yes
Round to zero No
Round to infinity No
IEEE754-2008 fused multiply-add   No
Support is emulated in software   No
Correctly-rounded divide and sqrt operations  No
  Double-precision Floating-point support (cl_khr_fp64)
Denormals Yes
Infinity and NANs Yes
Round to nearest  Yes
Round to zero Yes
Round to infinity Yes
IEEE754-2008 fused multiply-add   Yes
Support is emulated in software   No
  Address bits64, Little-Endian
  Global memory size  4294967296 (4GiB)
  Error Correction supportNo
  Max memory allocation   3435973836 (3.2GiB)
  Unified memory for Host and Device  No
  Minimum alignment for any data type 128 bytes
  Alignment of base address   32768 bits (4096 bytes)
  Global Memory cache typeNone
  Image support   No
  Local memory type   Local
  Local memory size   32768 (32KiB)
  Max number of constant args 16
  Max constant buffer size2147483647 (2GiB)
  Max size of kernel argument 1024
  Queue properties
Out-of-order executionNo
Profiling Yes
  Profiling timer resolution  0ns
  Execution capabilities  
Run OpenCL kernelsYes
Run native kernelsNo
  Device Extensions   cl_khr_byte_addressable_store

[Mesa-dev] [Bug 100105] Make Theano OpenCL support work on Clover and RadeonSI

2019-04-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=100105

--- Comment #8 from b...@besd.de  ---
I'm using mesa and linux master git on ubuntu 18.04.2
Theano and libgpuarray are installed from git as well.
The changes you have made in the past are still there.

Any idea what could be wrong now?

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [Bug 100105] Make Theano OpenCL support work on Clover and RadeonSI

2019-04-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=100105

--- Comment #7 from b...@besd.de  ---
Running https://github.com/ZVK/sampleRNN_ICLR2017 fails with:
Traceback (most recent call last):
  File "models/two_tier/two_tier32k.py", line 429, in 
on_unused_input='warn'
  File "/home/nano/rust/mesa/Theano/theano/compile/function.py", line 317, in
function
output_keys=output_keys)
  File "/home/nano/rust/mesa/Theano/theano/compile/pfunc.py", line 486, in
pfunc
output_keys=output_keys)
  File "/home/nano/rust/mesa/Theano/theano/compile/function_module.py", line
1841, in orig_function
fn = m.create(defaults)
  File "/home/nano/rust/mesa/Theano/theano/compile/function_module.py", line
1715, in create
input_storage=input_storage_lists, storage_map=storage_map)
  File "/home/nano/rust/mesa/Theano/theano/gof/link.py", line 699, in
make_thunk
storage_map=storage_map)[:3]
  File "/home/nano/rust/mesa/Theano/theano/gof/vm.py", line 1091, in make_all
impl=impl))
  File "/home/nano/rust/mesa/Theano/theano/gof/op.py", line 955, in make_thunk
no_recycling)
  File "/home/nano/rust/mesa/Theano/theano/gof/op.py", line 858, in
make_c_thunk
output_storage=node_output_storage)
  File "/home/nano/rust/mesa/Theano/theano/gof/cc.py", line 1217, in make_thunk
keep_lock=keep_lock)
  File "/home/nano/rust/mesa/Theano/theano/gof/cc.py", line 1157, in
__compile__
keep_lock=keep_lock)
  File "/home/nano/rust/mesa/Theano/theano/gof/cc.py", line 1641, in
cthunk_factory
*(in_storage + out_storage + orphd))
RuntimeError: ('The following error happened while compiling the node',
GpuCrossentropySoftmaxArgmax1HotWithBias(GpuDot22.0, SampleLevel.Output.b,
GpuReshape{1}.0), '\n', 'GpuKernel_init error 3: clBuildProgram: Unknown
error')

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [Bug 100105] Make Theano OpenCL support work on Clover and RadeonSI

2019-04-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=100105

--- Comment #6 from b...@besd.de  ---
Seems the error is still there:

CLOVER_DEVICE_VERSION_OVERRIDE=1.2 CLOVER_DEVICE_CLC_VERSION_OVERRIDE=1.2
DEVICE="opencl0:0" python3 -c "import pygpu;pygpu.test()"

fails with:

pygpu is installed in
/usr/local/lib/python3.6/dist-packages/pygpu-0.7.6+20.g9cec614-py3.6-linux-x86_64.egg/pygpu
NumPy version 1.16.3
NumPy relaxed strides checking option: True
NumPy is installed in /home/nano/.local/lib/python3.6/site-packages/numpy
Python version 3.6.7 (default, Oct 22 2018, 11:32:17) [GCC 8.2.0]
nose version 1.3.7
*** Testing for Radeon RX 560 Series (POLARIS11, DRM 3.30.0, 5.1.0-rc5+, LLVM
8.0.0)
mpi4py found: True
.


AN INTERNAL KERNEL BUILD ERROR OCCURRED!
device name = Radeon RX 560 Series (POLARIS11, DRM 3.30.0, 5.1.0-rc5+, LLVM
8.0.0)
error = -43
memory pattern = Register accumulation based swap, computing kernel generator
Subproblem dimensions: dims[0].itemY = 32, dims[0].itemX = 32, dims[0].y = 32,
dims[0].x = 32, dims[0].bwidth = 64; ; dims[1].itemY = 4, dims[1].itemX = 4,
dims[1].y = 4, dims[1].x = 4, dims[1].bwidth = 8; ; 
Parallelism granularity: pgran->wgDim = 1, pgran->wgSize[0] = 64,
pgran->wgSize[1] = 1, pgran->wfSize = 64
Kernel extra flags: 369130144
Source:

#ifdef DOUBLE_PRECISION
#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
#else
#pragma OPENCL EXTENSION cl_amd_fp64 : enable
#endif
#endif

__kernel void Sdot_kernel( __global float *_X, __global float *_Y, __global
float *scratchBuff,
uint N, uint offx, int incx, uint offy,
int incy, int doConj )
{
__global float *X = _X + offx;
__global float *Y = _Y + offy;
float dotP = (float) 0.0;

if ( incx < 0 ) {
X = X + (N - 1) * abs(incx);
}
if ( incy < 0 ) {
Y = Y + (N - 1) * abs(incy);
}

int gOffset;
for( gOffset=(get_global_id(0) * 4); (gOffset + 4 - 1)___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] Add an ASSERTED macro to use in place of MAYBE_UNUSED?

2019-04-22 Thread Kristian Høgsberg
On Mon, Apr 22, 2019 at 12:11 PM Jason Ekstrand  wrote:
>
> All,
>
> I've seen discussions come up several times lately about whether you should 
> use MAYBE_UNUSED or UNUSED in what scenario and why do we have two of them 
> anyway.  That got me thinking a bit.  Maybe what we actually want instead of 
> MAYBE_UNUSED is something like this:
>
> #ifdef NDEBUG
> #define ASSERTED UNUSED
> #else
> #define ASSERTED
> #endif
>
> That way, if you only need a parameter for asserts, you can declare it 
> ASSERTED and it won't warn in release builds will still throw a warning if 
> you do a debug build which doesn't use it.  Of course, there are other times 
> when something is validly MAYBE_UNUSED such as auto-generated code or the 
> genX code we use on Intel.  However, this provides additional meaning and 
> means the compiler warnings are still useful even after you've relegated a 
> value to assert-only.
>
> Thoughts?  I'm also open to a better name; that's the best I could do in 5 
> minutes.

I think that's going in the wrong direction - if anything I think that
having both UNUSED and MAYBE_UNUSED is redundant and feel that just
UNUSED would be fine. __attribute__((unused)) doesn't mean "strictly
not used", it means "don't warn if this isn't used".

>
> --Jason
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] glsl: fix shader_storage_blocks_write_access for SSBO block arrays (v2)

2019-04-22 Thread Marek Olšák
Ping. Thanks.

On Tue, Apr 16, 2019 at 10:16 AM Marek Olšák  wrote:

> From: Marek Olšák 
>
> This fixes KHR-GL45.compute_shader.resources-max on radeonsi.
>
> Fixes: 4e1e8f684bf "glsl: remember which SSBOs are not read-only and pass
> it to gallium"
>
> v2: use is_interface_array, protect again assertion failures in
> u_bit_consecutive
> ---
>  src/compiler/glsl/link_uniforms.cpp | 22 +++---
>  1 file changed, 19 insertions(+), 3 deletions(-)
>
> diff --git a/src/compiler/glsl/link_uniforms.cpp
> b/src/compiler/glsl/link_uniforms.cpp
> index ef124111991..aa96227a7e1 100644
> --- a/src/compiler/glsl/link_uniforms.cpp
> +++ b/src/compiler/glsl/link_uniforms.cpp
> @@ -515,44 +515,60 @@ public:
>this->record_next_bindless_sampler = new string_to_uint_map;
>this->record_next_image = new string_to_uint_map;
>this->record_next_bindless_image = new string_to_uint_map;
>
>buffer_block_index = -1;
>if (var->is_in_buffer_block()) {
>   struct gl_uniform_block *blks =
> var->is_in_shader_storage_block() ?
>  prog->data->ShaderStorageBlocks : prog->data->UniformBlocks;
>   unsigned num_blks = var->is_in_shader_storage_block() ?
>  prog->data->NumShaderStorageBlocks :
> prog->data->NumUniformBlocks;
> + bool is_interface_array =
> +var->is_interface_instance() && var->type->is_array();
>
> - if (var->is_interface_instance() && var->type->is_array()) {
> + if (is_interface_array) {
>  unsigned l = strlen(var->get_interface_type()->name);
>
>  for (unsigned i = 0; i < num_blks; i++) {
> if (strncmp(var->get_interface_type()->name, blks[i].Name,
> l)
> == 0 && blks[i].Name[l] == '[') {
>buffer_block_index = i;
>break;
> }
>  }
>   } else {
>  for (unsigned i = 0; i < num_blks; i++) {
> if (strcmp(var->get_interface_type()->name, blks[i].Name)
> == 0) {
>buffer_block_index = i;
>break;
> }
>  }
>   }
>   assert(buffer_block_index != -1);
>
>   if (var->is_in_shader_storage_block() &&
> - !var->data.memory_read_only)
> -shader_storage_blocks_write_access |= 1 << buffer_block_index;
> + !var->data.memory_read_only) {
> +unsigned array_size = is_interface_array ?
> + var->type->array_size() : 1;
> +
> +STATIC_ASSERT(MAX_SHADER_STORAGE_BUFFERS <= 32);
> +
> +/* Shaders that use too many SSBOs will fail to compile, which
> + * we don't care about.
> + *
> + * This is true for shaders that do not use too many SSBOs:
> + */
> +if (buffer_block_index + array_size <= 32) {
> +   shader_storage_blocks_write_access |=
> +  u_bit_consecutive(buffer_block_index, array_size);
> +}
> + }
>
>   /* Uniform blocks that were specified with an instance name must
> be
>* handled a little bit differently.  The name of the variable
> is the
>* name used to reference the uniform block instead of being the
> name
>* of a variable within the block.  Therefore, searching for the
> name
>* within the block will fail.
>*/
>   if (var->is_interface_instance()) {
>  ubo_byte_offset = 0;
>  process(var->get_interface_type(),
> --
> 2.17.1
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [Bug 99553] Tracker bug for runnning OpenCL applications on Clover

2019-04-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=99553
Bug 99553 depends on bug 108879, which changed state.

Bug 108879 Summary: [CIK] [regression] All opencl apps hangs indefinitely in 
si_create_context
https://bugs.freedesktop.org/show_bug.cgi?id=108879

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [Bug 110462] Epic Games Launcher renders nothing with "-opengl" option

2019-04-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=110462

Marek Olšák  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #4 from Marek Olšák  ---
I pushed your fix. Closing.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] Add an ASSERTED macro to use in place of MAYBE_UNUSED?

2019-04-22 Thread Jason Ekstrand
All,

I've seen discussions come up several times lately about whether you should
use MAYBE_UNUSED or UNUSED in what scenario and why do we have two of them
anyway.  That got me thinking a bit.  Maybe what we actually want instead
of MAYBE_UNUSED is something like this:

#ifdef NDEBUG
#define ASSERTED UNUSED
#else
#define ASSERTED
#endif

That way, if you only need a parameter for asserts, you can declare it
ASSERTED and it won't warn in release builds will still throw a warning if
you do a debug build which doesn't use it.  Of course, there are other
times when something is validly MAYBE_UNUSED such as auto-generated code or
the genX code we use on Intel.  However, this provides additional meaning
and means the compiler warnings are still useful even after you've
relegated a value to assert-only.

Thoughts?  I'm also open to a better name; that's the best I could do in 5
minutes.

--Jason
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH] gallium: document conservative rasterization flags

2019-04-22 Thread Marek Olšák
From: Marek Olšák 

---
 src/gallium/docs/source/screen.rst   |  5 +
 src/gallium/include/pipe/p_defines.h | 11 +++
 2 files changed, 16 insertions(+)

diff --git a/src/gallium/docs/source/screen.rst 
b/src/gallium/docs/source/screen.rst
index b7b5f3504b2..41008816ee2 100644
--- a/src/gallium/docs/source/screen.rst
+++ b/src/gallium/docs/source/screen.rst
@@ -449,24 +449,29 @@ The integer capabilities:
 * ``PIPE_CAP_FENCE_SIGNAL``: True if the driver supports signaling semaphores
   using fence_server_signal().
 * ``PIPE_CAP_CONSTBUF0_FLAGS``: The bits of pipe_resource::flags that must be
   set when binding that buffer as constant buffer 0. If the buffer doesn't have
   those bits set, pipe_context::set_constant_buffer(.., 0, ..) is ignored
   by the driver, and the driver can throw assertion failures.
 * ``PIPE_CAP_PACKED_UNIFORMS``: True if the driver supports packed uniforms
   as opposed to padding to vec4s.
 * ``PIPE_CAP_CONSERVATIVE_RASTER_POST_SNAP_TRIANGLES``: Whether the
   ``PIPE_CONSERVATIVE_RASTER_POST_SNAP`` mode is supported for triangles.
+  The post-snap mode means the conservative rasterization occurs after
+  the conversion from floating-point to fixed-point coordinates
+  on the subpixel grid.
 * ``PIPE_CAP_CONSERVATIVE_RASTER_POST_SNAP_POINTS_LINES``: Whether the
   ``PIPE_CONSERVATIVE_RASTER_POST_SNAP`` mode is supported for points and 
lines.
 * ``PIPE_CAP_CONSERVATIVE_RASTER_PRE_SNAP_TRIANGLES``: Whether the
   ``PIPE_CONSERVATIVE_RASTER_PRE_SNAP`` mode is supported for triangles.
+  The pre-snap mode means the conservative rasterization occurs before
+  the conversion from floating-point to fixed-point coordinates.
 * ``PIPE_CAP_CONSERVATIVE_RASTER_PRE_SNAP_POINTS_LINES``: Whether the
   ``PIPE_CONSERVATIVE_RASTER_PRE_SNAP`` mode is supported for points and lines.
 * ``PIPE_CAP_CONSERVATIVE_RASTER_POST_DEPTH_COVERAGE``: Whether
   ``PIPE_CAP_POST_DEPTH_COVERAGE`` works with conservative rasterization.
 * ``PIPE_CAP_MAX_CONSERVATIVE_RASTER_SUBPIXEL_PRECISION_BIAS``: The maximum
   subpixel precision bias in bits during conservative rasterization.
 * ``PIPE_CAP_PROGRAMMABLE_SAMPLE_LOCATIONS``: True is the driver supports
   programmable sample location through ```get_sample_pixel_grid``` and
   ```set_sample_locations```.
 * ``PIPE_CAP_MAX_GS_INVOCATIONS``: Maximum supported value of
diff --git a/src/gallium/include/pipe/p_defines.h 
b/src/gallium/include/pipe/p_defines.h
index 9909e7f3ac1..72dc448aecc 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -637,21 +637,32 @@ enum pipe_reset_status
PIPE_UNKNOWN_CONTEXT_RESET,
 };
 
 
 /**
  * Conservative rasterization modes.
  */
 enum pipe_conservative_raster_mode
 {
PIPE_CONSERVATIVE_RASTER_OFF,
+
+   /**
+* The post-snap mode means the conservative rasterization occurs after
+* the conversion from floating-point to fixed-point coordinates
+* on the subpixel grid.
+*/
PIPE_CONSERVATIVE_RASTER_POST_SNAP,
+
+   /**
+* The pre-snap mode means the conservative rasterization occurs before
+* the conversion from floating-point to fixed-point coordinates.
+*/
PIPE_CONSERVATIVE_RASTER_PRE_SNAP,
 };
 
 
 /**
  * resource_get_handle flags.
  */
 /* Requires pipe_context::flush_resource before external use. */
 #define PIPE_HANDLE_USAGE_EXPLICIT_FLUSH (1 << 0)
 /* Expected external use of the resource: */
-- 
2.17.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH 1/3] ac/nir: only use the new raw/struct image atomic intrinsics with LLVM 9+

2019-04-22 Thread Marek Olšák
Is "XXX" in the comment really necessary?

Marek

On Thu, Apr 18, 2019 at 3:20 AM Samuel Pitoiset 
wrote:

> They are buggy with LLVM 8 because they weren't marked as source
> of divergence, see r358579.
>
> Fixes: dd0172e865f ("radv: Use structured intrinsics instead of indexing
> workaround for GFX9.")"
> Signed-off-by: Samuel Pitoiset 
> ---
>  src/amd/common/ac_nir_to_llvm.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/amd/common/ac_nir_to_llvm.c
> b/src/amd/common/ac_nir_to_llvm.c
> index 3890aebc982..fcd75903088 100644
> --- a/src/amd/common/ac_nir_to_llvm.c
> +++ b/src/amd/common/ac_nir_to_llvm.c
> @@ -2634,7 +2634,10 @@ static LLVMValueRef visit_image_atomic(struct
> ac_nir_context *ctx,
> params[param_count++] =
> LLVMBuildExtractElement(ctx->ac.builder, get_src(ctx, instr->src[1]),
>
> ctx->ac.i32_0, ""); /* vindex */
> params[param_count++] = ctx->ac.i32_0; /* voffset */
> -   if (HAVE_LLVM >= 0x800) {
> +   if (HAVE_LLVM >= 0x900) {
> +   /* XXX: The new raw/struct atomic intrinsics are
> buggy
> +* with LLVM 8, see r358579.
> +*/
> params[param_count++] = ctx->ac.i32_0; /* soffset
> */
> params[param_count++] = ctx->ac.i32_0;  /* slc */
>
> --
> 2.21.0
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [Bug 110479] AddressSanitizer:DEADLYSIGNAL in src/egl/drivers/dri2/platform_surfaceless.c:139

2019-04-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=110479

--- Comment #1 from Gustaw Smolarczyk  ---
I have looked at the trace. The source code line and struct offset imply that
dri2_egl_display::image_driver is NULL in dri2_surfaceless_create_surface
function. Of note is also the fact that a software renderer is used:

libEGL warning: No hardware driver found, falling back to software rendering

I see the following piece of code in dri2_wl_create_window_surface:

   if (dri2_dpy->image_driver)
  createNewDrawable = dri2_dpy->image_driver->createNewDrawable;
   else if (dri2_dpy->dri2)
  createNewDrawable = dri2_dpy->dri2->createNewDrawable;
   else
  createNewDrawable = dri2_dpy->swrast->createNewDrawable;

Shouldn't the surfaceless variant also try all three instead of relying on
image_driver not being NULL?

Note that I am not overly familiar with how dri works, so I might be wrong.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [AppVeyor] mesa master #10831 completed

2019-04-22 Thread AppVeyor


Build mesa 10831 completed



Commit b3e3440c87 by Samuel Pitoiset on 4/19/2019 10:40 AM:

radv: add VK_NV_compute_shader_derivates support\n\nOnly computeDerivativeGroupLinear is supported for now.\n\nAll crucible tests pass.\n\nSigned-off-by: Samuel Pitoiset \nReviewed-by: Bas Nieuwenhuizen 


Configure your notification preferences

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [Bug 110495] checkitbrp

2019-04-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=110495

Vsw23  changed:

   What|Removed |Added

 QA Contact|mesa-dev@lists.freedesktop. |vswadeya...@gmail.com
   |org |

-- 
You are receiving this mail because:
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [Bug 110495] checkitbrp

2019-04-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=110495

Bug ID: 110495
   Summary: checkitbrp
   Product: Mesa
   Version: 18.3
  Hardware: x86 (IA32)
OS: BSD (Others)
Status: NEW
  Severity: major
  Priority: high
 Component: Demos
  Assignee: vswade...@gmail.com
  Reporter: vswadeya...@gmail.com
QA Contact: mesa-dev@lists.freedesktop.org

Created attachment 144071
  --> https://bugs.freedesktop.org/attachment.cgi?id=144071=edit
india

do well

-- 
You are receiving this mail because:
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [Bug 110492] Mesa reports old GLSL version to programms using an older OpenGL version

2019-04-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=110492

Bug ID: 110492
   Summary: Mesa reports old GLSL version to programms using an
older OpenGL version
   Product: Mesa
   Version: 19.0
  Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
  Severity: normal
  Priority: medium
 Component: glsl-compiler
  Assignee: mesa-dev@lists.freedesktop.org
  Reporter: com...@live.de
QA Contact: intel-3d-b...@lists.freedesktop.org

Sorry if I am in the wrong section here.
There is an old case that effects an old OpenGl Application, Minecraft to be
precise with Shadermods that use an newer GLSL version. Unlike other OpenGL
Stacks, Mesa seems to only report an GLSL to the application that matches the
OpenGL version on release date. In this special case, overwriting the GLSL
seems to do nothing, probably due to the new electron launcher as it seem to
have worked with the older java based one.
Here in a thread about this issue on the shadermods bugtracker:
https://github.com/sp614x/optifine/issues/420https://github.com/sp614x/optifine/issues/420

-- 
You are receiving this mail because:
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH v2] radv: only load 2-dwords for vertex buffers when robustness is disabled

2019-04-22 Thread Bas Nieuwenhuizen
Reviewed-by: Bas Nieuwenhuizen 

On Tue, Mar 19, 2019 at 9:42 AM Samuel Pitoiset
 wrote:
>
> This patch requires the typed vertex fetches series.
>
> Totals from affected shaders:
> SGPRS: 445574 -> 452638 (1.59 %)
> VGPRS: 373392 -> 370436 (-0.79 %)
> Spilled SGPRs: 77 -> 14 (-81.82 %)
> Spilled VGPRs: 0 -> 0 (0.00 %)
> Code Size: 14162288 -> 14413036 (1.77 %) bytes
> Max Waves: 11 -> 120509 (0.43 %)
>
> v2: - fix vertex descriptors
>
> Signed-off-by: Samuel Pitoiset 
> ---
>  src/amd/vulkan/radv_cmd_buffer.c  | 32 +++
>  src/amd/vulkan/radv_device.c  |  2 ++
>  src/amd/vulkan/radv_nir_to_llvm.c | 21 +++-
>  src/amd/vulkan/radv_private.h |  1 +
>  src/amd/vulkan/radv_shader.c  |  1 +
>  src/amd/vulkan/radv_shader.h  |  1 +
>  6 files changed, 45 insertions(+), 13 deletions(-)
>
> diff --git a/src/amd/vulkan/radv_cmd_buffer.c 
> b/src/amd/vulkan/radv_cmd_buffer.c
> index ae8f50d0348..0c8572bd1e5 100644
> --- a/src/amd/vulkan/radv_cmd_buffer.c
> +++ b/src/amd/vulkan/radv_cmd_buffer.c
> @@ -1991,6 +1991,7 @@ radv_flush_vertex_descriptors(struct radv_cmd_buffer 
> *cmd_buffer,
> cmd_buffer->state.pipeline->num_vertex_bindings &&
> radv_get_shader(cmd_buffer->state.pipeline, 
> MESA_SHADER_VERTEX)->info.info.vs.has_vertex_buffers) {
> struct radv_vertex_elements_info *velems = 
> _buffer->state.pipeline->vertex_elements;
> +   unsigned desc_size_bytes = 
> cmd_buffer->device->robust_buffer_access ? 16 : 8;
> unsigned vb_offset;
> void *vb_ptr;
> uint32_t i = 0;
> @@ -1998,12 +1999,13 @@ radv_flush_vertex_descriptors(struct radv_cmd_buffer 
> *cmd_buffer,
> uint64_t va;
>
> /* allocate some descriptor state for vertex buffers */
> -   if (!radv_cmd_buffer_upload_alloc(cmd_buffer, count * 16, 256,
> +   if (!radv_cmd_buffer_upload_alloc(cmd_buffer,
> + count * desc_size_bytes, 
> 256,
>   _offset, _ptr))
> return;
>
> for (i = 0; i < count; i++) {
> -   uint32_t *desc = &((uint32_t *)vb_ptr)[i * 4];
> +   uint32_t *desc = &((uint32_t *)vb_ptr)[i * 
> (desc_size_bytes / 4)];
> uint32_t offset;
> struct radv_buffer *buffer = 
> cmd_buffer->vertex_bindings[i].buffer;
> uint32_t stride = 
> cmd_buffer->state.pipeline->binding_stride[i];
> @@ -2017,16 +2019,22 @@ radv_flush_vertex_descriptors(struct radv_cmd_buffer 
> *cmd_buffer,
> va += offset + buffer->offset;
> desc[0] = va;
> desc[1] = S_008F04_BASE_ADDRESS_HI(va >> 32) | 
> S_008F04_STRIDE(stride);
> -   if 
> (cmd_buffer->device->physical_device->rad_info.chip_class <= CIK && stride)
> -   desc[2] = (buffer->size - offset - 
> velems->format_size[i]) / stride + 1;
> -   else
> -   desc[2] = buffer->size - offset;
> -   desc[3] = S_008F0C_DST_SEL_X(V_008F0C_SQ_SEL_X) |
> - S_008F0C_DST_SEL_Y(V_008F0C_SQ_SEL_Y) |
> - S_008F0C_DST_SEL_Z(V_008F0C_SQ_SEL_Z) |
> - S_008F0C_DST_SEL_W(V_008F0C_SQ_SEL_W) |
> - 
> S_008F0C_NUM_FORMAT(V_008F0C_BUF_NUM_FORMAT_UINT) |
> - 
> S_008F0C_DATA_FORMAT(V_008F0C_BUF_DATA_FORMAT_32);
> +
> +   if (cmd_buffer->device->robust_buffer_access) {
> +   /* Enable out of bounds checking only when
> +* robust buffer access is requested.
> +*/
> +   if 
> (cmd_buffer->device->physical_device->rad_info.chip_class <= CIK && stride)
> +   desc[2] = (buffer->size - offset - 
> velems->format_size[i]) / stride + 1;
> +   else
> +   desc[2] = buffer->size - offset;
> +   desc[3] = 
> S_008F0C_DST_SEL_X(V_008F0C_SQ_SEL_X) |
> + 
> S_008F0C_DST_SEL_Y(V_008F0C_SQ_SEL_Y) |
> + 
> S_008F0C_DST_SEL_Z(V_008F0C_SQ_SEL_Z) |
> + 
> S_008F0C_DST_SEL_W(V_008F0C_SQ_SEL_W) |
> + 
> S_008F0C_NUM_FORMAT(V_008F0C_BUF_NUM_FORMAT_UINT) |
> + 
> S_008F0C_DATA_FORMAT(V_008F0C_BUF_DATA_FORMAT_32);
> +   }
> }
>
> va = 

Re: [Mesa-dev] [PATCH] radv: add VK_NV_compute_shader_derivates support

2019-04-22 Thread Bas Nieuwenhuizen
On Fri, Apr 19, 2019 at 12:37 PM Samuel Pitoiset
 wrote:
>
> Only computeDerivativeGroupLinear is supported for now.

Reviewed-by: Bas Nieuwenhuizen 
>
> All crucible tests pass.
>
> Signed-off-by: Samuel Pitoiset 
> ---
>  src/amd/vulkan/radv_device.c  | 7 +++
>  src/amd/vulkan/radv_extensions.py | 1 +
>  src/amd/vulkan/radv_shader.c  | 1 +
>  3 files changed, 9 insertions(+)
>
> diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
> index 774ee5b91df..a31860eabf4 100644
> --- a/src/amd/vulkan/radv_device.c
> +++ b/src/amd/vulkan/radv_device.c
> @@ -927,6 +927,13 @@ void radv_GetPhysicalDeviceFeatures2(
> 
> features->descriptorBindingInlineUniformBlockUpdateAfterBind = true;
> break;
> }
> +   case 
> VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV: {
> +   VkPhysicalDeviceComputeShaderDerivativesFeaturesNV 
> *features =
> +   
> (VkPhysicalDeviceComputeShaderDerivativesFeaturesNV *)ext;
> +   features->computeDerivativeGroupQuads = false;
> +   features->computeDerivativeGroupLinear = true;
> +   break;
> +   }
> default:
> break;
> }
> diff --git a/src/amd/vulkan/radv_extensions.py 
> b/src/amd/vulkan/radv_extensions.py
> index 40fc585c503..9743ce1a774 100644
> --- a/src/amd/vulkan/radv_extensions.py
> +++ b/src/amd/vulkan/radv_extensions.py
> @@ -133,6 +133,7 @@ EXTENSIONS = [
>  Extension('VK_AMD_shader_trinary_minmax', 1, True),
>  Extension('VK_GOOGLE_decorate_string',1, True),
>  Extension('VK_GOOGLE_hlsl_functionality1',1, True),
> +Extension('VK_NV_compute_shader_derivatives', 1, 
> 'device->rad_info.chip_class >= VI'),
>  ]
>
>  class VkVersion:
> diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
> index c802abb0e08..13f1f9aa9dc 100644
> --- a/src/amd/vulkan/radv_shader.c
> +++ b/src/amd/vulkan/radv_shader.c
> @@ -223,6 +223,7 @@ radv_shader_compile_to_nir(struct radv_device *device,
> const struct spirv_to_nir_options spirv_options = {
> .lower_ubo_ssbo_access_to_offsets = true,
> .caps = {
> +   .derivative_group = true,
> .descriptor_array_dynamic_indexing = true,
> .device_group = true,
> .draw_parameters = true,
> --
> 2.21.0
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [Bug 109183] GPU Hangs randomly with GTA V

2019-04-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=109183

soredake  changed:

   What|Removed |Added

 CC||fds...@krutt.org

-- 
You are receiving this mail because:
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev