summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2017-02-08xwayland: Apply output rotation for screen sizeOlivier Fourdan1-12/+16
Previously, we would swap the width/height of the Xwayland output based on the output rotation, so that the overall screen size would match the actual rotation of each output. Problem is the RandR's ConstrainCursorHarder() handler will also apply the output rotation, meaning that when the output is rotated, the pointer will be constrained within the wrong dimension. Moreover, XRandR assumes the original output width/height are unchanged when the output is rotated, so by changing the Xwayland output width and height based on rotation, Xwayland causes XRandr to report the wrong output sizes (an output of size 1024x768 rotated left or right should remain 1024x768, not 768x1024). So to avoid this issue and keep things consistent between Wayland and Xwayland outputs, leave the actual width/height unchanged but apply the rotation when computing the screen size. This fixes both the output size being wrong in "xrandr -q" and the pointer being constrained in the wrong dimension with rotated with weston. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99663 Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-02-08xwayland: CRTC should support all rotationsOlivier Fourdan1-1/+8
If the Wayland compositor sets a rotation on the output, Xwayland translates the transformation as an xrandr rotation for the given output. However, if the rotation is not supported by the CRTC, this is not a valid setup and xrandr queries will fail. Pretend we support all rotations and reflections so that the configuration remains a valid xrandr setup. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99663 Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-02-08xwayland: Add hack for FWXGA resolution #99574Svitozar Cherepii1-0/+7
For some applications (like fullscreen games) it matters for XRandr resolution to be correctly set and equal to root window resolution. In XServer there is already hack for this, adapted it for XWayland. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=99574 Signed-off-by: Svitozar Cherepii <razotivs@gmail.com> Tested-by: Svitozar Cherepii <razotivs@gmail.com> Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2017-02-08modesetting: allow switching from software to hardware cursors (v5).Michael Thayer2-18/+13
Currently if modesetting ever fails to set a hardware cursor it will switch to using a software cursor and never go back. Change this to only permanently switch to a software cursor if -ENXIO is returned (which means hardware cursors not supported), and to otherwise still try a hardware cursor first every time a new one is set. This is needed because hardware may be able to handle some cursors in hardware and others not, or virtual hardware may be able to handle hardware cursors at some times and not others. Changes since v1, v2 and v3: * take into account the switch to load_cursor_argb_check * keep the permanent software cursor fall-back if -ENXIO is returned * move parts of v3 into separate patches Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Michael Thayer <michael.thayer@oracle.com>
2017-02-08modesetting: Immediately handle failure to set HW cursor, v5Michael Thayer2-11/+5
Based on v4 by Alexandre Courbot <acourbot@nvidia.com> There is currently no reliable way to report failure to set a HW cursor. Still such failures can happen if e.g. the MODE_CURSOR DRM ioctl fails (which currently happens at least with modesetting on Tegra for format incompatibility reasons). As failures are currently handled by setting the HW cursor size to (0,0), the fallback to SW cursor will not happen until the next time the cursor changes and xf86CursorSetCursor() is called again. In the meantime, the cursor will be invisible to the user. This patch addresses that by adding _xf86CrtcFuncs::set_cursor_check and _xf86CursorInfoRec::ShowCursorCheck hook variants that return booleans. This allows to propagate errors up to xf86CursorSetCursor(), which can then fall back to using the SW cursor immediately. v5: - Removed parts of patch already committed as part of 14c21ea1. - Adjusted code slightly to match surrounding code. - Effectively reverted af916477 which is made unnecessary by this patch. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Michael Thayer <michael.thayer@oracle.com>
2017-02-08xfree86: Immediately handle failure to set HW cursor, v5Michael Thayer4-15/+53
Based on v4 by Alexandre Courbot <acourbot@nvidia.com> There is currently no reliable way to report failure to set a HW cursor. Still such failures can happen if e.g. the MODE_CURSOR DRM ioctl fails (which currently happens at least with modesetting on Tegra for format incompatibility reasons). As failures are currently handled by setting the HW cursor size to (0,0), the fallback to SW cursor will not happen until the next time the cursor changes and xf86CursorSetCursor() is called again. In the meantime, the cursor will be invisible to the user. This patch addresses that by adding _xf86CrtcFuncs::set_cursor_check and _xf86CursorInfoRec::ShowCursorCheck hook variants that return booleans. This allows to propagate errors up to xf86CursorSetCursor(), which can then fall back to using the SW cursor immediately. v5: Updated the patch to apply to current git HEAD, split up into two patches (server and modesetting driver) and adjusted the code slightly to match surrounding code. I also removed the new exported function ShowCursorCheck(), as instead just changing ShowCursor() to return Bool should not affect its current callers. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Michael Thayer <michael.thayer@oracle.com>
2017-02-08dmx: fix linkingMihail Konev1-1/+2
Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-02-08dri1: Remove some dead event codeAdam Jackson1-7/+0
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2017-02-08xwayland: replace hardcoded function name with __func__ in error msgPeter Hutterer2-4/+4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2017-02-06xfree86: Take input_lock() for xf86ScreenCheckHWCursorChris Wilson1-7/+20
2017-02-06xfree86: Take input lock for xf86TransparentCursorChris Wilson1-0/+4
2017-02-06xfree86: Take the input lock for xf86RecolorCursorChris Wilson1-6/+18
xf86RecolorCursor() may be called directly from XRecolorCursor as well as from xf86ScreenSetCursor(). In the latter case, the input lock is already held, but not for the former and so we need to add a wrapper function that acquires the input lock before performing xf86RecolorCursor() References: https://bugs.freedesktop.org/show_bug.cgi?id=99358
2017-02-01loader: Handle mod->VersionInfo == NULLMichel Dänzer1-10/+11
This can happen when a module fails to load: Program received signal SIGSEGV, Segmentation fault. UnloadModule (_mod=0x5555559d9280) at ../../../../hw/xfree86/loader/loadmod.c:848 848 name = mod->VersionInfo->modname; (gdb) bt #0 UnloadModule (_mod=0x5555559d9280) at ../../../../hw/xfree86/loader/loadmod.c:848 #1 0x00005555555ddd1b in LoadModule (module=module@entry=0x5555559c7ce0 "fbdev", options=0x0, modreq=modreq@entry=0x0, errmaj=errmaj@entry=0x7fffffffe8ec) at ../../../../hw/xfree86/loader/loadmod.c:824 #2 0x00005555555edfe9 in xf86LoadModules (list=list@entry=0x5555559dcf50, optlist=optlist@entry=0x0) at ../../../../hw/xfree86/common/xf86Init.c:1506 #3 0x00005555555ee7bc in InitOutput (pScreenInfo=pScreenInfo@entry=0x5555559abf80 <screenInfo>, argc=argc@entry=4, argv=argv@entry=0x7fffffffeb18) at ../../../../hw/xfree86/common/xf86Init.c:484 #4 0x00005555555a885c in dix_main (argc=4, argv=0x7fffffffeb18, envp=<optimized out>) at ../../dix/main.c:197 #5 0x00007ffff5d582b1 in __libc_start_main (main=0x555555593130 <main>, argc=4, argv=0x7fffffffeb18, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffeb08) at ../csu/libc-start.c:291 #6 0x000055555559316a in _start () Fixes: 8e83eacb9e2d ("loader: Remove unused path and name from ModuleDescPtr") Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-25dri2: refine dri2_probe_driver_name (v2)Qiang Yu1-19/+24
V2: 1. update comment 2. check bustype if PCI 3. configure add libdrm version check for drmGetDevice Get PCI information from info->fd with drmGetDevice instead of assuming the info->fd is the first entity of scrn which is not true for multi entities scrn. Signed-off-by: Qiang Yu <Qiang.Yu@amd.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-01-25loader: Learn about the joy of snprintfAdam Jackson1-9/+2
Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-01-25loader: Remove unused path and name from ModuleDescPtrAdam Jackson2-24/+9
Just a waste of memory. Path was never referenced at all, and name was only used when unloading the module; we can just as well get the module's internal idea of its name from VersionInfo. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-01-25loader: Remove unused arguments from LoadModuleAdam Jackson7-199/+21
Nobody was ever calling this with a non-null argument for subdir list or pattern list. Having done this, InitSubdirs is only ever called with a NULL argument, so it's really just a complicated way of duplicating the default list; we can remove that and just walk the list directly. The minor error code was only ever used to distinguish among two cases of LDR_BADUSAGE. Whatever. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-01-25loader: Turn LoaderListDirs into LoaderListDirAdam Jackson5-144/+110
Callers only ever use this for a single directory anyway. While we're at it, also move xf86DriverListFromCompile near its only user in the X -configure code (and inline it out of existence), and remove LoaderFreeDirList as it's unused (since X -configure is just going to exit anyway, none of that code cares about cleanup). Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-01-25loader: Move loader list details to internal headerAdam Jackson4-3/+5
There's no reason a driver should ever care about this. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-01-25xfree86: Remove a stray reference to font modulesAdam Jackson1-2/+1
Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-01-25xfree86: Fix up some bad indentationAdam Jackson1-14/+14
indent(1) gets confused by function-like macros with no trailing semicolon, which is fair enough really. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-01-25xfree86: Remove DriverRec1 compat structAdam Jackson2-18/+1
The idea here is that the driver might have once been old enough to not have the driverFunc slot in DriverRec, with the module ABI not having changed when it was added. That was ages ago, and drivers always declare themselves with DriverRec not DriverRec1, so uninitialized slots will simply be zero. Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-01-25loader: Remove silly "unspecified" version handlingAdam Jackson3-44/+29
Everybody using this functionality specifies a major version, which makes sense. If you don't care about a minor version, that's equivalent to saying you require minor >= 0, so just say so; likewise patch level. Likewise ABI class is always specified. Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-01-25loader: Remove unused loader error codes and dead enumAdam Jackson2-32/+1
The enum has been unused since at least the removal of elfloader. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-01-25loader: Include fewer headers from xf86Module.hAdam Jackson1-2/+4
This looks like more, but only if you don't compare it to the number pulled in by misc.h. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-01-25loader: Don't add internal/ to the search pathAdam Jackson1-1/+0
Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-01-25loader: Remove *GetOSAdam Jackson6-95/+2
This API is dumb. uname(3) exists, feel free to use it, but ideally write to the interface not to the OS. There are a couple of drivers using this API, they could all reasonably just not. This also removes the OS name from the loader subdirectory path search. Having /usr/lib/xorg shared across OSes is a non-goal here. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-01-25loader: Port from xfree86 to dix APIAdam Jackson2-103/+81
Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-01-25xfree86: flatten pathlist management in the loaderEmil Velikov1-14/+2
Now that users can set the path only via LoaderSetPath(), we can simplify things. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-01-25xfree86: remove dummy/dead function prototype for LoadDriverEmil Velikov1-2/+0
Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-01-25xfree86: remove references to LoadSubModule's path from the docEmil Velikov1-5/+1
Afaics the argument hasn't been part of the API since the documentation has been converted to xml with commit fc6ebe1e1d3 "Convert LinuxDoc documents to DocBook/XML" Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-01-25xfree86: remove unused path from the LoadModule APIEmil Velikov5-14/+7
Similar to its little brother - LoadSubModule. Currently all call sites provide NULL anyway ;-) Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-01-19kdrive: Remove non-evdev input driversAdam Jackson6-1699/+0
Use evdev. Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-01-19dmx: Remove non-evdev hardware input driversAdam Jackson9-2074/+3
Use evdev. Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-01-12tests: Avoid libtool messageMihail Konev3-2/+5
The "copying selected object files" message appears as some source files have the same name, and some objects are included twice. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-11modesetting: cleanup pci device openQiang Yu2-19/+11
Signed-off-by: Qiang Yu <Qiang.Yu@amd.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-11xfree86: fix wrong usage of xf86optionListMergeQiang Yu1-1/+1
Signed-off-by: Qiang Yu <Qiang.Yu@amd.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-02edid: Add quirk for ADA 1024x600 7" display.Kai-Heng Feng1-0/+5
Detailed mode reports 108 mm x 68 mm which is for smaller display. Maximum image size reports 15 cm x 10 cm which aligns with its physical size, use this size instead. Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Acked-by: Alex Deucher <alexander.deucher@amd.com>
2016-12-14xfree86: Add ModulePath support for OutputClass config SectionsHans De Goede5-0/+56
Allow OutputClass config snippets to modify the module-path. Note that any specified ModulePaths will be pre-pended to the normal ModulePath. The idea behind this is that any output hardware specific modules should have preference over the normal modules. One use-case for this is the nvidia binary driver, this allows a config snippet like this: Section "OutputClass" MatchDriver "nvidia" Modulepath "/usr/lib64/nvidia/modules" EndSection To get the nvidia glx specific glx module loaded, but only when the nvidia kernel driver is loaded. Together with the glvnd work done recently, this allows the nouveau + mesa and nvidia-binary userspace stacks to co-exist on the same system without any ldconfig / xorg.conf tweaking and the xserver will automatically do the right thing depending on which kernel driver (nouveau or nvidia) is loaded. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-12-14xfree86: Allow overriding primary GPU detection from an OutputClass sectionHans De Goede2-1/+30
Allow using: Option "PrimaryGPU" "yes" In an OutputClass section to override the default primary GPU device selection which selects the GPU used as output by the firmware. If multiple output devices match an OutputClass section with the PrimaryGPU option set, the first one enumerated becomes the primary GPU. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-12-14xfree86: xf86platformProbe: split finding pci-info and setting primary GPUHans De Goede1-8/+15
This is a preparation patch for allowing an OutputClass section to override the default primary GPU device selection. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-12-14xfree86: Add options support for OutputClass OptionsHans De Goede6-1/+65
Add support for setting options in OutputClass Sections and having these applied to any matching output devices. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-12-14xfree86: Make OutputClassMatches take a xf86_platform_deviceHans De Goede1-3/+4
Make OutputClassMatches directly take a xf86_platform_device as argument, rather then an index into xf86_platform_devices. This makes things easier for callers which already have a xf86_platform_device pointer. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-12-14xfree86: Free devlist returned by xf86MatchDeviceHans De Goede1-0/+4
xf86MatchDevice returns a dynamically allocated list of GDevPtr-s, free this when we're done with it. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-12-12shadow: Macro cleanupAdam Jackson2-2/+2
shadowDamage is just obfuscation. The other two macros won't work outside shadow.c since the private key is in fact static there (meaning the extern decl is a lie). Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2016-12-12shadow: Lift 32->24 conversion from modesetting to dixAdam Jackson4-153/+3
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2016-12-12shadowfb: Rename this particular shadow.c to shadowfb.cAdam Jackson2-1/+1
So as not to conflict with the one in miext/shadow. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2016-12-12dix: Rename (and retype) PixmapPerDepth[1] to defaultStippleAdam Jackson2-6/+6
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2016-12-07Fix a segfault that occurs if xorg.conf.d is absent:Ben Crocker3-1/+25
In InitOutput, if xf86HandleConfigFile returns CONFIG_NOFILE (which it does if no config file or directory is present), the autoconfig flag is set, causing xf86AutoConfig to be called later on. xf86AutoConfig calls xf86OutputClassDriverList via the call tree: xf86AutoConfig => listPossibleVideoDrivers => xf86PlatformMatchDriver => xf86OutputClassDriverList and xf86OutputClassDriverList attempts to traverse a linked list that is a member of the XF86ConfigRec struct pointed to by the global xf86configptr, which is NULL at this point because the XF86ConfigRec struct is only allocated (by xf86readConfigFile) AFTER the config file and directory have been successfully opened; the CONFIG_NOFILE return from xf86HandleConfigFile occurs BEFORE the call to xf86readConfigFile which allocates the XF86ConfigRec struct. Rx: In read.c (for symmetry with xf86freeConfig, which already appears in this file), add a new function xf86allocateConfig which tests the value of xf86configptr and, if it's NULL, allocates the XF86ConfigRec struct and deposits the pointer in xf86configptr. In xf86Parser.h, add a prototype for the new xf86allocateConfig function. Back in read.c, #include "xf86Config.h". In xf86readConfigFile, change the open-code call to calloc to a call to the new xf86allocateConfig function. In xf86AutoConfig.c, add a call to the new xf86allocateConfig function to the beginning of xf86AutoConfig to make sure the XF86ConfigRec struct is allocated. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Ben Crocker <bcrocker@redhat.com>
2016-12-05xfree86: Try harder to find atleast 1 non GPU ScreenHans de Goede5-3/+33
If we did not find any non GPU Screens, try again ignoring the notion of any video devices being the primary device. This fixes Xorg exiting with a "no screens found" error when using virtio-vga in a virtual-machine and when using a device driven by simpledrm. This is a somewhat ugly solution, but it is the best I can come up with without major surgery to the bus and probe code. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>