Commit Graph

256 Commits

Author SHA1 Message Date
Eric Anholt
6d41bdb23c modesetting: Deduplicate some scrn setup.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-10-09 09:48:48 +02:00
Eric Anholt
20a3b48219 modesetting: Fix some weird formatting after x-indent-all.sh.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-10-09 09:48:45 +02:00
Eric Anholt
3119acdab9 modesetting: Run x-indent-all.sh.
As I was editing code, the top-level .dir-locals.el was making my new
stuff conflict with the existing style.  Make it consistently use the
xorg style, instead.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-10-09 09:48:42 +02:00
Eric Anholt
b84d25fd53 modesetting: Drop remaining old-xserver compatibility.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-09-16 16:28:50 -07:00
Eric Anholt
7b0965a826 modesetting: Drop use of compat-api.h
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-09-16 16:28:50 -07:00
Eric Anholt
2feda3b6b5 modesetting: Connect the driver to the build.
v2: Fix libdrm version check, and use XORG_VERSION_* instead of a
    static 1.0.0 version for the driver module.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-09-16 16:28:42 -07:00
Eric Anholt
6d6aa8ab6b modesetting: Update for the platform device API change.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-09-15 12:47:19 -07:00
Eric Anholt
9c080f4496 modesetting: Drop use of "pointer" for "void *"
The xserver doesn't have that typedef.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-09-15 12:47:12 -07:00
Eric Anholt
a10ea01475 modesetting: xserver already checks XEXTPROTO >= 7.2.99.901.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-09-15 12:47:06 -07:00
Eric Anholt
c7e8d4a6ee modesetting: unifdef MODESETTING_OUTPUT_SLAVE_SUPPORT
The server will always have it.

v2: Clean up some weird formatting from the unifdeffing.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-09-15 12:46:43 -07:00
Eric Anholt
0c07bfb38e modesetting: Merge modesetting's COPYING into the xserver's.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-09-15 12:46:02 -07:00
Adam Jackson
042bae0b49 Use own thunk function instead of shadowUpdatePackedWeak
I plan to remove the Weak functions from a future server.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-05-21 10:17:02 -04:00
Dave Airlie
219ce9e6c3 modesetting: fix build regression against older servers.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-05-02 13:16:05 +10:00
Dave Airlie
795af9ff01 modesetting: fix use after free.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-05-02 13:14:30 +10:00
Hans de Goede
f073b5e582 Add support for server managed fds
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-04-28 13:08:55 +02:00
Dave Airlie
98f59a33df modesetting: fix cursor rendering with hotspots.
older kernels report EINVAL not ENOSYS, doh.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-28 12:04:30 +10:00
Adam Jackson
2029c028fc modesetting: Don't (brokenly) double-track software cursor
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-02-25 13:37:20 -05:00
Dave Airlie
fac2bcf1da modesetting: try and use hotspot cursor support
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-21 12:54:37 +10:00
Dave Airlie
4aab7aa7c1 modesetting: move closing fd to after we check outputs
On something like cirrus, start X, then attempt to start a second
X while the first is running, if fbdev is installed it'll fail
hard.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-21 12:49:23 +10:00
Alex Deucher
02fbae85e7 modesetting: query cursor size from the kernel
Use new drm caps.  This allows hw cursors to work
correctly on gpus with non-64x64 cursors.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-12 13:16:53 -05:00
Thierry Reding
59e324abd7 Properly identify DSI outputs
Newer Linux kernels support DSI outputs. To be able to identify them
properly, add DSI to the list of output names.

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-12-03 16:59:21 +01:00
Thierry Reding
190289f639 Staticise and constify output names
This array isn't used anywhere outside this file, so it can be made
static. While at it, make the array const as well.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2013-12-03 16:58:57 +01:00
Keith Packard
a307ac2738 Handle new DamageUnregister API which has only one argument
API change in 1.15

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-15 13:39:52 +09:00
Keith Packard
d6ffce4b0e Clean up compiler warnings.
Add const to any immutable string pointers.
Rename 'range' to 'prop_range' to avoid redefined warning.
Eliminate some unused return values.

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-15 13:38:49 +09:00
Dave Airlie
836daf4c7a modesetting: change output names for secondary GPUs
if we are a secondary GPU modify the output name to avoid clashes.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-07-31 11:24:48 +10:00
Maarten Lankhorst
525ac7fb9a modesetting: probe only succeeds if connectors are detected
This will prevent modesetting being used for outputless intel or nvidia cards.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-06-12 14:07:36 +02:00
Dave Airlie
d4791dd97b modesetting: fix adjust frame crash
When SDL called this it was totally broken, actually hook
up to the underlying drmmode function.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64808

Thanks to Peter Wu <lekensteyn@gmail.com> for harassing me.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-06-11 10:29:25 +10:00
Maarten Lankhorst
c64fa9a296 support 32 bpp pixmaps when 24 bpp fb is used.
Fixes background corruption in ubuntu.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-04-03 12:09:30 +02:00
Maarten Lankhorst
862bc28368 modesetting: return null for get_modes if output could not be retrieved
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-03-26 15:19:52 +01:00
Maarten Lankhorst
6b79a8791d modesetting: clean up leaks
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-03-26 15:19:44 +01:00
Aaron Plattner
1754973206 modesetting: match PCI class 3, any subclass
If a device is not primary, the PCI device match fails because the
xf86-video-modesetting driver looks specifically for a PCI class match of
0x30000 with a mask of 0xffffff.  This fails to match, for example, a
non-primary Intel VGA device, because it is reported as having a class of
0x38000.

Fix that by ignoring the low 16 bits of the class in the pci_id_match table.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed on IRC by Adam Jackson <ajax@redhat.com>
2013-03-21 11:10:35 -07:00
Chris Wilson
75815dbb37 Add missing GTF modes
A fixed-mode output device like a panel will often only inform of its
preferred mode through its EDID. However, the driver will adjust user
specified modes for display through use of a panel-fitter allowing
greater flexibility in upscaling. This is often used by games to set a
low resolution for performance and use the panel fitter to fill the
screen.

v2: Use the presence of the 'scaling mode' connector property as an
indication that a panel fitter is attached to that pipe.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55564
2013-02-25 12:12:53 +00:00
Dave Airlie
ac34281b8a modesetting: provide dummy hooks for shadow
Since in some wierd cases the server can call these without checking they
exist.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-02-07 12:24:20 +10:00
Dave Airlie
8650ff14a5 modesetting: fix crashes caused by udev race conditions
So the kernel removes the device, and the driver processes the first
udev event, and gets no output back from the kernel, so it check
and don't fall over.

This fixes a couple of crashes seen when hotplugging USB devices.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-09 12:48:30 +10:00
Thierry Reding
0b198248ec Remove call to miInitializeBackingStore()
Recent versions of the X server no longer provide this function, which
has been obsolete for over 2 years now.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-29 11:55:54 +10:00
Dave Airlie
e47ad8a0ae modesetting: remove alloca usage again
this slipped back in.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-17 11:48:14 +10:00
Alon Levy
f8eb8c1cb4 modesetting: add virtual connector support
[airlied: also make sure we don't crash in future.]

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-14 10:40:44 +10:00
Adam Jackson
e3d7d5d18e Implement ->driverFunc
Copied from fbdev, makes it so we can run without iopl.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-08-16 10:46:29 +10:00
Dave Airlie
02811f1a9c modesetting: add output slave support.
This allows the driver to operate as an output slave.

It adds scan out pixmap, and the capability
checks to make sure they available.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-25 16:01:42 +10:00
Dave Airlie
fa171c5a81 modesetting: add platform bus support 2012-07-25 16:01:41 +10:00
Dave Airlie
709dbc68cd modesetting: fix warning about close being undefined.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-25 16:01:41 +10:00
Dave Airlie
71b86ea8dd modesetting: drop useless xf86PciInfo include
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-25 16:01:41 +10:00
Dave Airlie
30ab80ef54 modesetting: pci probing requires interface version 1.4
Set the drm interface version to 1.4 so we get the bus id correctly.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-22 15:26:28 +01:00
Dave Airlie
ec79187d9a modesetting: workaround kernel bug reporting 0x0 as valid mins
It reports these but then you can't create a 0 sized bo.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:41:18 +01:00
Dave Airlie
e07c945ab9 modesetting: bump to latest X server compat api.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-01 12:34:42 +01:00
Dave Airlie
1c01090f64 modesetting: fix make distcheck
add missing compat header file.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-23 11:31:39 +01:00
Dave Airlie
ef47a1b3bf modesetting: convert to new scrn conversion APIs.
Generated with util/modular/x-driver-screen-scrn-conv.sh

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-23 11:21:55 +01:00
Dave Airlie
3e46d578d8 modesetting: add compat header file
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-23 11:21:39 +01:00
Dave Airlie
7dc22b7911 modesetting: make sure the pci device corresponds to the drm device
If we get asked to pci open a device with a kms path override,
make sure they match, otherwise this driver can steal the primary
device binding for a usb adaptor.

The driver should fallback to the old probe entry point in this case.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-09 09:32:05 +01:00
Dave Airlie
d063f64b5c modesetting: attempt to work out if we want 24 or 32bpp
the cirrus driver presents certain challenges, and this is a
workaround, until we can possibly agree some sane interface
for exposing this information.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-01 17:12:29 +01:00
Dave Airlie
610f532e6a modesetting: move opening kernel device to before setting depth
due to interaction between option handling and set depth, we need
to what fbdev does to get the device path early.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-01 16:52:18 +01:00
Dave Airlie
00c663a3bc modesetting: add set/drop master around VT switch 2012-04-17 11:50:40 +01:00
Dave Airlie
001dec8980 cursor: hide cursors on LeaveVT 2012-04-17 11:48:03 +01:00
Dave Airlie
d5d5b40743 dirty: check malloc return
Suggested by keithp.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-14 19:21:47 +01:00
Dave Airlie
6c1b5cb903 drop use of alloca, just use malloc/free
Reported-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-14 15:01:33 +01:00
Sascha Hauer
53204d5c8b make busID non mandatory
Currently the driver only probes a device when it has a
busID. The busID is optional so don't depend on it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-05 15:19:26 +00:00
Sascha Hauer
bb7e39c1f2 do not bail out on non pci devices
To make the driver work on nin PCI devices we shouldn't bail
out in this case.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-05 15:19:22 +00:00
Sascha Hauer
2b6848fcb3 Fix non PCI device probing
When no devicename is found in the option then the driver probes
by PciInfo no matter if it's valid or not. Instead of doing this
use PciInfo only when it's valid and fall back to the devicename
otherwise. With devicename probing use open_hw() to fall back
on the KMSDEVICE environment variable or to the default device.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-05 15:19:09 +00:00
Sascha Hauer
456a001e3f introduce open_hw() function
probe_hw opens the hardware in the order we want it:
first try devname, if this is NULL then try the KMSDEVICE
environment variable and as a last fallback use "/dev/dri/card0".
Instead of implementing the same code again when really opening
the device move the code to a open_hw() function and let probe_hw
use it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-05 15:18:36 +00:00
Sascha Hauer
aa6ceaaa84 fix if() brackets in Probe function
in Probe() the indention shows what's meant but there are no
brackets. Add them.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-05 15:18:28 +00:00
Dave Airlie
e5648616d2 modesetting: fix warnings, remove dead code.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-22 09:59:12 +00:00
Gaetan Nadon
d56293cae7 make: add all warnings according to the platform
The current code only adds -Wall and only for gcc.
Automake reserves the use of CPPFLAGS for the user to override
on the command line.
This also breaks the option --enable-strict-compilation

The variable CWARNFLAGS contains the complete set of warnings
and is platform sensitive.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-22 09:57:04 +00:00
Gaetan Nadon
fa201fe829 make: remove empty variable assignment
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-22 09:56:44 +00:00
Gaetan Nadon
dd1d7e3519 Fill the COPYING file with license text
This reflects the copyright license text in the source code

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-21 16:14:31 +00:00
Dave Airlie
b0e12e250d modesetting: disable dirty updates for ENOSYS
the kernel can also return ENOSYS for this to say its not used.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-20 11:08:40 +00:00
Dave Airlie
c5529d68c5 modesetting: fix shadow resizing.
if we hotplugged and output, the shadow got disabled by accident.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-20 11:05:59 +00:00
Dave Airlie
f3b9e52b29 modesetting: move shadow stuff to other structure
we need this for resize to work properly.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-20 11:00:56 +00:00
Dave Airlie
eb44a004b7 modesetting: fix stride if kernel modifies it.
If the kernel aligns things use its values instead.

fixes output on nouveau here.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-20 10:55:48 +00:00
Dave Airlie
2150cbda8c shadowfb: dump shadowfb state at startup 2012-02-20 10:54:21 +00:00
Dave Airlie
86080a5f7a use a cap to decide if shadow is preferred or not. 2012-02-17 15:54:14 +00:00
Dave Airlie
fc5f39acd4 cleanup dumb cap fetch 2012-02-17 15:54:14 +00:00
Dave Airlie
d94b3eaba9 modesetting: add cursor fallback if kernel rejects cursor.
If the kernel rejects a cursor, cause a fallback, this isn't 100% as
we can lose the initial cursor, but it works fine once wm starts.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-17 15:55:38 +00:00
Dave Airlie
594b3c4d6f fix some whitespace 2012-02-16 19:31:33 +00:00
Dave Airlie
2e297978c9 fixup device open
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-16 18:41:22 +00:00
James Simmons
f47f6b6a53 don't map cursors in sw cursor mode 2011-11-03 13:20:18 +00:00
Dave Airlie
6f581e3fde fix fb_id for dirty reporting 2011-10-03 16:09:12 +01:00
Dave Airlie
79959b7347 fix make distcheck 2011-10-03 11:35:39 +01:00
Dave Airlie
cb65ec6b58 check drm support dumb buffer capability 2011-09-29 16:06:52 +01:00
Dave Airlie
6ccd13a2d7 add initial man page 2011-09-29 16:00:50 +01:00
Dave Airlie
1f37991dec add shadowfb support, default to on.
we should probably expose a bit from kernel to say if shadow is preferred
or wasteful.
2011-09-29 15:56:15 +01:00
Dave Airlie
0b5e574dff remove unused debug 2011-09-29 15:55:24 +01:00
Dave Airlie
d686130c17 add -Wall, cleanup warnings 2011-09-29 14:13:58 +01:00
Dave Airlie
a4f6e661b5 fix server recycling 2011-09-29 14:05:43 +01:00
Dave Airlie
7847321138 port damage tracking code from st/xorg 2011-09-29 13:32:38 +01:00
Dave Airlie
4d3aadb22f drop loading dri2 2011-09-29 12:34:27 +01:00
Dave Airlie
1b1382c9e1 update authors/copyright 2011-09-29 12:34:17 +01:00
Dave Airlie
263597dbb3 gut some more unneeded code 2011-09-29 12:30:46 +01:00
Dave Airlie
a72bdf170c modesetting: rewrite probing based on fbdev.
This isn't perfect, it should really do more with bus id matching
and finding the write drm device using sysfs if it can. but it removes
lots of hardcoding of pci ids.
2011-09-29 12:28:59 +01:00
Dave Airlie
a77fae8505 cleanup some the drmmode_display header file 2011-09-29 11:52:51 +01:00
Dave Airlie
2a46189054 modesetting: restart driver effort from other codebases
This starts a randr 1.2 compatible driver with cursors.

TODO:
libkms
dirty handling
server recycling.
2011-09-29 11:49:26 +01:00
Dave Airlie
e2f8315dae drop exa
don't provide accel in this framework
2011-03-10 09:15:55 +10:00
Thomas Hellstrom
9c4c323d50 Avoid an EXA init segfault.
Don't allocate each VRAM buffer with a 16MB alignment.
2008-06-30 18:59:13 +01:00
Alan Hourihane
a65888d678 fixes for gallium stride changes 2008-06-27 17:32:28 +01:00
Alan Hourihane
e0c43fff32 More error checking 2008-06-27 09:46:24 +01:00
Alan Hourihane
387ec961f2 add --with-gallium-dir to specify location of gallium tree 2008-06-26 23:34:51 +01:00
Alan Hourihane
410b0a4254 NULL checks 2008-06-26 22:49:33 +01:00
Alan Hourihane
621fa337fb Fix copy surface 2008-06-26 22:47:20 +01:00
Alan Hourihane
ccd0c76472 Add EXA winsys for gallium pipe driver interface.
Plug in the EXA framework into the pipe driver
for surface_copy & surface_fill.

Back pixmaps with drmBO's including the front buffer.
2008-06-26 22:27:44 +01:00
Alan Hourihane
0e1aa03708 yet more 2008-06-26 22:27:14 +01:00
Alan Hourihane
2b3a3bc920 more formatting fixes 2008-06-26 22:26:16 +01:00
Alan Hourihane
2a45c28712 formatting fixes 2008-06-26 22:25:17 +01:00
Alan Hourihane
47969d7928 Add DRI2 support.
Add EXA stubs.

Currently tested with i915.
2008-06-16 15:08:30 +01:00
Alan Hourihane
cba8b25a7e Bring inline with current modesetting-101 branch for connector/encoder changes 2008-06-02 11:17:47 +01:00
Alan Hourihane
000ead4503 Plug in hardware cursor support 2008-05-28 19:59:38 +01:00
Alan Hourihane
f9f7a872bf Run indent 2008-05-28 15:55:36 +01:00
Alan Hourihane
106bea5ad1 Initial commit of new modesetting driver 2008-05-28 13:33:07 +01:00