summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-07-08 08:44:49 -0700
committerAlyssa Rosenzweig <[email protected]>2019-07-10 06:47:01 -0700
commitb5de423ac1c653741c78030598ae9561e4966c30 (patch)
tree6976da4b227b2b23d2c548f59c948f60b2967760 /src
parentb69d5d6e19568c2098638af014abb8c541402822 (diff)
panfrost: Be more honest about PIPE_CAPs
A lot of the pan_screen.c code was cargoculted from other drivers. The upshot is that we return true for a lot of PIPE_CAPs that we don't actually support, resulting in us exposing way too many extensions that we don't actually support. Be more careful. Some CAPs we do need to fake to access higher dEQP versions (i.e. in order to debug the features we're hiding behind the CAP). For these, we hide the CAP behind a special PAN_MESA_DEBUG=deqp option to avoid apps randomly using these in-development features. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/panfrost/pan_screen.c139
-rw-r--r--src/gallium/drivers/panfrost/pan_util.h1
2 files changed, 39 insertions, 101 deletions
diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c
index b044ae99399..6590359a53f 100644
--- a/src/gallium/drivers/panfrost/pan_screen.c
+++ b/src/gallium/drivers/panfrost/pan_screen.c
@@ -57,6 +57,8 @@
static const struct debug_named_value debug_options[] = {
{"msgs", PAN_DBG_MSGS, "Print debug messages"},
{"trace", PAN_DBG_TRACE, "Trace the command stream"},
+ {"deqp", PAN_DBG_DEQP, "Hacks for dEQP"},
+ /* ^^ If Rob can do it, so can I */
DEBUG_NAMED_VALUE_END
};
@@ -85,36 +87,56 @@ panfrost_get_device_vendor(struct pipe_screen *screen)
static int
panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param)
{
+ /* We expose in-dev stuff for dEQP that we don't want apps to use yet */
+ bool is_deqp = pan_debug & PAN_DBG_DEQP;
+
switch (param) {
case PIPE_CAP_NPOT_TEXTURES:
case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
case PIPE_CAP_MIXED_COLOR_DEPTH_BITS:
- return 1;
-
case PIPE_CAP_SM3:
case PIPE_CAP_POINT_SPRITE:
return 1;
case PIPE_CAP_MAX_RENDER_TARGETS:
- case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
return 1;
case PIPE_CAP_OCCLUSION_QUERY:
+ return 1;
case PIPE_CAP_QUERY_TIME_ELAPSED:
case PIPE_CAP_QUERY_PIPELINE_STATISTICS:
- return 1; /* TODO: Queries */
+ case PIPE_CAP_QUERY_TIMESTAMP:
+ case PIPE_CAP_QUERY_SO_OVERFLOW:
+ return 0;
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
case PIPE_CAP_TEXTURE_SWIZZLE:
return 1;
- /* TODO: ES3. We expose these caps so we can access higher dEQP
- * tests; in actuality they are nonfunctional */
- case PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS:
- return 4;
case PIPE_CAP_TGSI_INSTANCEID:
case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
- return 1;
+ return is_deqp ? 1 : 0;
+
+ case PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS:
+ return is_deqp ? 4 : 0;
+ case PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS:
+ case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
+ return is_deqp ? 64 : 0;
+
+ case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
+ return is_deqp ? 256 : 0; /* for GL3 */
+
+ case PIPE_CAP_GLSL_FEATURE_LEVEL:
+ case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
+ return is_deqp ? 140 : 120;
+ case PIPE_CAP_ESSL_FEATURE_LEVEL:
+ return is_deqp ? 300 : 120;
+
+ case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
+ return is_deqp ? 16 : 0;
+
+ case PIPE_CAP_CUBE_MAP_ARRAY:
+ return is_deqp;
/* TODO: Where does this req come from in practice? */
case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY:
@@ -127,11 +149,7 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param)
return 13;
case PIPE_CAP_BLEND_EQUATION_SEPARATE:
- return 1;
-
case PIPE_CAP_INDEP_BLEND_ENABLE:
- return 1;
-
case PIPE_CAP_INDEP_BLEND_FUNC:
return 1;
@@ -140,116 +158,49 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param)
return 0;
case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT:
- return 1;
case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER:
case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER:
- return 1;
-
case PIPE_CAP_GENERATE_MIPMAP:
return 1;
- case PIPE_CAP_DEPTH_CLIP_DISABLE:
- return 1;
-
- case PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS:
- case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
- return 16 * 4;
-
- case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
- case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
- return 1024;
-
- case PIPE_CAP_MAX_VERTEX_STREAMS:
- return 1;
-
- case PIPE_CAP_SHADER_STENCIL_EXPORT:
- return 1;
-
case PIPE_CAP_SEAMLESS_CUBE_MAP:
case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
return 1;
- case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
- return 256; /* for GL3 */
-
- case PIPE_CAP_CONDITIONAL_RENDER:
- return 1;
-
- case PIPE_CAP_FRAGMENT_COLOR_CLAMPED:
- case PIPE_CAP_VERTEX_COLOR_UNCLAMPED:
- case PIPE_CAP_VERTEX_COLOR_CLAMPED:
- return 1;
-
- case PIPE_CAP_GLSL_FEATURE_LEVEL:
- return 330;
-
- case PIPE_CAP_USER_VERTEX_BUFFERS: /* TODO */
- case PIPE_CAP_RESOURCE_FROM_USER_MEMORY:
- return 0;
-
- case PIPE_CAP_TGSI_VS_LAYER_VIEWPORT:
- case PIPE_CAP_DOUBLES:
- case PIPE_CAP_INT64:
- case PIPE_CAP_INT64_DIVMOD:
- return 1;
-
- case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
- return 16;
-
case PIPE_CAP_MAX_VERTEX_ELEMENT_SRC_OFFSET:
return 0xffff;
- case PIPE_CAP_QUERY_TIMESTAMP:
- case PIPE_CAP_CUBE_MAP_ARRAY:
- return 1;
-
case PIPE_CAP_TEXTURE_BUFFER_OBJECTS:
return 1;
case PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE:
return 65536;
- case PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT:
- return 0;
-
case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
return 0;
- case PIPE_CAP_MAX_VIEWPORTS:
- return PIPE_MAX_VIEWPORTS;
-
case PIPE_CAP_ENDIANNESS:
return PIPE_ENDIAN_NATIVE;
- case PIPE_CAP_MAX_TEXTURE_GATHER_COMPONENTS:
- return 4;
-
- case PIPE_CAP_TEXTURE_GATHER_SM5:
- case PIPE_CAP_TEXTURE_QUERY_LOD:
- case PIPE_CAP_TGSI_VS_WINDOW_SPACE_POSITION:
case PIPE_CAP_SAMPLER_VIEW_TARGET:
- case PIPE_CAP_FAKE_SW_MSAA:
return 1;
case PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET:
- return -32;
+ return -8;
case PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET:
- return 31;
-
- case PIPE_CAP_DRAW_INDIRECT:
- return 1;
-
- case PIPE_CAP_QUERY_SO_OVERFLOW:
- return 1;
+ return 7;
case PIPE_CAP_VENDOR_ID:
- return 0xFFFFFFFF;
-
case PIPE_CAP_DEVICE_ID:
return 0xFFFFFFFF;
case PIPE_CAP_ACCELERATED:
+ case PIPE_CAP_UMA:
+ case PIPE_CAP_TEXTURE_FLOAT_LINEAR:
+ case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:
+ case PIPE_CAP_COPY_BETWEEN_COMPRESSED_AND_PLAIN_FORMATS:
+ case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
return 1;
case PIPE_CAP_VIDEO_MEMORY: {
@@ -261,20 +212,6 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param)
return (int)(system_memory >> 20);
}
- case PIPE_CAP_UMA:
- return 1;
-
- case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
- case PIPE_CAP_CLIP_HALFZ:
- case PIPE_CAP_TEXTURE_FLOAT_LINEAR:
- case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:
- case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
- case PIPE_CAP_CULL_DISTANCE:
- case PIPE_CAP_COPY_BETWEEN_COMPRESSED_AND_PLAIN_FORMATS:
- case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
- case PIPE_CAP_CLEAR_TEXTURE:
- return 1;
-
case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
return 4;
diff --git a/src/gallium/drivers/panfrost/pan_util.h b/src/gallium/drivers/panfrost/pan_util.h
index 8fd41420a48..3ae70218606 100644
--- a/src/gallium/drivers/panfrost/pan_util.h
+++ b/src/gallium/drivers/panfrost/pan_util.h
@@ -30,6 +30,7 @@
#define PAN_DBG_MSGS 0x0001
#define PAN_DBG_TRACE 0x0002
+#define PAN_DBG_DEQP 0x0004
extern int pan_debug;