summaryrefslogtreecommitdiff
path: root/intel
AgeCommit message (Collapse)Author
2012-08-02intel: Quiet valgrind warnings in context creation.Eric Anholt
2012-08-02intel: Remove two unused variablesDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-20intel: fix build errorRob Clark
CCLD test_decode ./.libs/libdrm_intel.so: undefined reference to `drmPrimeHandleToFD' ./.libs/libdrm_intel.so: undefined reference to `drmPrimeFDToHandle' collect2: ld returned 1 exit status From Adam Jackson's explaination: most distros have changed it so ld defaults to --no-copy-dt-needed-entries, so if you use something from libdrm you can't just assume libdrm_intel will bring it in for you, you have to be explicit Signed-off-by: Rob Clark <rob@ti.com>
2012-07-20intel: add prime interface for getting/setting a prime bo. (v4)Dave Airlie
This adds interfaces for the X driver to use to create a prime handle from a buffer, and create a bo from a handle. v2: use Chris's suggested naming (well from at least for consistency) v3: git commit --amend fail v4: fix as per Chris's suggestions, group assignments, add get tiling Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-12intel: Change context create failure message to from fprintf to DBG().Kenneth Graunke
Since there is no getparam for hardware context support, Mesa always tries to obtain a context by calling drm_intel_gem_context_create and NULL-checking the result. On an older kernel without context support, this caused libdrm to print an unwanted message to stderr: DRM_IOCTL_I915_GEM_CONTEXT_CREATE failed: Invalid argument In fact, this caused every Piglit test to fail with a "warn" status due to the unrecognized error message. Change the message to use DBG() rather than fprintf(), so people can still get the debug message, but it won't spam normally. Reviewed-by: Ben Widawsky <ben@bwidawsk.net> Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-03intel: Fix build failure in test_decode.cLauri Kasanen
Hi list The recently released libdrm 2.4.37 does not compile the Intel part: test_decode.c: In function 'compare_batch': test_decode.c:107: error: implicit declaration of function 'open_memstream' PS: Please CC me. Signed-off-by: Lauri Kasanen <cand@gmx.com> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2012-06-29intel/context: create/destroy implementationBen Widawsky
Add relevant code to set up minimal state and call the appropriate kernel IOCTLs. This was missed in the previous cherry-picking for 2.3.36. Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2012-06-27intel/decode: fix the reference file forBen Widawsky
I mistakenly "fixed" a bad decode with commit 7d0a1d5ebbe2c6aecd96eef94b0af038858a0178 Author: Ben Widawsky <ben@bwidawsk.net> Date: Sun Jun 24 20:35:57 2012 -0700 intel/decode: VERTEX_ELEMENT_STATE, 1 means valid However the actual fix is just to update the reference file, and include GEN7 in the decode. Props to Eric Anholt for putting the test in distcheck, or else I wouldn't have caught this. Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2012-06-27Revert "intel/decode: VERTEX_ELEMENT_STATE, 1 means valid"Ben Widawsky
This reverts commit 7d0a1d5ebbe2c6aecd96eef94b0af038858a0178. The actual fix
2012-06-27intel: add decoding of MI_SET_CONTEXTBen Widawsky
Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-27intel/context: new execbuf interface for contextsBen Widawsky
To support this we extract the common execbuf2 functionality to be called with, or without contexts. The context'd execbuf does not support some of the dri1 stuff. Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-27intel/context: Add drm_intel_context typeBen Widawsky
Add an opaque type representing a HW context. Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-27intel/decode: VERTEX_ELEMENT_STATE, 1 means validBen Widawsky
The logic seemed to be inverse to me. Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2012-06-27intel/decode: add sampler state pointers for [HD]SBen Widawsky
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2012-06-27intel: wait render timeout implementationBen Widawsky
int drm_intel_gem_bo_wait(drm_intel_bo *bo, uint64_t timeout_ns) This should bump the libdrm version. We're waiting for context support so we can do both features in one bump. v2: don't return remaining timeout amount use get param and fallback for older kernels v3: only doing getparam at init prototypes now have a signed input value v4: update comments fall back to correct polling behavior with new userspace and old kernel v5: since the drmIoctl patch was not well received, return appropriate values in this function instead. As Daniel pointed out, the polling case (timeout == 0) should also return -ETIME. Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-06-24intel: Add IVB PUSH_CONSTANT decodesBen Widawsky
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2012-05-10intel: Add the ability to supply annotations for .aub files.Paul Berry
This patch adds a new function, drm_intel_bufmgr_gem_set_aub_annotations(), which can be used to annotate the type and subtype of data stored in various sections of each buffer. This data is used to populate type and subtype fields when generating the .aub file, which improves the ability of later debugging tools to analyze the contents of the .aub file. If drm_intel_bufmgr_gem_set_aub_annotations() is not called, then we fall back to the old set of annotations (annotate the portion of the batchbuffer that is executed as AUB_TRACE_TYPE_BATCH, and everything else as AUB_TRACE_TYPE_NOTYPE). Reviewed-by: Eric Anholt <eric@anholt.net>
2012-04-02intel/decode: decode MI_WAIT_FOR_EVENTDaniel Vetter
... and add support to decode MI instructions with functions. Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com> Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-04-01intel: add Ivy Bridge GT2 server variantEugeni Dodonov
We were missing this one and it is being used by Bromolow. Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-03-22intel: Add some PCI IDs for Haswell.Kenneth Graunke
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-03-13intel: Quiet two more valgrind complaints with recent changes.Eric Anholt
These are more cases where valgrind doesn't understand what gets read or written by our ioctls.
2012-03-10intel: Add per-dword decode of gen7 3DPRIMITIVE.Eric Anholt
2012-03-10intel: Move the gen4-6 3DPRIMITIVE handling out of the switch statement.Eric Anholt
2012-03-10intel: Add support for (possibly) unsynchronized maps.Eric Anholt
This improves the performance of Mesa's GL_MAP_UNSYNCHRONIZED_BIT path in GL_ARB_map_buffer_range. Improves Unigine Tropics performance at 1024x768 by 2.30482% +/- 0.0492146% (n=61) v2: Fix comment grammar. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-09intel: Fix error check for I915_PARAM_HAS_LLC.Eric Anholt
drmIoctl returns -1 on error with errno set to the error value. Other users of it in this file just check for != 0, and only use errno when they need to send an error value on to the caller of the API.
2012-03-09intel: Bump the copyright dates on the bufmgr files.Eric Anholt
We've been hacking these constantly.
2012-03-09intel: Add .aub file output support.Eric Anholt
This will allow the driver to capture all of its execution state to a file for later debugging. intel_gpu_dump is limited in that it only captures batchbuffers, and Mesa's captures, while more complete, still capture only a portion of the state involved in execution. This is a squash commit of a long series of hacking as we tried to get the resulting traces to work in the internal simulator. It contains contributions by Yuanhan Liu and Kenneth Graunke. v2: Drop the MI_FLUSH_ENABLE setup. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-09intel: Add support for overriding the PCI ID via an environment variableKenneth Graunke
For example: export INTEL_DEVID_OVERRIDE=0x162 If this variable is set, don't actually submit the batchbuffer to the GPU, it probably contains commands for the wrong generation of hardware. v2: Introduce a getter for the overridden devid, and avoid getenv per exec. Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Signed-off-by: Eric Anholt <eric@anholt.net>
2012-02-22intel: Import a new batchbuffer for the gen7 test.Eric Anholt
This one doesn't have the 3DSTATE_HIER_DEPTH_BUFFER bug that the previous one did. Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-22intel: Add decode for gen7 HIER_DEPTH_BUFFER.Eric Anholt
Note that the regression test complains here: The batch that was captured included a bug in its packet output, which was later fixed in Mesa. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-22intel: Add decode for gen7 3DSTATE_WM.Eric Anholt
This requires pulling the gen6 3DSTATE_WM out to a function so it doesn't override gen7's handler. v2: Fix pasteo in interpreting ZW interpolation (thanks danvet!). Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-22intel: Fix a typo in decode error message.Eric Anholt
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-15intel: Detect cache domain inconsistency with valgrindChris Wilson
Every access to either the GTT or CPU pointer is supposed to be proceeded by a set_domain ioctl so that GEM is able to manage the cache domains correctly and for the following access to be coherent. Of course, some people explicitly want incoherent, non-blocking access which is going to trigger warnings by this patch but are probably better served by explicit suppression. v2: Also mark the pointers as inaccessible following the explicit unmap and implicit unmap upon return to the cache. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-11intel: Mark up with valgrind intrinsics to reduce false positivesChris Wilson
In particular, declare the hidden CPU mmaps to valgrind so that it knows about those memory regions. v2: Add an additional VG_CLEAR for the getparam References: https://bugs.freedesktop.org/show_bug.cgi?id=35071 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Ben Widawsky <ben@bwidawsk.net> [anholt: Ideally valgrind should just learn about the ioctls, and removing the clear for the non-valgrindified code feels risky.] Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-01intel: query for LLC supportEugeni Dodonov
This adds support for querying the kernel about the LLC support in the hardware. In case the ioctl fails, we assume that it is present on GEN6 and GEN7. v2: fix the return code checking Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-01-30intel: Fix bufmgr_gem->gen for gen > 4Chad Versace
If the pci_device's actual gen was > 4, then we stupidly set bufmgr_gem->gen = 6. Luckily this caused no bugs, and this fix shouldn't change any behavior, because all checks against the gen currently have one of the forms below: gen == 2 gen == 3 gen >= 4 Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-27intel: Add minimal decode for remaining gen7 packets in use.Eric Anholt
This just gets packet name and length in place, with the remainder unfinished. I've long since finished the work that got me started fixing up the decode.
2012-01-27intel: Add decode for gen7 constant buffer packets.Eric Anholt
2012-01-27intel: Add decode for gen7 state pointers.Eric Anholt
Since CC_STATE_POINTERS for gen6 and 7 are quite different but use the same opcode, move gen6 out to a helper function too, so we can use a helper function for gen7.
2012-01-27intel: Add support for parsing gen7 URB packets.Eric Anholt
2012-01-27intel: Make most of the logic for 965 3d packet length checks table-driven.Eric Anholt
This puts the error message in a consistent location relative to the packet, and while I'm here I made the error message a bit more informative. Now, most static length packets need to just declare their length in the table and not worry.
2012-01-27intel: Move the logic for getting 965 3d packet length to the packet table.Eric Anholt
While I'm touching every line of the table, sort it by opcode.
2012-01-27intel: Add support for parsing 965 3d packets using helper functions.Eric Anholt
I want to add packets, without contributing to the switch statement of doom.
2012-01-27intel: Parse the correct length for gen7 3DSTATE_MULTISAMPLE.Eric Anholt
2012-01-27intel: Put the "gen" shorthand chipset identifier in the context.Eric Anholt
It's a lot nicer than using IS_WHATEVER(devid) all over the place, and we have this in our other projects too.
2012-01-27intel: Avoid the need for most overflow checks by using a scratch page.Eric Anholt
The overflow checks were all thoroughly untested, and a bunch of the ones I'm deleting were pretty broken. Now, in the case of overflow, you just decode data of 0xd0d0d0d0, and instr_out prints the warning message instead. Note that this still has the same issue of being under-tested, but at least it's one place instead of per-packet. A couple of BUFFER_FAIL uses are left where the length to be decoded could be (significantly) larger than a page, and the decode didn't just call instr_out (which doesn't dereference data itself unless it's safe).
2012-01-27intel: Make instr_out take the decode context.Eric Anholt
This reduces some of the extra derefs of the pointers.
2012-01-27intel: Use the context to simplify BR01 decode.Eric Anholt
Similar to BR00, count was always 1 and was always an index, not a count.
2012-01-27intel: Use the context to simplify BR00 decode.Eric Anholt
The count (actually index) was always 0, because BR00 is dword 0.
2012-01-27intel: Plumb the context through the decode callchain.Eric Anholt
We still deref the context at the start of every call, but that will change next.