summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/v3d
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-05-01 15:02:27 -0700
committerEric Anholt <[email protected]>2019-05-13 12:03:11 -0700
commit60a64f028d75ad6ca13468490adf1748cf9f1ec0 (patch)
tree7cdc160a916fc95db2c1154490e9d741df80d210 /src/gallium/drivers/v3d
parent0c31fe9ee743f699bcabcb638ccc83e515f0d1bd (diff)
v3d: Use driconf to expose non-MSAA texture limits for Xorg.
The V3D 4.2 HW has a limit to MSAA texture sizes of 4096. With non-MSAA, we can go up to 7680 (actually probably 8138, but that hasn't been validated by the HW team). Exposing 7680 in X11 will allow dual 4k displays.
Diffstat (limited to 'src/gallium/drivers/v3d')
-rw-r--r--src/gallium/drivers/v3d/driinfo_v3d.h5
-rw-r--r--src/gallium/drivers/v3d/meson.build17
-rw-r--r--src/gallium/drivers/v3d/v3d_screen.c14
-rw-r--r--src/gallium/drivers/v3d/v3d_screen.h5
4 files changed, 38 insertions, 3 deletions
diff --git a/src/gallium/drivers/v3d/driinfo_v3d.h b/src/gallium/drivers/v3d/driinfo_v3d.h
new file mode 100644
index 00000000000..5ea458571e3
--- /dev/null
+++ b/src/gallium/drivers/v3d/driinfo_v3d.h
@@ -0,0 +1,5 @@
+// v3d-specific driconf options
+
+DRI_CONF_SECTION_MISCELLANEOUS
+ DRI_CONF_V3D_NONMSAA_TEXTURE_SIZE_LIMIT("false")
+DRI_CONF_SECTION_END
diff --git a/src/gallium/drivers/v3d/meson.build b/src/gallium/drivers/v3d/meson.build
index 7f9fdf10ac2..297ff5ce639 100644
--- a/src/gallium/drivers/v3d/meson.build
+++ b/src/gallium/drivers/v3d/meson.build
@@ -50,6 +50,16 @@ files_per_version = files(
'v3dx_state.c',
)
+v3d_driinfo_h = custom_target(
+ 'v3d_driinfo.h',
+ input : files(
+ '../../../util/merge_driinfo.py',
+ '../../auxiliary/pipe-loader/driinfo_gallium.h', 'driinfo_v3d.h'
+ ),
+ output : 'v3d_driinfo.h',
+ command : [prog_python, '@INPUT@'],
+ capture : true,
+)
v3d_args = ['-DV3D_BUILD_NEON']
dep_v3dv3 = dependency('v3dv3', required: false)
@@ -93,7 +103,11 @@ libv3d_neon = static_library(
libv3d = static_library(
'v3d',
- [files_libv3d, v3d_xml_pack],
+ [
+ files_libv3d,
+ v3d_xml_pack,
+ v3d_driinfo_h
+ ],
include_directories : [
inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_broadcom,
inc_gallium_drivers,
@@ -107,5 +121,6 @@ libv3d = static_library(
driver_v3d = declare_dependency(
compile_args : '-DGALLIUM_V3D',
link_with : [libv3d, libv3dwinsys, libbroadcom_cle, libbroadcom_v3d],
+ sources : v3d_driinfo_h,
dependencies : idep_nir,
)
diff --git a/src/gallium/drivers/v3d/v3d_screen.c b/src/gallium/drivers/v3d/v3d_screen.c
index e902be05474..f6edf15bdf8 100644
--- a/src/gallium/drivers/v3d/v3d_screen.c
+++ b/src/gallium/drivers/v3d/v3d_screen.c
@@ -36,6 +36,7 @@
#include "util/u_screen.h"
#include "util/u_transfer_helper.h"
#include "util/ralloc.h"
+#include "util/xmlconfig.h"
#include <xf86drm.h>
#include "v3d_screen.h"
@@ -208,6 +209,8 @@ v3d_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_MAX_TEXTURE_2D_SIZE:
if (screen->devinfo.ver < 40)
return 2048;
+ else if (screen->nonmsaa_texture_size_limit)
+ return 7680;
else
return 4096;
case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
@@ -665,7 +668,8 @@ v3d_screen_query_dmabuf_modifiers(struct pipe_screen *pscreen,
}
struct pipe_screen *
-v3d_screen_create(int fd, struct renderonly *ro)
+v3d_screen_create(int fd, const struct pipe_screen_config *config,
+ struct renderonly *ro)
{
struct v3d_screen *screen = rzalloc(NULL, struct v3d_screen);
struct pipe_screen *pscreen;
@@ -700,6 +704,14 @@ v3d_screen_create(int fd, struct renderonly *ro)
if (!v3d_get_device_info(screen))
goto fail;
+ /* We have to driCheckOption for the simulator mode to not assertion
+ * fail on not having our XML config.
+ */
+ const char *nonmsaa_name = "v3d_nonmsaa_texture_size_limit";
+ screen->nonmsaa_texture_size_limit =
+ driCheckOption(config->options, nonmsaa_name, DRI_BOOL) &&
+ driQueryOptionb(config->options, nonmsaa_name);
+
slab_create_parent(&screen->transfer_pool, sizeof(struct v3d_transfer), 16);
screen->has_csd = false; /* until the UABI is enabled. */
diff --git a/src/gallium/drivers/v3d/v3d_screen.h b/src/gallium/drivers/v3d/v3d_screen.h
index 6e90755e77c..2f276ac9b0d 100644
--- a/src/gallium/drivers/v3d/v3d_screen.h
+++ b/src/gallium/drivers/v3d/v3d_screen.h
@@ -78,6 +78,7 @@ struct v3d_screen {
uint32_t bo_count;
bool has_csd;
+ bool nonmsaa_texture_size_limit;
struct v3d_simulator_file *sim_file;
};
@@ -88,7 +89,9 @@ v3d_screen(struct pipe_screen *screen)
return (struct v3d_screen *)screen;
}
-struct pipe_screen *v3d_screen_create(int fd, struct renderonly *ro);
+struct pipe_screen *v3d_screen_create(int fd,
+ const struct pipe_screen_config *config,
+ struct renderonly *ro);
void
v3d_fence_init(struct v3d_screen *screen);