Commit Graph

3054 Commits

Author SHA1 Message Date
Keith Packard aa0328f342 dri2: Make DRI2FrameEvent public and use instead of void *
Instead of using void * for all of the flip_info and swap_info
pointers, just make the underlying structure a public data type and
use that.

Signed-off-by: Keith Packard <keithp@keithp.com>
2011-03-23 17:14:12 -07:00
Chris Wilson ee740778f5 i915/video: Clip indirect Xv output
In the case of a singular clip box and rendering onto the front buffer
larger than 2048, the clip extents were being ignored.  Here we can
simply reduce the size of the indirect pixmap to the clip extents.

Reported-by: Michael Chang <mchang@novell.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35346
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-16 08:40:08 +00:00
Chris Wilson 014fc7abb7 dri: Disable page-flip between a tiled buffer and a linear scanout
Keith Packard pointed out a loophole that could cause the DDX to end up
with a tiled scanout even if the user required a linear framebuffer;
that is by using page-flipping we could replace the scanout pixmap with
another of our choosing, and not necessarily tiled.

Close that loophole by only allowing an exchange of buffers between
identical tiling modes. For the common case, this is fine since they
will indeed be allocated with the same tiling. For the linear
framebuffer case with mesa using a tiled pixmap, we force it to blit
onto the scanout instead.

Reported-by: Keith Packard <keith.packard@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-09 17:10:50 +00:00
Chris Wilson 049ce4397d Give each user of tiling separate xorg.conf options
So that you can indeed allocate a linear framebuffer if you so desire
without breaking mesa.

Adds:

Section "Driver"
  Option "LinearFramebuffer" "False|True" # default false
EndSection

to xorg.conf

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-09 08:37:02 +00:00
Chris Wilson 0bb1a5f19e Update priv->stride after bo reallocation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-09 08:26:44 +00:00
Chris Wilson e889d3a709 dri: Protect against destroying a foreign DRI drawable
I have no clue as to how such an alien drawable reached us, but we have
the evidence of a segfault to say it can happen.

Reported-by: Bernie Innocenti <bernie@codewiz.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34787
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-27 10:51:50 +00:00
Daniel Vetter d21d781466 Fix relaxed tiling on gen2
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-22 18:33:04 +01:00
Bryce Harrington 9599fde65a Quell excessively verbose vblank counter failed error messages
Certain error situations can result in the following printed to
Xorg.0.log at a high enough rate to make log file size a problem.

(WW) intel(0): I830DRI2GetMSC:1062 get vblank counter failed: Invalid argument
(WW) intel(0): I830DRI2ScheduleWaitMSC:1118 get vblank counter failed: Invalid argument

Following in the tradition of commit 0ad6d6e1, limit the warnings to be
output 5 times, then quell the remainder.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34322
Ref.: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/710594

Signed-off-by: Bryce Harrington <bryce@canonical.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-19 19:06:03 +00:00
Adam Jackson 0ca595e9d5 Fix IGD and IGDNG constants to be comprehensible
Since, with GPU-on-package, it's hard to talk about a model number for
a specific chipset like 855GM, just use the platform names.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-17 20:36:45 +00:00
Chris Wilson 23f9b14df7 i965: Remove broken maximum base addresses from video
WRONG.

The hardware was never limited to 0x1000000 and the kernel can quite
rightly place objects above that limit. Specifying such had no relation
to reality, so why did we do it? TWICE!

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34017
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-12 10:42:34 +00:00
Chris Wilson ce1e096905 Rename 'intel' backlight to match upstream name in 2.6.38
(Just waiting for libbacklight to bring sanity...)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-31 20:27:26 +00:00
Cyril Brulebois 80f59c8a4f xvmc: Stop using uninitialized variable.
The actual code was removed in 5f64122551, where the get_surface_status
driver callback was dropped. Just return Success if there were no issues
with the parameter.

Get rid of the following with CFLAGS="-Wall -Werror":
|   CC     intel_xvmc.lo
| cc1: warnings being treated as errors
| intel_xvmc.c: In function ‘XvMCSyncSurface’:
| intel_xvmc.c:677: error: ‘ret’ may be used uninitialized in this function
| intel_xvmc.c:672: note: ‘ret’ was declared here

Signed-off-by: Cyril Brulebois <kibi@debian.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-31 10:00:31 +00:00
Cyril Brulebois 86284abafb xvmc: Silence gcc, adding a cast to work around signedness issues.
Both exported XvMCPutSlice/XvMCPutSlice2 functions have a prototype with a
parameter whose signedness differs from the one in the put_slice/put_slice2
functions they call. Make it unsigned through a cast.

Get rid of this accordingly with CFLAGS="-Wall -Werror":
|   CC     intel_xvmc.lo
| cc1: warnings being treated as errors
| intel_xvmc.c: In function ‘XvMCSyncSurface’:
| intel_xvmc.c:677: error: ‘ret’ may be used uninitialized in this function
| intel_xvmc.c:672: note: ‘ret’ was declared here

Signed-off-by: Cyril Brulebois <kibi@debian.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-31 10:00:16 +00:00
Cyril Brulebois fc2eb64d7a xvmc: Silence gcc, add parentheses around arithmetic.
Get rid of those accordingly with CFLAGS="-Wall -Werror":
|   CC     i915_xvmc.lo
| cc1: warnings being treated as errors
| i915_xvmc.c: In function ‘i915_mc_one_time_state_emit’:
| i915_xvmc.c:369: error: suggest parentheses around arithmetic in operand of ‘|’
| i915_xvmc.c:374: error: suggest parentheses around arithmetic in operand of ‘|’
| i915_xvmc.c:379: error: suggest parentheses around arithmetic in operand of ‘|’
| i915_xvmc.c: In function ‘i915_mc_load_indirect_render_emit’:
| i915_xvmc.c:708: error: suggest parentheses around arithmetic in operand of ‘|’
| i915_xvmc.c:713: error: suggest parentheses around arithmetic in operand of ‘|’

Signed-off-by: Cyril Brulebois <kibi@debian.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-31 09:59:04 +00:00
Cyril Brulebois 1b9349bceb xvmc: Silence gcc, add parentheses around assignment.
Get rid of the following with CFLAGS="-Wall -Werror":
|   CC     intel_xvmc_dump.lo
| cc1: warnings being treated as errors
| intel_xvmc_dump.c: In function ‘intel_xvmc_dump_open’:
| intel_xvmc_dump.c:41: error: suggest parentheses around assignment used as truth value

Signed-off-by: Cyril Brulebois <kibi@debian.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-31 09:58:33 +00:00
Cyril Brulebois ae8877e307 xvmc: Get rid of unused variables.
Signed-off-by: Cyril Brulebois <kibi@debian.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-31 09:58:11 +00:00
Chris Wilson a5a1ab7bbc i915: Remove unused 'w' and 'h'
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-28 17:20:06 +00:00
Chris Wilson 2c9b3225d8 i915: Remove unused 'num_floats' variable
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-28 17:19:39 +00:00
Xiang, Haihao 5baa63c634 Fix an error in 4c4ad55556.
See the original patch at https://bugs.freedesktop.org/show_bug.cgi?id=24767

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2011-01-21 09:02:16 +08:00
Chris Wilson 3e28a0c0b4 Create the UXA generational resources during screen create
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-20 15:13:33 +00:00
Xiang, Haihao 4c4ad55556 Correct offset of planes within clipped window
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=24767
Reported-and-tested-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-19 15:25:45 +00:00
Eric Anholt 5a22bc999d Quiet compiler warning about is_affine_src same way we do is_affine_mask. 2011-01-17 11:32:37 -08:00
Simon Farnsworth 3a2a4b0784 Fix textured video when destination is larger than screen
In our application, the screen is never rotated from the point of view
of the driver; instead, the compositor applies a suitable rotation as
it composites the display. This works fine on 945, but on 965, videos
are limited in height to the actual height of the screen.

Change various bits of code so that we use the width and height of the
destination pixmap instead of the width and height of the virtual
screen. This works correctly both for XVideo to offscreen storage
(CompositeRedirect) and for XVideo to the screen (no compositor).
2011-01-17 11:31:38 -08:00
Chris Wilson fd9235ebe0 Delete unused memory allocation flags.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-08 19:46:37 +00:00
Chris Wilson 03248a7984 Cache the fixed crtc<->pipe relationship
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-08 19:46:36 +00:00
Chris Wilson 00a2aee38d Remove unused I830Output
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-08 19:46:36 +00:00
Chris Wilson a851879695 Remove bitrotted, but fortunately unused, I830CrtcPrivate
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-08 19:46:36 +00:00
Chris Wilson f8a5d7737e Delete some dead code
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-08 19:46:36 +00:00
Chris Wilson 968151898b Remove unused GTT/Map sizes and addresses
These have been made obsolete by KMS and GEM.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-08 19:46:36 +00:00
Chris Wilson 19b5817a54 Remove unused struct _intel_memory definition
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-08 19:46:36 +00:00
Chris Wilson 22d7b61791 i965: Fix off-by-one in assert
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-04 12:32:01 +00:00
Chris Wilson 6d50f5a140 If the crtc is not enabled, then it can't be on
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-03 23:06:14 +00:00
Adam Jackson 145c42a101 dri2: Fix interlace computation
scrn->currentMode is a hack for xf86vidmode and in general is wrong for
RANDRful drivers.  Use the mode on the associated CRTC instead.

Signed-off-by: Adam Jackson <ajax@redhat.com>
[ickle: crtc->mode is a ModeRec not Ptr]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-03 23:04:13 +00:00
Adam Jackson b0d10ff04a xv: Fix interlace computation
scrn->currentMode is a hack for xf86vidmode and in general is wrong for
RANDRful drivers.  Use the mode on the associated CRTC instead.

Signed-off-by: Adam Jackson <ajax@redhat.com>
[ickle: crtc->mode is a ModeRec]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-03 23:02:49 +00:00
Chris Wilson 0ad6d6e1a6 dri: Only issue a warning for an "impossible" flip return 5 times
As it appears that some kernels do indeed return the "wrong" value,
issuing a warning 60 times a second is a cruel and unusual punishment.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32680
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-03 16:54:31 +00:00
Chris Wilson d729ef02f2 dri: Don't wait upon a NULL current mode
There is a race condition between the dri swapbuffers code and
hotplugging whereby we might attempt to execute a wait upon a
non-existent output. This causes a NULL dereference and a loud crash.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32770
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-02 09:11:10 +00:00
Chris Wilson 537fa55ed2 dri: Fix the use of the uninitialised bo for flink
Reported-by: Jeff Chua <jeff.chua.linux@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-02 09:06:28 +00:00
Chris Wilson dbc542b9d3 dri: Protect against using dri with an non-gem pixmap
Reported-by: Jeff Chua <jeff.chua.linux@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-31 23:29:31 +00:00
Chris Wilson 53fbc9f176 Don't replace the scanout bo through PutImage
As the bo may be pinned for either use by the scanout or through sharing
with another application, under those circumstances we cannot replace
the bo itself but must force the blit for PutImage.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31367
Reported-and-tested-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-30 16:48:52 +00:00
Chris Wilson 7667ad8432 dri: Differentiate identical "get vblank failed" messages with line no
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-24 09:42:29 +00:00
Chris Wilson 875d482835 i830: amalgamate consecutive composites into a single primitive
Improve aa10text on i845 from 218kglyphs/s to 234kglyphs/s

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-23 19:42:19 +00:00
Chris Wilson 58d9912e44 Remove the deprecated function 'XNFprintf'
As we know the maximum length of the string, we can replace our single
usage of XNFprintf with snprintf.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-22 13:50:53 +00:00
Chris Wilson 1ac2e04023 Undo: Disable BLT for i830 and 845G
Reported-by: György Balló  <ballogy@freestart.hu>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32482
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-20 10:59:28 +00:00
Chris Wilson 6f21405454 G35 is gen4 and not gen3
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32478
Reported-and-tested-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-20 10:49:42 +00:00
Mario Kleiner 5743c22387 Check consistency of pageflip completion vblank count.
Implements a consistency check on returned vblank
count values of pageflip completion. Impossible
values are detected, a x-warning is logged and
returned (msc,ust) values are marked invalid,
so clients could perform error handling. Such
a warning would indicate bugs in the pageflip
completion routine of future kms drivers or the
ddx and thereby aid driver debugging.

Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-16 11:42:43 +00:00
Mario Kleiner 2177e60321 Fix reporting of pageflip completion events on multi-head.
When a drawable is page-flipped on multiple crtc's (fullscreen
drawable on mirror-mode or multi-head x-screen), only one pageflip
event is finally delivered, after the last participating crtc signals
flip completion, this to avoid visual corruption.

Old code returned vblank count and timestamps of flip completion
of this last crtc, instead of the values of the "master crtc", the
one that was used for initially scheduling/triggering the pagflip
via vblank events. (master = I830DRI2DrawablePipe(drawable))

This patch makes sure that the pageflip completion values of the
"master" crtc are returned, otherwise client applications will
get confused by the random (msc, ust) values returned by whichever
crtc was the last to complete its flip. Without this, the returned
values change randomly and jump forward and backward in time and
count.

Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-16 11:42:43 +00:00
Chris Wilson 9b967807c2 Revert "i965: The RenderCache flush after every glyph is required for compiz"
This reverts commit 03e8351179.

* sigh.

This was only meant to be a temporary debugging hack, not for public
consumption (or embarrassment).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-07 20:47:17 +00:00
Chris Wilson 27e33928f8 i965: Mark sure we mark reused render targets as dirty
... or else we may forget to flush them again.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-07 20:43:22 +00:00
Chris Wilson 03e8351179 i965: The RenderCache flush after every glyph is required for compiz
... now who can explain why.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-07 19:27:57 +00:00
Chris Wilson d90c8f4d0b i965: Invalidate pixmap binding location on reuse.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-07 19:22:30 +00:00