Re: [Mesa-dev] [PATCH 3/4] radeonsi: add radeonsi_zerovram driconfig option

2018-09-03 Thread Marek Olšák
On Mon, Sep 3, 2018 at 6:29 AM, Timothy Arceri  wrote:
>
>
> On 28/08/18 04:26, Marek Olšák wrote:
>>
>> On Fri, Aug 24, 2018 at 10:33 AM, Michel Dänzer 
>> wrote:
>>>
>>> On 2018-08-24 1:06 p.m., Timothy Arceri wrote:

 More and more games seem to require this so lets make it a config
 option.
 ---
   src/gallium/drivers/radeonsi/driinfo_radeonsi.h |  1 +
   src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c   | 10 +++---
   src/util/xmlpool/t_options.h|  5 +
   3 files changed, 13 insertions(+), 3 deletions(-)

 diff --git a/src/gallium/drivers/radeonsi/driinfo_radeonsi.h
 b/src/gallium/drivers/radeonsi/driinfo_radeonsi.h
 index 7f57b4ea892..8c5078c13f3 100644
 --- a/src/gallium/drivers/radeonsi/driinfo_radeonsi.h
 +++ b/src/gallium/drivers/radeonsi/driinfo_radeonsi.h
 @@ -3,6 +3,7 @@ DRI_CONF_SECTION_PERFORMANCE
   DRI_CONF_RADEONSI_ENABLE_SISCHED("false")
   DRI_CONF_RADEONSI_ASSUME_NO_Z_FIGHTS("false")
   DRI_CONF_RADEONSI_COMMUTATIVE_BLEND_ADD("false")
 +DRI_CONF_RADEONSI_ZERO_ALL_VRAM_ALLOCS("false")
   DRI_CONF_SECTION_END

   [...]

 @@ -414,3 +414,8 @@ DRI_CONF_OPT_END
   DRI_CONF_OPT_BEGIN_B(radeonsi_clear_db_cache_before_clear, def) \
   DRI_CONF_DESC(en,"Clear DB cache before fast depth clear") \
   DRI_CONF_OPT_END
 +
 +#define DRI_CONF_RADEONSI_ZERO_ALL_VRAM_ALLOCS(def) \
 +DRI_CONF_OPT_BEGIN_B(radeonsi_zerovram, def) \
 +DRI_CONF_DESC(en,"Zero all vram allocations") \
 +DRI_CONF_OPT_END

>>>
>>> I'd name the option simply "zerovram", so it could be used by other
>>> drivers as well.
>>>
>>>
>>> BTW, AFAICT, currently this only affects BOs allocated from the kernel,
>>> not those re-used from the BO cache. I wonder if that couldn't still
>>> cause trouble with some apps.
>>
>>
>> It could.
>
>
> Maybe related to this?
>
> https://bugs.freedesktop.org/show_bug.cgi?id=65968#c12

I don't know. BTW, I've sent a patch that clears VRAM differently,
including reused buffers.

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


Re: [Mesa-dev] [PATCH 3/4] radeonsi: add radeonsi_zerovram driconfig option

2018-09-03 Thread Timothy Arceri



On 28/08/18 04:26, Marek Olšák wrote:

On Fri, Aug 24, 2018 at 10:33 AM, Michel Dänzer  wrote:

On 2018-08-24 1:06 p.m., Timothy Arceri wrote:

More and more games seem to require this so lets make it a config
option.
---
  src/gallium/drivers/radeonsi/driinfo_radeonsi.h |  1 +
  src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c   | 10 +++---
  src/util/xmlpool/t_options.h|  5 +
  3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/driinfo_radeonsi.h 
b/src/gallium/drivers/radeonsi/driinfo_radeonsi.h
index 7f57b4ea892..8c5078c13f3 100644
--- a/src/gallium/drivers/radeonsi/driinfo_radeonsi.h
+++ b/src/gallium/drivers/radeonsi/driinfo_radeonsi.h
@@ -3,6 +3,7 @@ DRI_CONF_SECTION_PERFORMANCE
  DRI_CONF_RADEONSI_ENABLE_SISCHED("false")
  DRI_CONF_RADEONSI_ASSUME_NO_Z_FIGHTS("false")
  DRI_CONF_RADEONSI_COMMUTATIVE_BLEND_ADD("false")
+DRI_CONF_RADEONSI_ZERO_ALL_VRAM_ALLOCS("false")
  DRI_CONF_SECTION_END

  [...]

@@ -414,3 +414,8 @@ DRI_CONF_OPT_END
  DRI_CONF_OPT_BEGIN_B(radeonsi_clear_db_cache_before_clear, def) \
  DRI_CONF_DESC(en,"Clear DB cache before fast depth clear") \
  DRI_CONF_OPT_END
+
+#define DRI_CONF_RADEONSI_ZERO_ALL_VRAM_ALLOCS(def) \
+DRI_CONF_OPT_BEGIN_B(radeonsi_zerovram, def) \
+DRI_CONF_DESC(en,"Zero all vram allocations") \
+DRI_CONF_OPT_END



I'd name the option simply "zerovram", so it could be used by other
drivers as well.


BTW, AFAICT, currently this only affects BOs allocated from the kernel,
not those re-used from the BO cache. I wonder if that couldn't still
cause trouble with some apps.


It could.


Maybe related to this?

https://bugs.freedesktop.org/show_bug.cgi?id=65968#c12


Anyway:

Reviewed-by: Marek Olšák 

Marek




--
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
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 mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 3/4] radeonsi: add radeonsi_zerovram driconfig option

2018-08-27 Thread Marek Olšák
On Fri, Aug 24, 2018 at 10:33 AM, Michel Dänzer  wrote:
> On 2018-08-24 1:06 p.m., Timothy Arceri wrote:
>> More and more games seem to require this so lets make it a config
>> option.
>> ---
>>  src/gallium/drivers/radeonsi/driinfo_radeonsi.h |  1 +
>>  src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c   | 10 +++---
>>  src/util/xmlpool/t_options.h|  5 +
>>  3 files changed, 13 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/gallium/drivers/radeonsi/driinfo_radeonsi.h 
>> b/src/gallium/drivers/radeonsi/driinfo_radeonsi.h
>> index 7f57b4ea892..8c5078c13f3 100644
>> --- a/src/gallium/drivers/radeonsi/driinfo_radeonsi.h
>> +++ b/src/gallium/drivers/radeonsi/driinfo_radeonsi.h
>> @@ -3,6 +3,7 @@ DRI_CONF_SECTION_PERFORMANCE
>>  DRI_CONF_RADEONSI_ENABLE_SISCHED("false")
>>  DRI_CONF_RADEONSI_ASSUME_NO_Z_FIGHTS("false")
>>  DRI_CONF_RADEONSI_COMMUTATIVE_BLEND_ADD("false")
>> +DRI_CONF_RADEONSI_ZERO_ALL_VRAM_ALLOCS("false")
>>  DRI_CONF_SECTION_END
>>
>>  [...]
>>
>> @@ -414,3 +414,8 @@ DRI_CONF_OPT_END
>>  DRI_CONF_OPT_BEGIN_B(radeonsi_clear_db_cache_before_clear, def) \
>>  DRI_CONF_DESC(en,"Clear DB cache before fast depth clear") \
>>  DRI_CONF_OPT_END
>> +
>> +#define DRI_CONF_RADEONSI_ZERO_ALL_VRAM_ALLOCS(def) \
>> +DRI_CONF_OPT_BEGIN_B(radeonsi_zerovram, def) \
>> +DRI_CONF_DESC(en,"Zero all vram allocations") \
>> +DRI_CONF_OPT_END
>>
>
> I'd name the option simply "zerovram", so it could be used by other
> drivers as well.
>
>
> BTW, AFAICT, currently this only affects BOs allocated from the kernel,
> not those re-used from the BO cache. I wonder if that couldn't still
> cause trouble with some apps.

It could. Anyway:

Reviewed-by: Marek Olšák 

Marek

>
>
> --
> Earthling Michel Dänzer   |   http://www.amd.com
> Libre software enthusiast | Mesa and X developer
> ___
> 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 3/4] radeonsi: add radeonsi_zerovram driconfig option

2018-08-24 Thread Michel Dänzer
On 2018-08-24 1:06 p.m., Timothy Arceri wrote:
> More and more games seem to require this so lets make it a config
> option.
> ---
>  src/gallium/drivers/radeonsi/driinfo_radeonsi.h |  1 +
>  src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c   | 10 +++---
>  src/util/xmlpool/t_options.h|  5 +
>  3 files changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/src/gallium/drivers/radeonsi/driinfo_radeonsi.h 
> b/src/gallium/drivers/radeonsi/driinfo_radeonsi.h
> index 7f57b4ea892..8c5078c13f3 100644
> --- a/src/gallium/drivers/radeonsi/driinfo_radeonsi.h
> +++ b/src/gallium/drivers/radeonsi/driinfo_radeonsi.h
> @@ -3,6 +3,7 @@ DRI_CONF_SECTION_PERFORMANCE
>  DRI_CONF_RADEONSI_ENABLE_SISCHED("false")
>  DRI_CONF_RADEONSI_ASSUME_NO_Z_FIGHTS("false")
>  DRI_CONF_RADEONSI_COMMUTATIVE_BLEND_ADD("false")
> +DRI_CONF_RADEONSI_ZERO_ALL_VRAM_ALLOCS("false")
>  DRI_CONF_SECTION_END
>  
>  [...]
>  
> @@ -414,3 +414,8 @@ DRI_CONF_OPT_END
>  DRI_CONF_OPT_BEGIN_B(radeonsi_clear_db_cache_before_clear, def) \
>  DRI_CONF_DESC(en,"Clear DB cache before fast depth clear") \
>  DRI_CONF_OPT_END
> +
> +#define DRI_CONF_RADEONSI_ZERO_ALL_VRAM_ALLOCS(def) \
> +DRI_CONF_OPT_BEGIN_B(radeonsi_zerovram, def) \
> +DRI_CONF_DESC(en,"Zero all vram allocations") \
> +DRI_CONF_OPT_END
> 

I'd name the option simply "zerovram", so it could be used by other
drivers as well.


BTW, AFAICT, currently this only affects BOs allocated from the kernel,
not those re-used from the BO cache. I wonder if that couldn't still
cause trouble with some apps.


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 3/4] radeonsi: add radeonsi_zerovram driconfig option

2018-08-24 Thread Timothy Arceri
More and more games seem to require this so lets make it a config
option.
---
 src/gallium/drivers/radeonsi/driinfo_radeonsi.h |  1 +
 src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c   | 10 +++---
 src/util/xmlpool/t_options.h|  5 +
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/driinfo_radeonsi.h 
b/src/gallium/drivers/radeonsi/driinfo_radeonsi.h
index 7f57b4ea892..8c5078c13f3 100644
--- a/src/gallium/drivers/radeonsi/driinfo_radeonsi.h
+++ b/src/gallium/drivers/radeonsi/driinfo_radeonsi.h
@@ -3,6 +3,7 @@ DRI_CONF_SECTION_PERFORMANCE
 DRI_CONF_RADEONSI_ENABLE_SISCHED("false")
 DRI_CONF_RADEONSI_ASSUME_NO_Z_FIGHTS("false")
 DRI_CONF_RADEONSI_COMMUTATIVE_BLEND_ADD("false")
+DRI_CONF_RADEONSI_ZERO_ALL_VRAM_ALLOCS("false")
 DRI_CONF_SECTION_END
 
 DRI_CONF_SECTION_DEBUG
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c 
b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
index 882f500bc69..dcbc075e3c5 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
@@ -32,6 +32,7 @@
 
 #include "util/u_hash_table.h"
 #include "util/hash_table.h"
+#include "util/xmlconfig.h"
 #include 
 #include 
 #include 
@@ -49,7 +50,9 @@ static simple_mtx_t dev_tab_mutex = 
_SIMPLE_MTX_INITIALIZER_NP;
 DEBUG_GET_ONCE_BOOL_OPTION(all_bos, "RADEON_ALL_BOS", false)
 
 /* Helper function to do the ioctls needed for setup and init. */
-static bool do_winsys_init(struct amdgpu_winsys *ws, int fd)
+static bool do_winsys_init(struct amdgpu_winsys *ws,
+   const struct pipe_screen_config *config,
+   int fd)
 {
if (!ac_query_gpu_info(fd, ws->dev, &ws->info, &ws->amdinfo))
   goto fail;
@@ -63,7 +66,8 @@ static bool do_winsys_init(struct amdgpu_winsys *ws, int fd)
ws->check_vm = strstr(debug_get_option("R600_DEBUG", ""), "check_vm") != 
NULL;
ws->debug_all_bos = debug_get_option_all_bos();
ws->reserve_vmid = strstr(debug_get_option("R600_DEBUG", ""), 
"reserve_vmid") != NULL;
-   ws->zero_all_vram_allocs = strstr(debug_get_option("R600_DEBUG", ""), 
"zerovram") != NULL;
+   ws->zero_all_vram_allocs = strstr(debug_get_option("R600_DEBUG", ""), 
"zerovram") != NULL ||
+  driQueryOptionb(config->options, "radeonsi_zerovram");
 
return true;
 
@@ -279,7 +283,7 @@ amdgpu_winsys_create(int fd, const struct 
pipe_screen_config *config,
ws->info.drm_major = drm_major;
ws->info.drm_minor = drm_minor;
 
-   if (!do_winsys_init(ws, fd))
+   if (!do_winsys_init(ws, config, fd))
   goto fail_alloc;
 
/* Create managers. */
diff --git a/src/util/xmlpool/t_options.h b/src/util/xmlpool/t_options.h
index ecf495a2f29..945d0e60f90 100644
--- a/src/util/xmlpool/t_options.h
+++ b/src/util/xmlpool/t_options.h
@@ -414,3 +414,8 @@ DRI_CONF_OPT_END
 DRI_CONF_OPT_BEGIN_B(radeonsi_clear_db_cache_before_clear, def) \
 DRI_CONF_DESC(en,"Clear DB cache before fast depth clear") \
 DRI_CONF_OPT_END
+
+#define DRI_CONF_RADEONSI_ZERO_ALL_VRAM_ALLOCS(def) \
+DRI_CONF_OPT_BEGIN_B(radeonsi_zerovram, def) \
+DRI_CONF_DESC(en,"Zero all vram allocations") \
+DRI_CONF_OPT_END
-- 
2.17.1

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