summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_context.c
Commit message (Collapse)AuthorAgeFilesLines
* vc4: Refactor flushing before mapping a BO.Eric Anholt2014-10-241-9/+8
| | | | I'm going to want to make some other decisions here before flushing.
* vc4: Add support for rebasing texture levels so firstlevel == 0.Eric Anholt2014-10-191-0/+6
| | | | | | GLES2 doesn't have GL_TEXTURE_BASE_LEVEL, so the hardware doesn't. Fixes piglit levelclamp, tex-miplevel-selection, and texture-storage/2D mipmap rendering.
* vc4: Make some assertions about how many flushes/EOFs the simulator sees.Eric Anholt2014-10-171-2/+2
| | | | This caught the previous commit's bug in the kernel validator.
* vc4: Replace the FLUSH_ALL with FLUSH.Eric Anholt2014-10-171-1/+3
| | | | | | We don't need to emit all of our current state at the end of each bin list. We're going to be smashing it all at the start of the next tile's bin list, anyway.
* vc4: Add some comments about state management.Eric Anholt2014-10-171-0/+6
|
* vc4: Make sure there's exactly 1 tile store per tile coords packet.Eric Anholt2014-10-171-15/+64
| | | | | | It's not documented that I can see, but the other driver does it (check vg_hw_4.c), and one of the HW guys confirmed that you really do need to do it.
* vc4: Don't forget to store stencil along with depth when storing either.Eric Anholt2014-09-301-1/+1
| | | | | Otherwise, we'd replace the stencil in our packed depth/stencil with 0s. Fixes about 50 piglit tests.
* vc4: Don't try to do stores to buffers that aren't bound.Eric Anholt2014-09-291-5/+8
| | | | | | | | | | | | | | The code was kind of mixed up what buffers were getting stored in the case that a resolve bit was unset (which are set based on the GL state at draw time) and the buffer wasn't actually bound. In particular, depth-only rendering would store the color buffer contents, which happen to be pointing at the depth buffer. Thanks to clearing out the resolve bits for things we really can't resolve, now I can drop the safety checks for buffer presence around the actual stores. Fixes 42 piglit tests.
* vc4: Add the necessary stubs for occlusion queries.Eric Anholt2014-09-291-0/+1
| | | | | | We have to expose them for GL 2.0, but we just always return a value of 0. We should be advertising 0 query bits instead of 64, but gallium doesn't have plumbing for that yet. At least this stops the segfaults.
* vc4: Switch from errx() to fprintf() and abort().Eric Anholt2014-09-251-2/+4
| | | | | | | | These are pretty catastrophic, "should never happen" failure paths (though 4 tests in piglit hit them currently, due to a single bug). An abort() that you can gdb on easily is probably more useful than a clean exit, particularly since a bug in piglit framework right now is causing early exit(1)s to simply not be recorded in the results at all.
* vc4: Switch the context struct to use ralloc.Eric Anholt2014-09-231-2/+3
| | | | | I wanted to hang the ra_regs off it so I didn't have to free, but it turned out it wasn't ralloced yet.
* vc4: Actually implement VC4_DEBUG=cl.Eric Anholt2014-09-181-0/+7
|
* vc4: Fix segfaults when rendering with no color render target.Eric Anholt2014-09-091-3/+13
|
* vc4: Fill out the stencil clear field.Eric Anholt2014-09-091-1/+1
| | | | | | The rest of stencil handling isn't done yet, but it documents an extra cl_u8(0) and helps make it obvious why we don't need to format clear_depth the same way the depth/stencil buffer is formatted.
* vc4: Add support for loading/storing the depth buffer.Eric Anholt2014-09-091-7/+61
| | | | | | For now it still requires the color buffer to be present -- we're relying on the store of color buffer contents to end the frame, and we have to do something with color buffers in the rendering config packet.
* vc4: Don't forget to do initial tile clearing for depth/stencil.Eric Anholt2014-09-091-1/+6
|
* vc4: Add support for all the texture and FBO formats we can.Eric Anholt2014-08-221-1/+5
| | | | | | | Now that tiling is in place, we can expose the other formats. Depth is still broken (need to make changes in the shader), but if you don't expose it things crash all over. SNORM is dropped, but we could re-add it later with some shader fixes to handle converting between [0,1] and [-1,1].
* vc4: Add support for texture tiling.Eric Anholt2014-08-221-3/+3
| | | | | | This still treats everything as RGBA8888 for the most part, same as before. This is a prerequisite for handling other texture formats, since only RGBA8888 has a raster-layout mode.
* vc4: Include stdio/stdlib in headers so I don't have to include it per file.Eric Anholt2014-08-221-1/+0
| | | | | There are a few tools I want to have always available, and fprintf() and abort() are among them.
* vc4: Drop incorrect attempt to incorrectly invert the primconvert hw_mask.Eric Anholt2014-08-151-1/+1
| | | | | | | | The hw_mask is the set of primitives you actually support, so this attempt to provide the set of formats that's unsupported was wrong in two ways (it was intended to be '~' not '!'). However, we only call this code when prim isn't one of the actually supported hw_mask bits, so missing out on the memcpy didn't matter anyway.
* vc4: Move the deref of the color buffer for simulator into the simulator.Eric Anholt2014-08-151-4/+1
| | | | | | | At some point I'm going to want to move the information necessary for the host buffer upload/download into the BO so that it's independent of the current vc4->framebuffer, but for now this fixes pointless derefs on non-simulator in vc4_context.c since the dump_fbo() removal
* vc4: Drop the dump_fbo() routine.Eric Anholt2014-08-121-50/+0
| | | | | Now that eglkms is working, and some tests are working under PIGLIT_PLATFORM=gbm, I don't think I need this any more.
* vc4: Don't forget to set the depth clear value in the packet.Eric Anholt2014-08-111-1/+1
| | | | This gets glxgears partially rendering again.
* vc4: Store the (currently always linear) tiling format in the resource.Eric Anholt2014-08-111-2/+4
|
* vc4: Add support for depth clears and tests within a tile.Eric Anholt2014-08-111-3/+3
| | | | | | | | | This doesn't load/store the Z contents across submits yet. It also disables early Z, since it's going to require tracking of Z functions across multiple state updates to track the early Z direction and whether it can be used. v2: Move the key setup to before the search for the key.
* vc4: Avoid flushing when mapping buffers that aren't in the batch.Eric Anholt2014-08-111-0/+48
| | | | | This should prevent a bunch of unnecessary flushes for things like updating immediate vertex data.
* vc4: Keep a reference to BOs queued for rendering.Eric Anholt2014-08-111-2/+3
| | | | | | Otherwise, once we're not flushing at the end of every draw, we'll free things like gallium resources, and free the backing GEM object, before we've flushed the rendering using it to the kernel.
* vc4: Walk tiles horizontally, then vertically.Eric Anholt2014-08-111-2/+2
| | | | | I was confused looking at my addresses in dumps because I was seeing the tile branch offsets jumping all over.
* vc4: Track clears veresus uncleared draws, and the clear color.Eric Anholt2014-08-111-21/+49
| | | | | | This is a step toward queueing more than one draw per frame. Fixes piglit attribute0 test, since we get a working clear color now.
* vc4: Move the rest of RCL setup to flush time.Eric Anholt2014-08-111-3/+30
| | | | | We only want to set up render target config and clear colors once per frame.
* vc4: Move render command list calls to vc4_flush()Eric Anholt2014-08-111-0/+43
|
* vc4: Move bin command list ending commands to vc4_flush()Eric Anholt2014-08-111-0/+4
|
* vc4: Rename fields in the kernel interface.Eric Anholt2014-08-111-6/+6
| | | | | I decided I didn't like "len" compared to "size", and I keep typing shader_rec instead of shader_record[s] elsewhere, so make it consistent.
* vc4: Rewrite the kernel ABI to support texture uniform relocation.Eric Anholt2014-08-111-0/+3
| | | | | | | | | | This required building a shader parser that would walk the program to find where the texturing-related uniforms are in the uniforms stream. Note that as of this commit, a new kernel is required for rendering on actual VC4 hardware (currently that commit is named "drm/vc4: Introduce shader validation and better command stream validation.", but is likely to be squashed as part of an eventual merge of the kernel driver).
* vc4: Switch simulator to using kernel validatorEric Anholt2014-08-111-6/+9
| | | | | | | | This ensures that when I'm using the simulator, I get a closer match to what behavior on real hardware will be. It lets me rapidly iterate on the kernel validation code (which otherwise has a several-minute turnaround time), and helps catch buffer overflow bugs in the userspace driver faster.
* vc4: Add VC4_DEBUG env optionEric Anholt2014-08-081-4/+13
| | | | | v2: Fix an accidental deletion of some characters from the copyright message (caught by Ilia Mirkin)
* vc4: Use the user's actual first vertex attribute.Eric Anholt2014-08-081-0/+10
| | | | | This is hardcoded to read it as RGBA32F so far, but starts to get more tests working.
* vc4: Initial skeleton driver import.Eric Anholt2014-08-081-0/+192
This mostly just takes every draw call and turns it into a sequence of commands that clear the FBO and draw a single shaded triangle to it, regardless of the actual input vertices or shaders. I copied the initial driver skeleton mostly from freedreno, and I've preserved Rob Clark's copyright for those. I also based my initial hardcoded shaders and command lists on Scott Mansell (phire)'s "hackdriver" project, though the bit patterns of the shaders emitted end up being different. v2: Rebase on gallium megadrivers changes. v3: Rebase on PIPE_SHADER_CAP_MAX_CONSTS change. v4: Rely on simpenrose actually being installed when building for simulation. v5: Add more header duplicate-include guards. v6: Apply Emil's review (protection against vc4 sim and ilo at the same time, and dropping the dricommon drm bits) and fix a copyright header (thanks, Roland)