On gen2 (like gen3), 8-bit destination surfaces are read into the Green
channel (and written to from the Green channel). Therefore the expected
alpha blending must instead be converted to colour blending.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75818
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
So that the lockless reads do not see the task complete signal prior to
marking the task as successful. Otherwise, we falsely detect that the
thread trapped a signal and kill them all.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The goal here is to predict when we are uploading an entire image though
multiple PutImage requests. If the image is small enough, then the
PutImage will be contained within a single request and the damage
tracking will be accurate.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Fixes regression from
commit 1de1104064
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri Feb 21 22:43:04 2014 +0000
sna: Use a hint to do whole image uploads inplace
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75549
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
One of the failure modes for execbuf is running out of memory - often
this is reported as a false ENOSPC (thanks shmemfs!). Because of this,
we should try to resubmit after we purge our caches.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
To handle sigtrapping of the threads, we allow the threads to handle
their async signals and upon hitting the trap, we kill the thread. All
the rest of the threads are reaped by the main xserver thread
afterwards.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Along one of the sw blt paths we failed to apply the offset for
Composite redirection.
Reported-by: Jiri Slaby <jirislaby@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73811
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
By killing the threads and leaking their allocations - marginally
preferrable to losing the entire Xserver.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
For the moment, this still leaves open the vexing question of how to
protect the multi-threaded variants, but it should provide more shelter
for extreme OOM.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The fallback xf86InitialConfiguration() is another function that may
explode if called without any CRTCs attached.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The xserver may crash if we try to setup colormap handling without any
CRTCs, so don't.
Suggested-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris would like to humbly apologise for making these changes to the
OpenBSD code blind, and to thank Mark and Jonathan for their support
and understanding.
X always sends MappingNotify events (there is no way for the client
to ignore them). In particular, MappingNotify would be sent after a VT
switch, and this would knock out our ability to track the cursor..
Reported-by: Raul Dias <raul@dias.com.br>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75115
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Since the helper is a standalone app, the usual xserver rules of not using
stdio because of signal handling don't apply.
And since the helper does run with elevated rights, it is important to keep
the code KISS so that it can be audited easily.
This commit replaces the hard to read "raw" read loop with a much simpler
loop using fgets, improving readability of the code.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Event though we've failed to open the backlight normally, we may still be
running under a suid-root xserver, so drop any elevated rights before
executing what we hope will be pkxec.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Even though we've failed to open the backlight normally, we may still be
running under a suid-root xserver, so use the servers build in System instead
of system so as to properly drop root rights.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Update the comment about trying suid-root first with some explanations of
why pkexec may be preferable in some cases.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
We only handle the singular wscons OpenBSD interface for backlight, so
explicitly reject any user requests for something else.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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>
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>
O_NONBLOCK is a status flag not a descriptor flag, so F_GETFL / F_SETFL should
be used to modify it.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
It is not just the BSDs that lack these ioctls in their userspace
headers, but everything older than about a year...
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
These are not currently exported on OpenBSD and cause the build to fail.
Hide their use behind an ifdef guard for the time being.
"I noticed the following when trying to compile xf86-video-intel git on OpenBSD:
/usr/users/jsg/src/xf86-video-intel/src/sna/sna_display.c:2106: error: 'DRM_MODE_OBJECT_CRTC' undeclared (first use in this function)
/usr/users/jsg/src/xf86-video-intel/src/sna/sna_display.c:2106: error: (Each undeclared identifier is reported only once
/usr/users/jsg/src/xf86-video-intel/src/sna/sna_display.c:2106: error: for each function it appears in.)
/usr/users/jsg/src/xf86-video-intel/src/sna/sna_display.c:2107: error: 'DRM_MODE_OBJECT_PLANE' undeclared (first use in this function)"
Reported-by: Jonathan Gray
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Before we write values into the file, we want to be sure that it is our
sysfs backlight interface, and not some ordinary file we are about to
destroy.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Attempting to create a 0x0 frontbuffer results in erroneous pixmap
generation, and is liable to explode at a random point in future, so
just reject it outright.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
After altering the command bits to accommodate Broadwell, we needed to
fixup the comparison of previous BLT commands to detect overwritten
commands.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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>