summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/drivers/nouveau/nvc0
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2020-09-22 02:09:17 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2020-09-22 02:09:17 +0000
commit865c23c9c56f47f6cf8d73e8a6060a0c33a28b93 (patch)
treeaeed22bc39ce87dd6f09ff173c8273beaef65fe7 /lib/mesa/src/gallium/drivers/nouveau/nvc0
parent27e7bb02bd0f89f96d9e3b402b46c2c97ee4defe (diff)
Merge Mesa 20.0.8
With Mesa 20.1 even after the kernel change to do wbinvd on all cpus sthen@ reported that hard hangs still occurred on his Haswell system with inteldrm. Mark Kane also reported seeing hangs on Ivy Bridge on bugs@. Some systems/workloads seem to be more prone to triggering this than others as I have not seen any hangs on Ivy Bridge and the only hangs I saw on Haswell when running piglit went away with the wbinvd change. It seems something is wrong with drm memory attributes or coherency in the kernel and newer Mesa versions expect behaviour we don't have.
Diffstat (limited to 'lib/mesa/src/gallium/drivers/nouveau/nvc0')
-rw-r--r--lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_3d.xml.h6
-rw-r--r--lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_context.h1
-rw-r--r--lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_program.c4
-rw-r--r--lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_program.h1
-rw-r--r--lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c33
-rw-r--r--lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c9
-rw-r--r--lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_state.c10
-rw-r--r--lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c9
-rw-r--r--lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c1
-rw-r--r--lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c4
10 files changed, 13 insertions, 65 deletions
diff --git a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_3d.xml.h b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_3d.xml.h
index 221bab310..c5456e48b 100644
--- a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_3d.xml.h
+++ b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_3d.xml.h
@@ -447,10 +447,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define NVC0_3D_VIEWPORT_TRANSLATE_Z__ESIZE 0x00000020
#define NVC0_3D_VIEWPORT_TRANSLATE_Z__LEN 0x00000010
-#define NVC0_3D_VIEWPORT_SWIZZLE(i0) (0x00000a18 + 0x20*(i0))
-#define NVC0_3D_VIEWPORT_SWIZZLE__ESIZE 0x00000020
-#define NVC0_3D_VIEWPORT_SWIZZLE__LEN 0x00000010
-
#define NVC0_3D_SUBPIXEL_PRECISION(i0) (0x00000a1c + 0x20*(i0))
#define NVC0_3D_SUBPIXEL_PRECISION__ESIZE 0x00000020
#define NVC0_3D_SUBPIXEL_PRECISION__LEN 0x00000010
@@ -851,8 +847,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define NVC0_3D_VERTEX_ATTRIB_FORMAT_TYPE_FLOAT 0x38000000
#define NVC0_3D_VERTEX_ATTRIB_FORMAT_BGRA 0x80000000
-#define NVC0_3D_LAYER_VIEWPORT_RELATIVE 0x000011f0
-
#define NVC0_3D_UNK1214 0x00001214
#define NVC0_3D_UNK1218 0x00001218
diff --git a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_context.h b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_context.h
index dacb48411..4cfd207d4 100644
--- a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_context.h
+++ b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_context.h
@@ -356,7 +356,6 @@ bool nvc0_state_validate_3d(struct nvc0_context *, uint32_t);
/* nvc0_surface.c */
extern void nvc0_clear(struct pipe_context *, unsigned buffers,
- const struct pipe_scissor_state *scissor_state,
const union pipe_color_union *color,
double depth, unsigned stencil);
extern void nvc0_init_surface_functions(struct nvc0_context *);
diff --git a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_program.c b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_program.c
index 32aa82d16..128b94e1d 100644
--- a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_program.c
+++ b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_program.c
@@ -81,7 +81,7 @@ nvc0_shader_output_address(unsigned sn, unsigned si)
case TGSI_SEMANTIC_CLIPDIST: return 0x2c0 + si * 0x10;
case TGSI_SEMANTIC_CLIPVERTEX: return 0x270;
case TGSI_SEMANTIC_TEXCOORD: return 0x300 + si * 0x10;
- case TGSI_SEMANTIC_VIEWPORT_MASK: return 0x3a0;
+ /* case TGSI_SEMANTIC_VIEWPORT_MASK: return 0x3a0; */
case TGSI_SEMANTIC_EDGEFLAG: return ~0;
default:
assert(!"invalid TGSI output semantic");
@@ -272,8 +272,6 @@ nvc0_vtgp_gen_header(struct nvc0_program *vp, struct nv50_ir_prog_info *info)
if (info->io.genUserClip < 0)
vp->vp.num_ucps = PIPE_MAX_CLIP_PLANES + 1; /* prevent rebuilding */
- vp->vp.layer_viewport_relative = info->io.layer_viewport_relative;
-
return 0;
}
diff --git a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_program.h b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_program.h
index 5684207aa..183b14a42 100644
--- a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_program.h
+++ b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_program.h
@@ -41,7 +41,6 @@ struct nvc0_program {
uint8_t edgeflag; /* attribute index of edgeflag input */
bool need_vertex_id;
bool need_draw_parameters;
- bool layer_viewport_relative; /* also applies go gp and tp */
} vp;
struct {
uint8_t early_z;
diff --git a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
index 7abbf762a..92651e915 100644
--- a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
+++ b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
@@ -75,12 +75,14 @@ nvc0_screen_is_format_supported(struct pipe_screen *pscreen,
sample_count > 1)
return false;
- /* Restrict ETC2 and ASTC formats here. These are only supported on GK20A
- * and GM20B.
+ /* Restrict ETC2 and ASTC formats here. These are only supported on GK20A.
*/
if ((desc->layout == UTIL_FORMAT_LAYOUT_ETC ||
desc->layout == UTIL_FORMAT_LAYOUT_ASTC) &&
- nouveau_screen(pscreen)->device->chipset != 0x12b &&
+ /* The claim is that this should work on GM107 but it doesn't. Need to
+ * test further and figure out if it's a nouveau issue or a HW one.
+ nouveau_screen(pscreen)->class_3d < GM107_3D_CLASS &&
+ */
nouveau_screen(pscreen)->class_3d != NVEA_3D_CLASS)
return false;
@@ -190,16 +192,11 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
* COLOR, etc. here.
*/
return 0x1f0 / 16;
- case PIPE_CAP_MAX_VERTEX_BUFFERS:
- return 16;
- case PIPE_CAP_GL_BEGIN_END_BUFFER_SIZE:
- return 512 * 1024; /* TODO: Investigate tuning this */
/* supported caps */
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
case PIPE_CAP_TEXTURE_MIRROR_CLAMP_TO_EDGE:
case PIPE_CAP_TEXTURE_SWIZZLE:
- case PIPE_CAP_TEXTURE_SHADOW_MAP:
case PIPE_CAP_NPOT_TEXTURES:
case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
case PIPE_CAP_MIXED_COLOR_DEPTH_BITS:
@@ -286,15 +283,6 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_TGSI_ATOMINC_WRAP:
case PIPE_CAP_DEMOTE_TO_HELPER_INVOCATION:
case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
- case PIPE_CAP_PREFER_IMM_ARRAYS_AS_CONSTBUF:
- case PIPE_CAP_FLATSHADE:
- case PIPE_CAP_ALPHA_TEST:
- case PIPE_CAP_POINT_SIZE_FIXED:
- case PIPE_CAP_TWO_SIDED_COLOR:
- case PIPE_CAP_CLIP_PLANES:
- case PIPE_CAP_TEXTURE_SHADOW_LOD:
- case PIPE_CAP_PACKED_STREAM_OUTPUT:
- case PIPE_CAP_DRAW_INFO_START_WITH_USER_INDICES:
return 1;
case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
return nouveau_screen(pscreen)->vram_domain & NOUVEAU_BO_VRAM ? 1 : 0;
@@ -315,8 +303,6 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_CONSERVATIVE_RASTER_POST_SNAP_POINTS_LINES:
case PIPE_CAP_CONSERVATIVE_RASTER_POST_DEPTH_COVERAGE:
case PIPE_CAP_PROGRAMMABLE_SAMPLE_LOCATIONS:
- case PIPE_CAP_VIEWPORT_SWIZZLE:
- case PIPE_CAP_VIEWPORT_MASK:
return class_3d >= GM200_3D_CLASS;
case PIPE_CAP_CONSERVATIVE_RASTER_PRE_SNAP_TRIANGLES:
return class_3d >= GP100_3D_CLASS;
@@ -339,7 +325,6 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_VERTEXID_NOBASE:
case PIPE_CAP_RESOURCE_FROM_USER_MEMORY:
case PIPE_CAP_TGSI_FS_POSITION_IS_SYSVAL:
- case PIPE_CAP_TGSI_FS_POINT_IS_SYSVAL:
case PIPE_CAP_GENERATE_MIPMAP:
case PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY:
case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
@@ -381,14 +366,6 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_CS_DERIVED_SYSTEM_VALUES_SUPPORTED:
case PIPE_CAP_FBFETCH_COHERENT:
case PIPE_CAP_TGSI_SKIP_SHRINK_IO_ARRAYS:
- case PIPE_CAP_TGSI_TG4_COMPONENT_IN_SWIZZLE:
- case PIPE_CAP_OPENCL_INTEGER_FUNCTIONS: /* could be done */
- case PIPE_CAP_INTEGER_MULTIPLY_32X16: /* could be done */
- case PIPE_CAP_FRONTEND_NOOP:
- case PIPE_CAP_GL_SPIRV:
- case PIPE_CAP_SHADER_SAMPLES_IDENTICAL:
- case PIPE_CAP_VIEWPORT_TRANSFORM_LOWERED:
- case PIPE_CAP_PSIZ_CLAMPED:
return 0;
case PIPE_CAP_VENDOR_ID:
diff --git a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c
index b7e0c8a93..774c56481 100644
--- a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c
+++ b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c
@@ -257,7 +257,6 @@ nvc0_layer_validate(struct nvc0_context *nvc0)
struct nouveau_pushbuf *push = nvc0->base.pushbuf;
struct nvc0_program *last;
bool prog_selects_layer = false;
- bool layer_viewport_relative = false;
if (nvc0->gmtyprog)
last = nvc0->gmtyprog;
@@ -266,17 +265,11 @@ nvc0_layer_validate(struct nvc0_context *nvc0)
else
last = nvc0->vertprog;
- if (last) {
+ if (last)
prog_selects_layer = !!(last->hdr[13] & (1 << 9));
- layer_viewport_relative = last->vp.layer_viewport_relative;
- }
BEGIN_NVC0(push, NVC0_3D(LAYER), 1);
PUSH_DATA (push, prog_selects_layer ? NVC0_3D_LAYER_USE_GP : 0);
- if (nvc0->screen->eng3d->oclass >= GM200_3D_CLASS) {
- IMMED_NVC0(push, NVC0_3D(LAYER_VIEWPORT_RELATIVE),
- layer_viewport_relative);
- }
}
void
diff --git a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_state.c b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
index 5cb07609d..8f3db4679 100644
--- a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
+++ b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
@@ -1381,13 +1381,9 @@ nvc0_set_global_bindings(struct pipe_context *pipe,
if (nvc0->global_residents.size <= (end * sizeof(struct pipe_resource *))) {
const unsigned old_size = nvc0->global_residents.size;
- if (util_dynarray_resize(&nvc0->global_residents, struct pipe_resource *, end)) {
- memset((uint8_t *)nvc0->global_residents.data + old_size, 0,
- nvc0->global_residents.size - old_size);
- } else {
- NOUVEAU_ERR("Could not resize global residents array\n");
- return;
- }
+ util_dynarray_resize(&nvc0->global_residents, struct pipe_resource *, end);
+ memset((uint8_t *)nvc0->global_residents.data + old_size, 0,
+ nvc0->global_residents.size - old_size);
}
if (resources) {
diff --git a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c
index 48d81f197..c7513f96f 100644
--- a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c
+++ b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c
@@ -391,7 +391,6 @@ static void
nvc0_validate_viewport(struct nvc0_context *nvc0)
{
struct nouveau_pushbuf *push = nvc0->base.pushbuf;
- uint16_t class_3d = nvc0->screen->base.class_3d;
int x, y, w, h, i;
float zmin, zmax;
@@ -432,14 +431,6 @@ nvc0_validate_viewport(struct nvc0_context *nvc0)
BEGIN_NVC0(push, NVC0_3D(DEPTH_RANGE_NEAR(i)), 2);
PUSH_DATAf(push, zmin);
PUSH_DATAf(push, zmax);
-
- if (class_3d >= GM200_3D_CLASS) {
- BEGIN_NVC0(push, NVC0_3D(VIEWPORT_SWIZZLE(i)), 1);
- PUSH_DATA (push, vp->swizzle_x << 0 |
- vp->swizzle_y << 4 |
- vp->swizzle_z << 8 |
- vp->swizzle_w << 12);
- }
}
nvc0->viewports_dirty = 0;
}
diff --git a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
index 538effdb5..2b38fe6e7 100644
--- a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
+++ b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
@@ -682,7 +682,6 @@ nvc0_clear_depth_stencil(struct pipe_context *pipe,
void
nvc0_clear(struct pipe_context *pipe, unsigned buffers,
- const struct pipe_scissor_state *scissor_state,
const union pipe_color_union *color,
double depth, unsigned stencil)
{
diff --git a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c
index 92bd7eb5b..6ed96509b 100644
--- a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c
+++ b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c
@@ -184,15 +184,17 @@ nvc0_set_constant_vertex_attrib(struct nvc0_context *nvc0, const unsigned a)
PUSH_SPACE(push, 6);
BEGIN_NVC0(push, NVC0_3D(VTX_ATTR_DEFINE), 5);
dst = &push->cur[1];
- util_format_unpack_rgba(ve->src_format, dst, src, 1);
if (desc->channel[0].pure_integer) {
if (desc->channel[0].type == UTIL_FORMAT_TYPE_SIGNED) {
mode = VTX_ATTR(a, 4, SINT, 32);
+ desc->unpack_rgba_sint(dst, 0, src, 0, 1, 1);
} else {
mode = VTX_ATTR(a, 4, UINT, 32);
+ desc->unpack_rgba_uint(dst, 0, src, 0, 1, 1);
}
} else {
mode = VTX_ATTR(a, 4, FLOAT, 32);
+ desc->unpack_rgba_float(dst, 0, src, 0, 1, 1);
}
push->cur[0] = mode;
push->cur += 5;