Commit Graph

3029 Commits

Author SHA1 Message Date
Xiang, Haihao 0ab2c05a29 render: fragments for composite on Sandybridge
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2010-11-02 14:28:55 +08:00
Xiang, Haihao 21c86548dc render: fix send instruction used in sampling fragments
To prepare for composite on Sandybridge

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2010-11-02 14:28:55 +08:00
Xiang, Haihao 8d008ca89d render: set the surface state base address
It is the same as commit 73d4c7d7

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2010-11-02 14:28:55 +08:00
Chris Wilson b5ae596a07 Flush BLT batches before starting an atomic RENDER batch
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-11-01 11:13:03 +00:00
Zou Nan hai 42363134bd Support BLT acceleration on gen6
Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-11-01 10:38:37 +00:00
Zou Nan hai 5bed685f76 add BLT ring support
gen6+ platform has a BLT engine with seperate
command streamer to support BLT commands.

Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
[ickle: merge trivial conflict]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-11-01 10:37:51 +00:00
Xiang, Haihao 6ec3ff134b Xv: don't call intel_wait_for_scanline on Sandybridge
MI_LOAD_SCAN_LINE_INCL command is not available on sandybridge.

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2010-11-01 08:51:55 +08:00
Xiang, Haihao 9e73cbd7ee Xv: enable TextureAdaptor for Sandybridge
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2010-11-01 08:51:51 +08:00
Xiang, Haihao 3213849907 Xv: setup pipeline for Xv on Sandybridge
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2010-11-01 08:51:13 +08:00
Xiang, Haihao 9e4dd27aa8 Xv: fragments for xv on Sandybridge.
Need to update intel-gen4asm to build these fragments

Signed--off-by: Xiang, Haihao <haihao.xiang@intel.com>
2010-11-01 08:46:14 +08:00
Xiang, Haihao e34b3f6ef5 Xv: Send instruction doesn't use implied move when sampling YUV surface
The two fragments will be reused for sampling YUV surface
and send doesn't have implied move on Sandybridge

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2010-11-01 08:45:51 +08:00
Xiang, Haihao 73d4c7d7b8 Xv: set the surface state base address
To prepare for Xv on Sandybridge. It is easy to fill the binding
table without relocation and make sure that the pointer to binding
table only uses bits[15:0].

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2010-11-01 08:38:25 +08:00
Chris Wilson 5afc7472b1 intel: don't pass a dangling pointer to GET_PARAM
I fail at cut'n'paste.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-29 12:25:23 +01:00
Chris Wilson 6b3ce2e870 uxa: Enable reduced fence sizes for i915
Depends on libdrm 362457715faacd3101929e5f0d8ae250d0ad09df (for
HAS_RELAXED_FENCING define).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-29 11:07:50 +01:00
Adam Jackson b066ddda31 intel: Listen for hotplug uevents (V3)
This connects the kernel uevent indicating monitor hotplugging to the
RandR notification events so that X applications can be notified
automatically when monitors are connected or disconnected.

This also adds a configuration option to disable hotplug events.

V2: missed a #ifdef HAVE_UDEV around some udev-specific declarations

V3: document Hotplug option in man page

Signed-off-by: Keith Packard <keithp@keithp.com>
2010-10-22 08:35:29 -07:00
Eric Anholt a1c54f6964 Fix violation of gen6 requirements for depthbuffer tiling.
In general, demoting of tiling of DRI2 buffers seems dubious, as we've
got various bits of functionality that won't all work together unless
buffers are tiled as expected.  This just covers one instance of the
problem, caught by assertions in Mesa.

Fixes:
fbo-1d
fbo-d24s8.
glean/readPixSanity
glean/rgbTriStrip
glean/scissor
2010-10-18 14:39:25 -07:00
Chris Wilson 33133a1d38 display: do not report failure for setting unrecognised properties
We need to accept any changes to properties not handled by ourselves -- we
can't validate the changes ourselves. Denying those changes breaks EDID
reporting, for example.

Reported-by: Elvis Pranskevichus <el@prans.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-17 09:24:22 +01:00
Chris Wilson 8507ef50ba Fix driverName regression for i830 from 4083197a
Reported-by: Stefan Glasenhardt <stefan@glasen-hardt.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30808
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-13 09:51:57 +01:00
Chris Wilson 15aab1ef98 Move EDID_COMPLETE_RAWDATA define to intel.h to avoid redifinition warning
The compiler was simply warning that we defined the name prior to
including the original definition, so reorder.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-13 09:51:57 +01:00
Stefan Dirsch d2bc2212f8 Make driver compile for 1.6 Xserver series again. Part deux.
Signed-off-by: Matthias Hopf <mhopf@suse.de>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-12 12:30:41 +02:00
Chris Wilson 5472359d68 dri: Check for pixmap privates before dereferencing them
It is still possible for the pixmap allocator to return a software only
pixmap (i.e. without an associated GEM buffer or intel_pixmap), so check
before dereferencing.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30707
Reported-by: Matthias Hopf <mhopf@suse.de>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-08 15:23:13 +01:00
Chris Wilson 4083197a44 Include a chipset generation number to clarify device specific paths.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-07 13:26:07 +01:00
Chris Wilson 1444ea3570 dri+shadow: Only tweak the acceleration of CopyRegion if using shadow.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-06 12:45:46 +01:00
Chris Wilson f286891d14 dri: Reattach the fake pixmap for the shadow scanout to the drawable.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-06 12:17:14 +01:00
Chris Wilson 707901bf98 uxa: Re-enable acceleration.
A side-effect of discriminating offscreen based on the devPrivate.ptr
was that it broke uxa_finish_access and so after any fallback to s/w on
a Pixmap, it remained in software for the reminder of its life.

Introduce an explicit boolean to mark whether or not hardware
acceleration is enabled for a pixmap (with a GEM buffer).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-06 12:17:14 +01:00
Chris Wilson 54f545e063 Revert "Clear pixmap->devPrivate.ptr [regression in 7c7294e]"
This reverts commit 48b4e224297fa807be0e2bc7a67bf7e94579e8de.

The better fix is to manually mark the pixmap when acceleration is and
is not permitted. Whilst the devPrivate.ptr are invalid upon creation,
it is not worth carring code that serves no purpose.
2010-10-06 12:17:14 +01:00
Chris Wilson d1925deedd Clear pixmap->devPrivate.ptr [regression from 7c7294e]
ModifyPixmapHeader(pixdata = NULL) does not clear the
pixmap->devPrivate.ptr, instead the NULL value is interpreted as meaning
to keep the current value. (This is similar to the interpretation of the
other invalid values like depth=-1 which also mean not to change the
current property). However pixadata=NULL is indeed a valid value, and in
7c7294e, devPrivate.ptr == NULL was used to differentiate a bo pixmap
from a system pixmap. Except that we never did clear the ptr as
intended, and so X would immediately crash.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-06 00:23:57 +01:00
Chris Wilson 4bf2182bf9 shadow: Use a cacheable shadow for all generations
Always avoid direct rendering to the uncached scanout buffer,
redirecting all 2D access to the shadow instead. Then for the couple of
platforms where either the BLT is not ready or cannot be trusted (i8xx)
perform the front buffer fixup using the uncached writes from the CPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-05 09:59:04 +01:00
Chris Wilson b27a521214 shadow: Enable shadow by default on SandyBridge
SandyBridge 2D support is far from complete, so instead of
permanently falling back and always using uncached GTT mapping for
rendering, use the shadow buffer instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-04 20:36:12 +01:00
Chris Wilson 3e641459f8 shadow: Disable BLT for SandyBridge
The blitting code is incorrect for SandyBridge so disable until
the BLT ring is ready.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-04 20:31:01 +01:00
Chris Wilson 7c7294ec00 shadow+dri2: Allow dri2 to be independently enabled with shadow
To enable DRI we create GEM buffers for the client to render into with
hardware acceleration. In order to maintain coherency between any 2D
render operations with the independent 3D clients (this includes the
reading of 2D rasterisation by the direct rendering client, e.g.
compiz using texture_from_pixmap) we need to replace the shadow pixmap
with the GTT mapping. Therefore 2D rendering to a DRI buffer will be to
uncached memory and thus penalised -- but the direct rendering clients
will have full hardware acceleration.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-04 20:24:36 +01:00
Chris Wilson 16a5d0ee3c shadow: Map the scanout directly on i8xx
Even with the minimal use of the BLT to copy from the GTT shadow to the
GTT scanout, i830 was still hanging. Just write to the scanout directly.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-04 11:21:17 +01:00
Chris Wilson 516d235c5b Split shadow handling routines to their own file.
This is about to get messy, so separate out the shadow from the normal
code.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-04 11:10:57 +01:00
Chris Wilson 455f2939a6 Do not claim the PCI device if !KMS
By returning FALSE whilst probing if we can't find a KMS driver, we
allow X to fallback to trying the VESA driver -- rather than failing.

The initial idea for this was by Julien Cristau.

Reported-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-02 13:32:58 +01:00
Chris Wilson 97fea2fd0c legacy/i810: Remove pVisualConfigs
Completely unused pulling in an undesired glxproto dependency.

Reported-by: Cyril Brulebois <kibi@debian.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30554
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-02 10:05:59 +01:00
Chris Wilson 8784c4f5a1 video: Disable TextureAdaptor for Sandybridge
The acceleration code does not yet exist, so we try to use gen4 shaders
which hangs the chip and makes everybody upset. Disable it until such a
time as support is written for Sandybridge XVideo.

Reported-by: Matthias Hopf <mhopf@suse.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30500
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-01 21:45:15 +01:00
Zhenyu Wang 345c963e44 Always use tiling on Sandybridge
Sandybridge requires kind of buffer must be tiling, like depth.
And we would or have all tiling cases handled fine. So not allow
user to turn off tiling on Sandybridge+ may be fine.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2010-09-30 11:02:22 +08:00
Chris Wilson 40c9d180bf Retry framebuffer allocation if first attempt fails.
If we are tiled, we may fail the allocation due to an EIO and so not
being able to set tiling. Try again with an untiled request in this
case.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-26 23:10:56 +01:00
Chris Wilson 537e73f3f9 Disable dri2 after forcing fallbacks
If we force fallbacks, then we will only create pixmaps in system
memory, preventing DRI2 from passing valid bo names to the clients. In
this case, they will just fallback to swrast. If we disable DRI2 after
forcing fallbacks (e.g. regenerating after a GPU hang or explicitly
disabled with the shadow buffer) then it is simpler just to disable the
extension and allow mesa to use pure swrast.

Reported-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-26 09:50:44 +01:00
Matthias Hopf b84925b9c0 Make driver compile for 1.6 Xserver series again.
Signed-off-by: Matthias Hopf <mhopf@suse.de>
2010-09-22 17:45:06 +02:00
Chris Wilson 99f8d68d3d display: Refactor is_panel()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-22 12:34:52 +01:00
Krzysztof Halasa bfba6d6148 Allow interlaced modes.
This may not the best method, but it should be a good base on which to
build...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-21 22:57:36 +01:00
Zhenyu Wang f63c7df686 Disable swap buffer wait on Sandybridge
MI_LOAD_SCAN_LINE_INCL command is not available on sandybridge.
I haven't got reply on any substitution for it, so turn it off for now.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2010-09-17 16:39:12 +08:00
Chris Wilson 55b5fe8880 Add alternate pci-id for B43
Confirmed by http://en.wikipedia.org/wiki/Intel_GMA

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30221
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-16 16:51:59 +01:00
Chris Wilson 08c2caca48 uxa: Apply source clipping to blits
Yes, this should be done in the higher layers. Yes, I have written code
to that. No, it is not ready, hence add the sanity check to the
SRC_COPY_BLT.

This isn't the first report that I've seen, but will be the last.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30120
Reported-by: rezbit.hex@gmail.com
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-13 01:10:48 +01:00
Chris Wilson ae160d7fbf shadow: Simply modify the Screen pixmap header
This is a slightly less risky strategy than having to remember to update
all pointers to the old Screen pixmap.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-10 13:19:12 +01:00
Chris Wilson 0515256490 display: Free the EDID blob after we copy it to the output, not before.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-10 00:08:58 +01:00
Chris Wilson 2b96c18165 Enable a shadow buffer and disable GPU acceleration.
An attempt to workaround the incoherency in gen2 chipsets, we avoid
using dynamic reallocation as much as possible.

The first step is to disable allocation of pixmaps using GEM and simply
create them in system memory without a backing buffer object. This
forces all rendering to use S/W fallbacks.

The second step is to allocate a shadow front buffer and assign that to
the Screen pixmap. This ensure that the front buffer remains in the GTT
and pinned for scanout. The shadow buffer will be rendered to in the
normal fashion via the Screen pixmap, and be marked dirty. In the block
handler, the dirty shadow buffer is then blitted (using the GPU) over
the front buffer. This should completely avoid having to move pages
around in the GTT and avoid incurring the wrath of those early chipsets.
Secondly, performance should be reasonable as we avoid the ping-pong
caused by the small aperture and weak GPU forcing software fallbacks.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-08 13:33:37 +01:00
Jesse Barnes 0fa4321a76 KMS: initialize backlight support for eDP panels too
Since being able to control the backlight is handy.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-09-07 13:56:16 -07:00
Jesse Barnes f56c839f30 KMS: rename LVDS fields to reflect actual usage
These are used for panels, not just LVDS connections, so name them as such.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-09-07 13:53:47 -07:00
Jesse Barnes 0d26d950fd KMS: add fake EDID on eDP too
This gives us a few more standard modes on eDP panels with just a simple
fixed timing in the VBT, just like on older, LVDS attached panels.

Fixes FDO bug https://bugs.freedesktop.org/show_bug.cgi?id=30069.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-09-07 13:48:59 -07:00
Chris Wilson 273d34fbc4 display: Query current level after finding max value.
The current backlight value is clamped to the valid range [0, max] and
so as we queried the value before setting the max, we forced the current
backlight to 0 and so set it to be zero on initialising the display.

Fixes:

  Bug 30063 - start X will modify brightness value to zero
  https://bugs.freedesktop.org/show_bug.cgi?id=30063

which is a regression due to 38f940dfea.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-07 13:00:23 +01:00
Zhenyu Wang 53767cc0d0 Add more sandybridge graphics device ids
New ids for GT2 and GT2+ on desktop and mobile sandybridge, and
server sandybridge device ids.
2010-09-07 14:17:05 +08:00
Chris Wilson 00f6af2c8e display: Set MONITOR_EDID_COMPLETE_RAWDATA for large EDIDs
Quoting Adam Jackson:

"But the X driver looks like
it never sets MONITOR_EDID_COMPLETE_RAWDATA, which means the X core
doesn't know that any sections beyond the first are present, so it won't
ever hand back more than 128 bytes to clients.  Boo."

This patch is based on his.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-04 18:51:32 +01:00
Chris Wilson 501e78b009 Force use of GTT and fence registers for mapping tiled objects
If the buffer object is tiled, we need to use the fence registers to
perform the appropriate untiling for CPU access. Ensure that we always
take this path for tiled objects, regardless of their size.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-04 12:37:39 +01:00
Chris Wilson b7a8087fbc Revert "Leave adjustment of backlight to the driver."
This reverts commit 9c3e34703d.

This commit is not ready, as first the driver needs to handle all
controllers, especially those that ignore the BLC and require their own
interface.  Fortunately, by moving that discovery into the kernel - where
it just means finding which ACPI device is attached to the video and has a
backlight interface - the userspace code should become much more sane,
and work even with multi-gpu, multi-lid systems.

But that is for tomorrow.
2010-08-26 00:59:33 +01:00
Chris Wilson 9c3e34703d Leave adjustment of backlight to the driver. 2010-08-25 15:01:41 +01:00
Zhenyu Wang 104cd0554b Add sandybridge D0 support
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2010-08-23 09:48:22 +08:00
Chris Wilson 271dda84be display: Use the native intel backlight controller
If the i915 driver exposes a native ACPI interface to modify the panel
backlight use it in preference to the generic interfaces. On multi-GPU
systems, the panel backlight is meant to be connected via the IGP and
this ensures that we always find the right interface.

Fixes:

      Bug 29273 - XORG Intel driver chooses wrong acpi_video to control
                  brightness in multi-GPU system
      https://bugs.freedesktop.org/show_bug.cgi?id=29273

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-22 19:57:24 +01:00
Chris Wilson 42312bbd8c Remove accel_pitch_alignment
This has to be 64 on all generations currently, so replace the variable
with a constant.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-22 09:54:18 +01:00
Matt Turner 7f86e5b5da Replace ROUND_* macros with ALIGN.
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-22 09:52:54 +01:00
Matt Turner b611bced15 Use ALIGN macro instead of open coding it.
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-22 09:52:42 +01:00
Chris Wilson 8b04b350a9 Open-code DRICreatePCIBusID()
During -configure we would attempt to query the availablility of KMS
before the DRI module was loaded, thus we were unable to create a valid
bus identifier and so the query failed and we disowned the device.

Fixes:

  Bug 29611 - Xorg -configure fails
  https://bugs.freedesktop.org/show_bug.cgi?id=29611

Reported-by: Sergey Samokhin <prikrutil@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-19 20:05:08 +01:00
Chris Wilson c882f6a22a Move registration of vsync fd from pre-init to screen-init
Marty Jack reported an issue he found where the page-flipping handler
was being lost on server reset. This results in the swap completion
notification being lost, with the sporadic hang of full screen
applications like Compiz, flash and even glxgears!

Fixes:

  Bug 29584 - Server in compute loop
  https://bugs.freedesktop.org/show_bug.cgi?id=29584

There are also several possibly related bugs with similar symptoms, i.e.
OpenGL applications hanging on missed swap notifications.

Reported-by: Marty Jack <martyj19@comcast.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Keith Packard <keithp@keithp.com>
2010-08-18 10:21:22 +01:00
Chris Wilson 19c48d3b3f display: outputs are enabled automatically by KMS
When an output is attached to a crtc and that crtc is enabled, the
output is automatically enabled so we can remove the redundant manual
dpms on.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-09 10:13:58 +01:00
Chris Wilson 6304cb048c display: Minor cleanup for adding extra LVDS modes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-05 18:17:18 +01:00
Chris Wilson 41ae956435 display: Refactor EDID attachment to output.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-05 18:16:35 +01:00
Chris Wilson a8919ab296 Revert "display: Cache whether we have probed for an EDID"
Dave Airlie advised that hotplug detection can be unreliable and that
mode caching, in general, should be done in the kernel in any case.

This reverts commit 622e600069.
2010-08-05 10:00:56 +01:00
Chris Wilson 622e600069 display: Cache whether we have probed for an EDID
Remember for the detection cycle whether we have already probed for the
EDID -- as this can be slow.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-04 10:05:09 +01:00
Chris Wilson a6a707ca13 display: Embed the lvds size into the connector
Remove one very common allocation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-04 10:05:09 +01:00
Chris Wilson 6c7d105cca display: Handle cursor error paths.
Check that the cursor was allocated before freeing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-04 09:51:34 +01:00
Chris Wilson 38f940dfea display: Tidy backlight initialisation
Mostly whitespace and a single error-code fix.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-04 09:50:14 +01:00
Chris Wilson 2b7263b771 display: Check for buffer overrun in output name lookup.
The kernel may know about more types than we do, so protect ourselves
from reading from beyond the end of the string array.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-04 09:46:01 +01:00
Dave Airlie 5662916691 intel: add output names for later additions to kernel 2010-08-04 15:35:41 +10:00
Chris Wilson fe7dee7fe1 Remove the final references to the drmmode prefix
In particular fix the compile regression for intel_do_pageflip().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-01 14:15:09 +01:00
Chris Wilson 4f8b279f32 intel_display: Miscellaneous tidy
A mixture of whitespace and closing of leaks on error paths.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-01 12:35:57 +01:00
Chris Wilson db7cd7b9f0 Rename drmmode_display to intel_display
And fixup all the drmmode_* functions to have an intel prefix and
categorise those into intel_mode, intel_crtc, intel_output and
intel_property so that the functions are a little more self-descriptive
and, more importantly, are consistent.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-01 11:27:29 +01:00
Kristian Høgsberg 0be3e95c84 Remove explicit batchbuffer submit in DRI2 copyregion
Now that we submit from the flush callback chain, we know we'll always
submit before the client receives the reply or event that blocks it from
rendering the next frame.
2010-07-30 09:39:58 -04:00
Kristian Høgsberg 69d65f9184 Submit batch buffers from flush callback chain
There are a few cases where the server will flush client output buffers
but our block handler only catches the most common (before going into select).
If the server flushes client buffers before we submit our batch buffer,
the client may receive a damage event for rendering that hasn't happened yet.

Instead, we can hook into the flush callback chain, which the server will
invoke just before flushing output.  This lets us submit batch buffers
before sending out events, preserving ordering.

Fixes 28438: [bisected] incorrect character in gnome-terminal under compiz
https://bugs.freedesktop.org/show_bug.cgi?id=28438

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2010-07-30 09:29:55 -04:00
Chris Wilson b68d4fcab5 drmmode: Only treat a backlight as connected if it has a non-zero max
Optimistically might help
https://bugs.freedesktop.org/show_bug.cgi?id=29273

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-28 13:42:15 +01:00
Kristian Høgsberg 938ef4eaec legacy: Remove long gone use of GlxSetVisualConfigs()
This removes the last dependeny on anything GL/GLX in the driver.
2010-07-28 07:58:02 -04:00
Kristian Høgsberg fba6651a92 Drop use of GL types in the driver
Still used in i810 for building the glx visuals.
2010-07-27 12:59:53 -04:00
Daniel Vetter f46a8dfce5 video: kill do { ... } while (ret != -EINTR) loops
Chris Wilson likes to sprinkle these all over, but in this
case it's just misleading. libdrm already does this for us.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-07-26 23:02:02 +02:00
Daniel Vetter 1cb69b9a77 video: kernel overlay needs triple buffering
The kernel overlay code does asynchronous overlay flips. So keep
onto two old buffers, for otherwise the rendering of the next
frame might overwrite the contents of the currently still displaying
one. With ~25fps videos and ~50 Hz screens that's rather unlikely,
still, fix it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2010-07-26 23:00:20 +02:00
Gaetan Nadon 68df6b2790 simplify Makefile as per-target compilation flags are not needed
Per-target compilation flags (libIntelXvMC_la_CFLAGS) are required
when multiple targets which require different compiler flags,
are build in the same makefile.

Automake issues a command with -c and -o flags which not all compilers
support. The object fles are prefixed with libIntelXvMC_la.
The macro AM_PROG_CC_C_O must then be used to provide this feature
on compilers that do not have it. If not, a warning is issued at make time.

This macros checks for compiler support and if missing, uses a "compile"
script it generates in the package root directory.

Currently the driver uses per-target flags but the macro is missing.
Rather than adding the macro, this patch stops using per-target flags
by using the AM_CFLAGS variable for all targets in the makefile, as
there is only one.

Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-07-24 09:21:02 -04:00
Chris Wilson 142ffa2872 video/i915: ValidateGC after setting clip.
Order is important. And ensure that the scratch GC is performing clip by
children.

Fixes:

  Bug 29213 - video artifacts if used dualscreen mode
  https://bugs.freedesktop.org/show_bug.cgi?id=29213

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-22 16:49:05 +01:00
Dave Airlie 7a4bfaf424 intel: respect tiling disable.
For testing purposes its nice to know tiling isn't being used anywhere.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-07-20 11:31:48 +10:00
Chris Wilson d48d584a82 video: Free the buffers immediately after turning off.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-16 10:31:58 +01:00
Chris Wilson 24bdfe0d5e video: Reuse the old buffers.
After passing the new buffer to the kernel, the old buffer is unpinned
and becomes available for re-use. So keep hold of the old buffer and
swap after a PutImage. This greatly reduces the amount of CPU time
consumed by the kernel on behalf of the video overlay -- by only
allocating two buffers for an entire sequence, we avoid clflushing and
page allocation on every frame.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-16 10:31:58 +01:00
Chris Wilson 2267e5928b Workaround a broken container_of define in list.h 2010-07-13 10:36:34 +01:00
Chris Wilson 798c3a5fc6 Teardown the bufmgr on shutdown as well.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-13 10:30:51 +01:00
Chris Wilson b2e98227d1 Remove the duplicate drmmode prototypes.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-13 10:15:34 +01:00
Chris Wilson 5de1b74d64 modes: There may be more than one crtc and output... DESTROY THEM ALL!
In order to cleanup all CRTCs and outputs on shutdown, we need to keep a
list of the individual structures and iterate over that list on
shutdown.

Also, the output and crtcs are configured just once and not for each
screen generation so move the shutdown to the termination and not on
CloseScreen. Oops.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-13 10:09:38 +01:00
Chris Wilson 3a7c25ff8d video: Apply overlay stride errata for i830 and i845
Due to an erratum on these chipsets, the overlay stride must be a
multiple of 256 bytes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-12 19:47:46 +01:00
Chris Wilson 56e5816252 video: Copy DummyEncoding into each adapter.
As we use the static DummyEncoding and may attempt to modify it for each
adaptor (on each device), we should use copies instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-12 17:40:55 +01:00
Chris Wilson 5ce3f536b7 drmmode: Destroy the output on shutdown
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-09 14:12:43 +01:00
Chris Wilson 6ff369cd26 drmmode: Destroy Crtc on screen shutdown
Should fix:

  Bug 26946 - CRTC cursor BO leak in 2D
  https://bugs.freedesktop.org/show_bug.cgi?id=26946

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-09 14:12:25 +01:00
Chris Wilson 6fba8c449f Add support for I854.
I spotted that the kernel knew of the I854, but the pci-id was never
added to the ddx.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-09 12:12:13 +01:00
Chris Wilson 141e88c873 video: forgotten amendment to previous commit.
An extra sanity check to skip the wait if all clipped...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-09 12:12:00 +01:00
Chris Wilson 272d1c14a3 video: apply the crtc box checks from dri.
The dri code is much more careful in ensuring that the scan lines that
is waits for are valid. Copy this code to video, with a bit of work this
can be refactored, and perhaps even teach dri how to handle rotated
front buffers.

References:

  Bug 28964 - [i965gm] GPU infinite MI_WAIT_FOR_EVENT while watching video
              in Totem
  https://bugs.freedesktop.org/show_bug.cgi?id=28964

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-09 10:50:52 +01:00