Commit Graph

48 Commits

Author SHA1 Message Date
Dave Airlie 183a0728ba uxa: fix getmsc to not fail hard
If some outputs go away we race with this call and apps
get X errors and fall over. Do what SNA does and don't
bother trying.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-05-21 07:47:57 +01:00
Dave Airlie 197ab0cda0 uxa: fix pageflips on 3 head scenarios
While fixing up UXA for MST I eventually fell over this bug.

Signed-off-by: Dave Airlie <airlied@redhat.com>
[ickle: replace constant with macro to track pipe-dependent code]
2014-05-20 07:46:48 +01:00
Chris Wilson 935ec0abcb uxa: Remove misnomer from ATI logs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-21 08:22:44 +01:00
Eric Anholt b771b41f0a uxa: Fix load_cursor_argb for the new Xorg ABI.
Returning an undefined value meant we might get sw cursors.
2014-04-10 09:07:38 +01:00
Eric Anholt d812afc1d4 Use fbpict.h instead of defining its prototypes ourselves.
fbpict.h has been an installed header since 2008, shortly after uxa
landed.  This fixes compiler warnings when other headers happen to
include fbpict.h.
2014-04-10 09:07:38 +01:00
Eric Anholt a6919aa980 Update for glamor in the 1.16 server.
We should link against the server's copy, insted of using the external
library.
2014-04-10 09:07:38 +01:00
Chris Wilson 15be6b7c9a uxa: Implement minimal flushing for bdw+
Based on the patch by Kenneth Graunke,
"Several places (such as intel_cache_expire) call intel_emit_batch_flush,
so it needs to work on Broadwell.  Sometimes the batch is empty, in
which case current_batch may not yet be BLT_RING.

The PIPE_CONTROL code has not been ported to work on Broadwell, so
trying to do a render ring flush will hang the GPU.  It also doesn't
make any sense to do a render ring flush, given that we never use the
render ring for UXA on Broadwell."

Cc: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-18 16:52:40 +00:00
Chris Wilson 4a6e09c6cd uxa: Add support for server managed fds (via intel_device)
Based on the patch by Hans de Goede, this removes the handling of
drmOpen() and DRM_MASTER from within uxa and instead uses the common
routines. This reduces the duplicate code from within uxa, and enables
new features such as server managed fds.

Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-18 15:52:19 +00:00
Kenneth Graunke cbcc1b6190 uxa: Enable BLT acceleration on Broadwell.
This supports solid, copy, put_image, and get_image acceleration via the
BLT engine.  RENDER acceleration (composite) and Xv would be piles of work,
which is not worth doing since SNA exists, and Glamor is coming.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-13 15:04:59 +00:00
Kenneth Graunke c1d7abadbb uxa: Remove implicit length from BLT command #defines.
These command packets grew on Gen8.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-13 14:52:59 +00:00
Chris Wilson 268842a47f backlight: Amalgamate hardcoded priority tables
Our fallback path for finding the backlight interface uses a hardcoded
table of known backlight controllers in proirity order. Rather than
maintain this table twice in the midst of the KMS logic, push it to the
new set of common backlight routines.

This incorporates bugfixes from SNA to handle unknown backlights, but
usable, gracefully.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-15 20:56:24 +00:00
Chris Wilson 3d629c91cf intel: Add a helper for setting backlight without root rights
Once the xserver stops running as root on kms capabable systems, we will need
some other way to access the backlight.

The approach taken in this patch moves most of the heavy lifting to a
helper that runs with root privileges and pipes our requested brightness
into the sysfs backlight interface. Where required, we use pkexec to
launch the helper with the elevated privilege.

v2: Amalgamate much more of the duplicate code.
    Keep the daemon and pipe alive for the lifetime of the backlight interface.
    Provide an alternative for systems without PolicyKit.

Signed-off-by: Hans de Goede <hdegoede@redhat.com> [v1]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-15 15:33:47 +00:00
Chris Wilson 9a9f6a9487 uxa: Check for access to backlight interface
Before attaching properties to any connector, check that we can indeed
control the backlight through the sysfs interface by doing an access
check. If the xserver is started without root privileges, we cannot
write through /sys/class/backlight and so should take care not to
advertise that we can.

Reported-by: Hans de Geode <hdegeode@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-13 16:26:49 +00:00
Chris Wilson 72e909953c Revert "uxa: Do not change DPMS mode on unconnected outputs"
This reverts commit 4497212307.

Unfortunately, this simple fix does not work for UXA as DPMS is used by
the xserver to turn off CRTCs and outputs. Since UXA does not implement
CRTC DPMS, this commit causes us to fail to turn off outputs.

The kernel has been fixed up in the meantime and that commit has been
recommended to be backported to all stable kernels:

commit c9976dcf55c8aaa7037427b239f15e5acfc01a3a
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Sep 29 19:15:07 2013 +0100

    drm/i915: Only apply DPMS to the encoder if enabled

so it should be safe for UXA to rely on its old behaviour.

Bugzilla: https://code.google.com/p/chromium/issues/detail?id=341135
References: https://bugs.freedesktop.org/show_bug.cgi?id=68030
Suggested-by: Dominik Behr <dbehr@google.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-13 09:52:32 +00:00
Chris Wilson 6fc46adb18 uxa: Do not expose TextureVideo Xv adapters when acceleration is disabled
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-06 09:24:17 +00:00
Chris Wilson 3e784832a5 glamor: Enable Xv support
In addition to the UXA texture paths (which in theory support VSync) and
direct overlay support, create a textured video paths that utilize the
glamor acceleration code.

Requested-by: Fabio Pedretti <fabio.ped@libero.it>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74311
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-01 16:59:13 +00:00
Chris Wilson 9f3fc9ec49 Allow selection of glamor as the default acceleration method
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74162
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-28 21:56:23 +00:00
Chris Wilson 59e769e1b1 glamor: Don't require the glamoregl module to be pre-loaded with xserver >= 1.15
Inspired by (ok, copied from):

xf86-video-ati commit f2a0a5cf6c5a21e2a02280e110a4eb8e6609dace
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Wed Jan 22 11:04:42 2014 +0900

    Don't require the glamoregl module to be pre-loaded with xserver >= 1.15

    The issues with loading it on demand have been fixed in xserver 1.15.

    Inspired by Jérôme Glisse on IRC.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-23 17:37:04 +00:00
Rinat f23ab963c4 Provide DRI2DriverVDPAU for future compatibility
Since 2010, DRI2 supports multiple driver names. That was added to ease
selection of appropriate driver by libvdpau. As for today, intel driver
support only DRI2DriverDRI (== 0), but not DRI2DriverVDPAU (== 1).

Although there is no any hardware-specific VDPAU driver for intel video
adapters at the moment, it would be easier to use generic drivers like
libvdpau-va-gl by creating symlink named libvdpau_i965.so.1. That way
appropriate driver will be selected in run time automatically:
libvdpau_i965.so.1 on i965 equipped machines, and libvdpau_nvidia.so.1
on nvidia equipped ones.

[ickle: Whilst I think this is a workaround for a brainfart in libvdpau
that it defaults to libvdpau_nvidia.so rather than first to
libdvpau_${DRI2DriverDRI} and then to a hardcoded libvdpau_backend.so,
I have no better solution, and this does seem in accordance with the
spec.]

Signed-off-by: Rinat <ibragimovrinat@mail.ru>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73507
2014-01-17 10:54:21 +00:00
Chris Wilson 82fa7ec352 uxa: Always treat DPMSModeSuspend/Standby similar to DPMSModeOff
As we assume that Suspend, Standby alias to Off and disable the crtc
when switching to any mode other than On, we need to also perform the
backlight updates for Suspend,Standby prior to passing the DPMS value
onto the kernel.

Suggested-by: Alexander Monakov <amonakov@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-06 14:39:07 +00:00
Chris Wilson 28a057105b uxa: Disable updating properties upon reading their values
Backport commit e76b08cad2
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Oct 15 12:46:09 2013 +0100

    sna: Disable updating properties upon reading their values

in order to prevent random screen blanking upon return from DPMS.

Reported-by: Alexander Monakov <amonakov@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73181
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-06 14:38:10 +00:00
Chris Wilson 28810d5b36 uxa/dri: Pixmap are offscreen and not attached to any display
As the code current assumes that pixmaps are located at screen origin
(0,0), it assumes that they are all on the first CRTC. However, since
they are offscreen, this leads to such complications as attempting to
emit vsync swapbuffers, and even worse attempting to swap a GLXPixmap
onto the scanout following a DRI2SwapBuffers.

Reported-by: Alexander Monakov <amonakov@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73282
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-06 14:26:38 +00:00
Zdenek Kabelac 00dcb4f229 uxa: fix order of inline Bool
Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
2013-11-25 10:04:49 +00:00
Zdenek Kabelac 175b8711f8 uxa,legacy: use unsigned for comparition of unsigned
Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
2013-11-25 10:04:49 +00:00
Zdenek Kabelac 318f100d73 uxa: Avoid relying on an assert and cleanup iterator
Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
2013-11-25 10:04:49 +00:00
Zdenek Kabelac b419691e27 uxa: rename some local variable to not shadow global ones
Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
2013-11-25 10:04:49 +00:00
Zdenek Kabelac 6f066b6714 uxa: Ensure mask_picture is defined
Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
2013-11-25 10:04:49 +00:00
Chris Wilson 34057611c6 Correct type of uevent_handler
xf86AddGeneralHandler returns an opaque pointer, not a function pointer.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-25 10:04:49 +00:00
Zdenek Kabelac d2df10e28f Remove uneeded headers
Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
2013-11-25 10:04:47 +00:00
Zdenek Kabelac 2275ef581e Makefile convert @var@ to $(var)
Avoid using @var@ since this could not be easily overwritten through
'make var=xxx' option which is normally available.
For Makefile.am users should avoid using @var@.

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
2013-11-25 09:25:56 +00:00
Chris Wilson 0ee29c4ea3 uxa,sna: Prevent bo exchange when pinned for non-DRI2 clients
With the advent of DRI3 (and previously with Prime and Glamor) we have
external clients who rely on the pixmap<->bo mapping being invariant.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-22 13:37:00 +00:00
Chris Wilson d507b6b982 Prepare for changes in the BLT unit on future generations
Adapt the legacy BLT commands in preparation for future changes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-02 13:50:15 +00:00
Chris Wilson f9a18c9f38 uxa: Check for allocation failure in i915 video
For a large screen, we have to create a temporary surface for rendering
the textured video. If this pixmap creation fails we may be left with a
system memory only pixmap leading to a segfault.

Reported-by: Bas Wijnen <wijnen@debian.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-13 10:40:21 +01:00
Chris Wilson 978b93a20b uxa: Abort CreateScreenResources after allocation failure
One of UXA's invarients is that the ScreenPixmap is complete (i.e. has
an intel_pixmap private with a bo attached). If we fail to create that
private during CreateScreenResources we will die very soon afterwards,
so just report the failure and shutdown gracefully.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-13 10:40:21 +01:00
Chris Wilson 6c157a925f intel: Remove dependence upon having PciInfo
After some probing mechanisms, we may end up with a valid device without
knowing its PCI address a priori. Having a valid device, we can just
query it for the correct device id, and can safely abort any path that
requires PCI information that we don't have. (Those paths are not valid
under such hosting anyway - if it may be required, we could reconstruct
the address.)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-03 16:13:38 +01:00
Chris Wilson 4497212307 uxa: Do not change DPMS mode on unconnected outputs
The operation is in theory redundant, and in the case of Haswell where
we have multiple outputs aliasing to the same encoder, actually harmful.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68030
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Stefan Dirsch <sndirsch@suse.de>
2013-09-20 11:45:47 +01:00
Chris Wilson dcf9b5ae18 intel: Compile fixes for base install of SLED11.sp3
Highlights of that distribution include xorg-xserver-1.6.5, kernel
3.0.76 and gcc-4.3.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-18 12:49:41 +01:00
Chris Wilson cb35a0b19a uxa: Restore the lost copyright block after splitting i965_reg.h from i915_reg.h
Reported-by: "Lim, Siew Hoon" <siew.hoon.lim@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-16 08:48:32 +01:00
Raul Fernandes c6add09791 Micro-optimise box intersections
We can shave a few instructions off the routine by incrementally
performing the "is-empty" check as soon as we compute the intersection
in each dimension.
2013-08-08 09:28:20 +01:00
Damien Lespiau c5e3b66c27 uxa/display: Keep the EDID blob around for the lifetime of an output
xf86InterpretEDID() doesn't copy the EDID raw data in xf86MonPtr but
just stores the given pointer. The DDX driver needs to make sure that
data stays valid.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-07-31 18:57:28 +01:00
Egbert Eich 8619db7224 Add support for the dell backlight interface
Signed-off-by: Egbert Eich <eich@freedesktop.org>
[ickle: Add the failsafe to sna as well.]
2013-07-29 13:05:03 +01:00
Chris Wilson 3cb75950a9 uxa: Fix incorrect include path
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-29 11:05:28 +01:00
Chris Wilson 5e9decc963 uxa: Add the missing include to silence the compiler warning
Silence compiler warning for no prior declaration of intel_init_scrn().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-28 16:51:32 +01:00
Chris Wilson bd6ffd1ad2 configure: Print a summary of compilation options
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-28 14:51:56 +01:00
Chris Wilson a12c352b56 intel: Remove some unused macros
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-28 14:49:07 +01:00
Chris Wilson e94f66c951 intel: Move some backend specific macros out of the common header
All the IS_GEN/IS_DEVICE are only used by the UXA backend, so move them
to its headers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-28 14:49:07 +01:00
Chris Wilson 04d5c33b96 uxa: Colocate architecture source files with backend implementation sources
i.e. move the toplevel uxa/*.[ch] into src/uxa/*.[ch]

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-28 14:49:07 +01:00
Chris Wilson 45d4e8dcf9 uxa: Clear up the common intel directory
Move all the UXA backend specifc files into their own subdirectory.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-28 14:49:07 +01:00