Commit Graph

806 Commits

Author SHA1 Message Date
riastradh
2ee2d4e588 Include some necessary header files and forward declarations. 2015-03-05 17:24:36 +00:00
riastradh
39be2cc0ab Remove outdated comment. The ->dev.parent stuff is part of the API. 2015-03-05 15:02:36 +00:00
riastradh
8cfa708e19 Mark pages dirty after use for write in the aperture (`GTT'). 2015-03-05 01:04:51 +00:00
riastradh
da1bc3098b Unwire pages when we're done in i915_gem_object_attach_phys. 2015-03-05 00:55:34 +00:00
riastradh
7582f7f3c9 CLFLUSH needs to be surrounded by membars.
While here, round everything to a multiple of the cache line size.
2015-03-04 18:19:27 +00:00
riastradh
7bdeaa6116 Return current pid and current euid from drm_getclient to fool libva. 2015-03-04 11:00:15 +00:00
riastradh
bdd8b1b6ce Re-enable prints to diagnose PR 49195.
I believe I fixed this problem by fixing __wait_seqno, but before I
remove the workaround I'll try to make sure it's not getting hit any
more.
2015-03-03 14:31:48 +00:00
riastradh
d6dfcdeae7 radeon_fence_wait returns 0, not positive, on success. 2015-03-03 13:57:20 +00:00
riastradh
dae0a2cc06 Replace `out' label by break.
Reduces diff from upstream a little.

No functional change, confirmed by diffing `objdump -dr' output.
2015-03-02 23:29:56 +00:00
riastradh
fb34b3a2a0 Narrow the scope of the gmbus wait lock to where we need it. 2015-03-02 23:05:03 +00:00
riastradh
96ef47eb7a Drop the gmbus wait lock to delay. 2015-03-02 18:36:49 +00:00
riastradh
afd556cfa9 Return the error if there is one in radeon_fence_wait_seq.
Don't just always say we succeeded!
2015-03-02 17:53:00 +00:00
riastradh
ae9280efd2 Don't sleep in the drm_vma allocator. Fail with ENOSPC, not ENOMEM.
Caller has dev->struct_mutex locked and will handle ENOSPC anyway.
2015-03-02 17:34:23 +00:00
riastradh
3bcdd265e2 Make sure wedged actually gets set on all code paths.
Otherwise GCC helpfully realizes we're invoking undefined behaviour
and optimizes away the possibility that this routine will return
success, without saying a word about it.
2015-03-02 17:30:17 +00:00
riastradh
8aae5c1e3e Fix broken error checking in kmalloc_array/kcalloc. 2015-03-02 02:26:37 +00:00
mrg
9a104ac13a fix some comments about the half-working i386 hack. 2015-03-01 10:07:01 +00:00
riastradh
fd2bb02c5e Actually poll every tick as advertised. 2015-02-28 21:30:22 +00:00
riastradh
74ed5123ca Remove extraneous blank line. 2015-02-28 21:17:32 +00:00
riastradh
a52fa629a5 New macro DRM_SPIN_WAIT_ON better reflects DRM_WAIT_ON.
We still need to adapt all waits from upstream to use an interlock,
so we can't implement DRM_WAIT_ON verbatim, but this more closely
reflects the API of DRM_WAIT_ON than DRM_*WAIT*_UNTIL do.

Major difference is that this polls every tick, like DRM_WAIT_ON,
unlike DRM_*WAIT*_UNTIL.  So it will mask missing wakeups, but it
wouldn't surprise me if there were such things upstream.
2015-02-28 18:25:39 +00:00
riastradh
6e783fa3c8 Match Linux's wait for gmbus a little more precisely.
Don't just wait up to 50 ms for a gmbus interrupt -- poll every tick
for >=50 ms.
2015-02-28 14:10:00 +00:00
riastradh
50797df5dd Another upstream uninterruptible. 2015-02-28 05:42:07 +00:00
riastradh
b49b6cccd5 These are uninterruptible upstream too. 2015-02-28 05:38:49 +00:00
riastradh
c0e49bed9f This one is uninterruptible upstream too. 2015-02-28 05:37:10 +00:00
riastradh
41c73966f3 Elaborate on essay about DRM_*WAIT*_UNTIL reutrn convention. 2015-02-28 04:57:12 +00:00
riastradh
1764a2cd49 Fix two more gmbus wait bugs.
- Fix sense of return value in intel_dp_aux_wait_done.
- Make the waits uninterruptible here like in Linux.
2015-02-28 04:54:12 +00:00
riastradh
900c8c0ef4 Make timed and untimed cases of __wait_seqno agree on return value. 2015-02-28 04:47:44 +00:00
riastradh
6e671c0df3 Fix sense of conditional in wait while cold. Functional change! 2015-02-28 04:18:12 +00:00
riastradh
a74fbdef46 Simplify wait while cold. No functional change. 2015-02-28 04:17:37 +00:00
riastradh
9f6b9af91f More DRM_TIMED_WAIT mistakes: 0, not -ETIMEDOUT, for timeout. 2015-02-28 03:33:22 +00:00
riastradh
0fe69285b7 Recheck condition after wait in wait_for like Linux does. 2015-02-28 03:27:38 +00:00
riastradh
c22bc250dc Fix these drm waits too, in case anyone tries to use this via code. 2015-02-28 03:23:32 +00:00
riastradh
5919a0453e Write an essay to remind myself about (timed) wait return values. 2015-02-28 03:22:50 +00:00
riastradh
32fb3c782c And another timeout return value mistake. 2015-02-28 03:06:46 +00:00
riastradh
34a2befd8a Clarify comment in last commit. 2015-02-28 03:05:09 +00:00
riastradh
5af39c7521 Fix another *@!#^$@!& timeout return convention mistake. 2015-02-28 03:03:30 +00:00
riastradh
f6920c646c Fix typo: __gtt_iomem, not __acpi_iomem. No functional change. 2015-02-27 16:02:03 +00:00
riastradh
8363517855 Also get the sense of the condition to wait until right. @!&#^$@!&* 2015-02-27 04:40:17 +00:00
riastradh
5fbac436ac Make gmbus_wait_hw_status consistently use 50ms timeout like Linux.
Apparently I changed this to a 1-tick timeout.  No clue why.
2015-02-27 04:35:02 +00:00
riastradh
58fea22061 Limit scope of ret and omit needless use of it to reduce confusion. 2015-02-27 04:29:27 +00:00
riastradh
066a045600 ...aaaaand one more fix for __wait_seqno return value. 2015-02-26 23:32:40 +00:00
riastradh
f94741bf4c Another attempt to fix the drm timed wait blarf blugh blahhh. 2015-02-26 23:27:41 +00:00
riastradh
722ec83fe7 Omit needless bus_dmamap_sync -- they're batched for gart updates. 2015-02-26 23:00:05 +00:00
riastradh
b522b62fa2 Fix return code of __wait_seqno.
MAX(ret, 0) is 0 if ret is negative, but if ret is negative we want
to return that negative value, meaning error.  Should've been
MIN(ret, 0), but I'll just rewrite it to clarify a wee bit.

If the GPU reset, call i915_gem_check_wedge and always return failure
like Linux does.  Caller must retry in that case.
2015-02-26 19:43:43 +00:00
riastradh
b3c8e40fbd Fix returned timeout in wait_seqno: remaining time, not time slept. 2015-02-26 14:10:14 +00:00
riastradh
dbd4128628 Another round of nouveau whack-a-mole.
Nouveau compiles now, though it doesn't link yet.

Need to write driver attachment, wscons framebuffer, &c.  Probably
also some i2c stuff.
2015-02-25 22:11:59 +00:00
riastradh
6e33c83b5f <linux/vgaarb.h> needs <sys/types.h> and <sys/errno.h>. 2015-02-25 21:55:30 +00:00
riastradh
5b8aff708e Another round of whack-a-mole with nouveau. 2015-02-25 17:29:42 +00:00
riastradh
9a2add20ac Add clamp to <linux/kernel.h>. 2015-02-25 15:50:16 +00:00
riastradh
91850c8312 Add hweight8 (hamming weight of 8-bit quantity). 2015-02-25 15:40:20 +00:00
riastradh
389d09bf31 Add kstrtol. 2015-02-25 15:11:07 +00:00