summaryrefslogtreecommitdiffstats
path: root/src/gallium
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
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')
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c3
-rw-r--r--src/gallium/auxiliary/target-helpers/drm_helper.h13
-rw-r--r--src/gallium/auxiliary/target-helpers/drm_helper_public.h1
-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
-rw-r--r--src/gallium/winsys/kmsro/drm/kmsro_drm_public.h4
-rw-r--r--src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c7
-rw-r--r--src/gallium/winsys/v3d/drm/v3d_drm_public.h7
-rw-r--r--src/gallium/winsys/v3d/drm/v3d_drm_winsys.c9
-rw-r--r--src/gallium/winsys/vc4/drm/vc4_drm_public.h6
-rw-r--r--src/gallium/winsys/vc4/drm/vc4_drm_winsys.c7
13 files changed, 76 insertions, 22 deletions
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
index 3006f78311a..9d75a9868e2 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
@@ -111,10 +111,12 @@ static const struct drm_driver_descriptor driver_descriptors[] = {
{
.driver_name = "v3d",
.create_screen = pipe_v3d_create_screen,
+ .driconf_xml = &v3d_driconf_xml,
},
{
.driver_name = "vc4",
.create_screen = pipe_vc4_create_screen,
+ .driconf_xml = &v3d_driconf_xml,
},
{
.driver_name = "panfrost",
@@ -137,6 +139,7 @@ static const struct drm_driver_descriptor driver_descriptors[] = {
static const struct drm_driver_descriptor default_driver_descriptor = {
.driver_name = "kmsro",
.create_screen = pipe_kmsro_create_screen,
+ .driconf_xml = &v3d_driconf_xml,
};
#endif
diff --git a/src/gallium/auxiliary/target-helpers/drm_helper.h b/src/gallium/auxiliary/target-helpers/drm_helper.h
index 830c0abcb7f..ac891d1d307 100644
--- a/src/gallium/auxiliary/target-helpers/drm_helper.h
+++ b/src/gallium/auxiliary/target-helpers/drm_helper.h
@@ -96,7 +96,7 @@ pipe_kmsro_create_screen(int fd, const struct pipe_screen_config *config)
{
struct pipe_screen *screen;
- screen = kmsro_drm_screen_create(fd);
+ screen = kmsro_drm_screen_create(fd, config);
return screen ? debug_screen_wrap(screen) : NULL;
}
@@ -281,10 +281,9 @@ pipe_vc4_create_screen(int fd, const struct pipe_screen_config *config)
{
struct pipe_screen *screen;
- screen = vc4_drm_screen_create(fd);
+ screen = vc4_drm_screen_create(fd, config);
return screen ? debug_screen_wrap(screen) : NULL;
}
-
#else
struct pipe_screen *
@@ -304,10 +303,14 @@ pipe_v3d_create_screen(int fd, const struct pipe_screen_config *config)
{
struct pipe_screen *screen;
- screen = v3d_drm_screen_create(fd);
+ screen = v3d_drm_screen_create(fd, config);
return screen ? debug_screen_wrap(screen) : NULL;
}
+const char *v3d_driconf_xml =
+ #include "v3d/v3d_driinfo.h"
+ ;
+
#else
struct pipe_screen *
@@ -317,6 +320,8 @@ pipe_v3d_create_screen(int fd, const struct pipe_screen_config *config)
return NULL;
}
+const char *v3d_driconf_xml = NULL;
+
#endif
#ifdef GALLIUM_PANFROST
diff --git a/src/gallium/auxiliary/target-helpers/drm_helper_public.h b/src/gallium/auxiliary/target-helpers/drm_helper_public.h
index fedb5c0fc17..a3cb9279fd5 100644
--- a/src/gallium/auxiliary/target-helpers/drm_helper_public.h
+++ b/src/gallium/auxiliary/target-helpers/drm_helper_public.h
@@ -6,6 +6,7 @@ struct pipe_screen_config;
const char *iris_driconf_xml;
const char *radeonsi_driconf_xml;
+const char *v3d_driconf_xml;
struct pipe_screen *
pipe_i915_create_screen(int fd, const struct pipe_screen_config *config);
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);
diff --git a/src/gallium/winsys/kmsro/drm/kmsro_drm_public.h b/src/gallium/winsys/kmsro/drm/kmsro_drm_public.h
index 4da4e4b72ba..9d81ea3ee39 100644
--- a/src/gallium/winsys/kmsro/drm/kmsro_drm_public.h
+++ b/src/gallium/winsys/kmsro/drm/kmsro_drm_public.h
@@ -28,7 +28,9 @@
#define __KMSRO_DRM_PUBLIC_H__
struct pipe_screen;
+struct pipe_screen_config;
-struct pipe_screen *kmsro_drm_screen_create(int fd);
+struct pipe_screen *kmsro_drm_screen_create(int fd,
+ const struct pipe_screen_config *config);
#endif /* __KMSRO_DRM_PUBLIC_H__ */
diff --git a/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c b/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c
index 3a452f91315..bf599a1497c 100644
--- a/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c
+++ b/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c
@@ -37,7 +37,8 @@
#include "pipe/p_screen.h"
#include "renderonly/renderonly.h"
-struct pipe_screen *kmsro_drm_screen_create(int fd)
+struct pipe_screen *kmsro_drm_screen_create(int fd,
+ const struct pipe_screen_config *config)
{
struct pipe_screen *screen = NULL;
struct renderonly ro = {
@@ -53,7 +54,7 @@ struct pipe_screen *kmsro_drm_screen_create(int fd)
* flag on allocation will have ensured.
*/
ro.create_for_resource = renderonly_create_gpu_import_for_resource,
- screen = vc4_drm_screen_create_renderonly(&ro);
+ screen = vc4_drm_screen_create_renderonly(&ro, config);
if (!screen)
close(ro.gpu_fd);
@@ -114,7 +115,7 @@ struct pipe_screen *kmsro_drm_screen_create(int fd)
ro.gpu_fd = drmOpenWithType("v3d", NULL, DRM_NODE_RENDER);
if (ro.gpu_fd >= 0) {
ro.create_for_resource = renderonly_create_kms_dumb_buffer_for_resource,
- screen = v3d_drm_screen_create_renderonly(&ro);
+ screen = v3d_drm_screen_create_renderonly(&ro, config);
if (!screen)
close(ro.gpu_fd);
diff --git a/src/gallium/winsys/v3d/drm/v3d_drm_public.h b/src/gallium/winsys/v3d/drm/v3d_drm_public.h
index 1813825436b..4b8dd0b7804 100644
--- a/src/gallium/winsys/v3d/drm/v3d_drm_public.h
+++ b/src/gallium/winsys/v3d/drm/v3d_drm_public.h
@@ -25,9 +25,12 @@
#define __VC5_DRM_PUBLIC_H__
struct pipe_screen;
+struct pipe_screen_config;
struct renderonly;
-struct pipe_screen *v3d_drm_screen_create(int drmFD);
-struct pipe_screen *v3d_drm_screen_create_renderonly(struct renderonly *ro);
+struct pipe_screen *v3d_drm_screen_create(int drmFD,
+ const struct pipe_screen_config *config);
+struct pipe_screen *v3d_drm_screen_create_renderonly(struct renderonly *ro,
+ const struct pipe_screen_config *config);
#endif /* __VC5_DRM_PUBLIC_H__ */
diff --git a/src/gallium/winsys/v3d/drm/v3d_drm_winsys.c b/src/gallium/winsys/v3d/drm/v3d_drm_winsys.c
index cda830f3e84..1502cc728c4 100644
--- a/src/gallium/winsys/v3d/drm/v3d_drm_winsys.c
+++ b/src/gallium/winsys/v3d/drm/v3d_drm_winsys.c
@@ -29,13 +29,14 @@
#include "v3d/v3d_screen.h"
struct pipe_screen *
-v3d_drm_screen_create(int fd)
+v3d_drm_screen_create(int fd, const struct pipe_screen_config *config)
{
- return v3d_screen_create(fcntl(fd, F_DUPFD_CLOEXEC, 3), NULL);
+ return v3d_screen_create(fcntl(fd, F_DUPFD_CLOEXEC, 3), config, NULL);
}
struct pipe_screen *
-v3d_drm_screen_create_renderonly(struct renderonly *ro)
+v3d_drm_screen_create_renderonly(struct renderonly *ro,
+ const struct pipe_screen_config *config)
{
- return v3d_screen_create(ro->gpu_fd, ro);
+ return v3d_screen_create(ro->gpu_fd, config, ro);
}
diff --git a/src/gallium/winsys/vc4/drm/vc4_drm_public.h b/src/gallium/winsys/vc4/drm/vc4_drm_public.h
index 102c1487ba5..a727242d7ba 100644
--- a/src/gallium/winsys/vc4/drm/vc4_drm_public.h
+++ b/src/gallium/winsys/vc4/drm/vc4_drm_public.h
@@ -27,7 +27,9 @@
struct pipe_screen;
struct renderonly;
-struct pipe_screen *vc4_drm_screen_create(int drmFD);
-struct pipe_screen *vc4_drm_screen_create_renderonly(struct renderonly *ro);
+struct pipe_screen *vc4_drm_screen_create(int drmFD,
+ const struct pipe_screen_config *config);
+struct pipe_screen *vc4_drm_screen_create_renderonly(struct renderonly *ro,
+ const struct pipe_screen_config *config);
#endif /* __VC4_DRM_PUBLIC_H__ */
diff --git a/src/gallium/winsys/vc4/drm/vc4_drm_winsys.c b/src/gallium/winsys/vc4/drm/vc4_drm_winsys.c
index 4215857d06b..2d05ac8cc92 100644
--- a/src/gallium/winsys/vc4/drm/vc4_drm_winsys.c
+++ b/src/gallium/winsys/vc4/drm/vc4_drm_winsys.c
@@ -32,7 +32,7 @@
#include "drm-uapi/vc4_drm.h"
struct pipe_screen *
-vc4_drm_screen_create(int fd)
+vc4_drm_screen_create(int fd, const struct pipe_screen_config *config)
{
bool v3d_present = true;
@@ -49,14 +49,15 @@ vc4_drm_screen_create(int fd)
return vc4_screen_create(fcntl(fd, F_DUPFD_CLOEXEC, 3), NULL);
#ifdef GALLIUM_KMSRO
- return kmsro_drm_screen_create(fd);
+ return kmsro_drm_screen_create(fd, config);
#endif
return NULL;
}
struct pipe_screen *
-vc4_drm_screen_create_renderonly(struct renderonly *ro)
+vc4_drm_screen_create_renderonly(struct renderonly *ro,
+ const struct pipe_screen_config *config)
{
return vc4_screen_create(ro->gpu_fd, ro);
}