Commit Graph

6993 Commits

Author SHA1 Message Date
Alan Coopersmith
2a6d253b3f Remove apSolaris.shar (old "aperture" kernel driver for Solaris)
Modern Solaris releases provide this functionality in the OS via the
xsvc driver.   Since the move to libpciaccess, nothing in Xorg uses
this aperture driver any more.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-04-21 16:57:07 -07:00
Ray Strode
b1029716e4 systemd-logind: don't second guess D-Bus default timeout
At the moment, the X server uses a non-default timeout for D-Bus
messages to systemd-logind. The only timeouts normally used with
D-Bus are:

1) Infinite
2) Default

Anything else is just as arbitrary as Default, and so rarely makes
sense to use instead of Default.

Put another way, there's little reason to be fault tolerant against
a local root running daemon (logind), that in some configurations, the
X server already depends on for proper functionality.

This commit changes systemd-logind to just use the default timeouts.

Downstream-bug: https://bugzilla.redhat.com/show_bug.cgi?id=1209347
Signed-off-by: Ray Strode <rstrode@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-04-17 10:57:48 -07:00
Ray Strode
792e925167 systemd-logind: filter out non-signal messages from message filter
It's possible to receive a message reply in the message filter if a
previous message call timed out locally before the reply arrived.

The message_filter function only handles signals, at the moment, and
does not properly handle message replies.

This commit changes the message_filter function to filter out all
non-signal messages, including spurious message replies.

Downstream-bug: https://bugzilla.redhat.com/show_bug.cgi?id=1209347
Signed-off-by: Ray Strode <rstrode@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-04-17 10:57:31 -07:00
Hans de Goede
21e7d2bb5c Re-enable non serverfd input devices immediately on vtenter
Non serverfd input devices will never get a systemd-logind dbus resume signal,
causing them to never get re-enabled.

This commit changes xf86VTEnter() to enable them immediately, fixing this.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=89756
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-04-13 10:22:24 -07:00
Aaron Plattner
e36236eade xfree86: Add GPU screens even if there are no active GDevs
xf86platformProbeDev creates GPU screens for any platform devices that were not
matched by a GDev in the loop above, but only if there was at least one device.
This means that it's impossible to configure a device as a GPU screen if there
is only one platform device that matches that driver.

Instead, create a GPU screen (if possible) for any platform device that was not
claimed by the GDev loop.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-31 14:36:11 -07:00
Aaron Plattner
4ecda36259 xfree86: Fix xf86_check_platform_slot's handling of PCI
If a PCI entity is found, xf86_check_platform_slot performs a device ID check
against the xf86_platform_device passed in.  However, it just returns
immediately without checking the rest of the entities first.  This leads to this
situation happening:

1. The nvidia driver creates an entity 0 with bus.type == BUS_PCI
2. The intel driver creates entity 1 for its platform device, opening
   /dev/dri/card0
3. xf86platformProbeDev calls probeSingleDevice on the Intel platform device,
   which calls doPlatformProbe, which calls xf86_check_platform_slot.
4. xf86_check_platform_slot compares the Intel platform device against the
   NVIDIA PCI entity.  Since they don't have the same device ID, it returns
   TRUE.
5. doPlatformProbe calls xf86ClaimPlatformSlot, which creates a duplicate entity
   for the Intel one.

Fix this by only returning FALSE if the PCI ID matches, and continuing the loop
otherwise.  In the scenario above, this allows it to continue on to find the
Intel platform device that matches the second entity.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-31 14:36:00 -07:00
Keith Packard
e608f3521e Merge remote-tracking branch 'airlied/for-keithp' 2015-03-31 09:06:08 -07:00
Jon Turney
d3b9c47c84 Fix XQuartz build
Fix XQuartz build since commit e036cbfc "Make PseudoramiXExtensionInit()
prototype more generally available"

Add #include "nonsdk_extinit.h" to xprScreen.c

Add #include "nonsdk_extinit.h" to miinitext.c under INXQUARTZ to provide
declarations used under INXQUARTZ

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-03-31 09:02:28 -07:00
Dave Airlie
9c2b4f8e0e xf86Crtc: add tile prop setting
Add support for drivers to set the tiling
property. This is used by clients to
work out the monitor tiles for DisplayID
monitors.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-03-31 12:31:51 +10:00
Keith Packard
7088816fee Merge remote-tracking branch 'anholt/glamor-next' 2015-03-27 06:45:56 -07:00
Jon TURNEY
82634d2b69 ephyr: Avoid a segfault with 'DISPLAY= Xephyr -glamor'
ephyr_glamor_connect() returns NULL if we failed, but applying
xcb_connection_has_error() to NULL is not permitted.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Martin <consume.noise@gmail.com>
2015-03-24 12:43:34 -07:00
Eric Anholt
6ba6cc57e1 glamor: Just set the logic op to what we want at the start of all rendering.
By dropping the unconditional logic op disable at the end of
rendering, this fixes GL errors being thrown in GLES2 contexts (which
don't have logic ops).  On desktop, this also means a little less
overhead per draw call from taking one less trip through the
glEnable/glDisable switch statement of doom in Mesa.

The exchange here is that we end up taking a trip through it in the
XV, Render, and gradient-generation paths.  If the glEnable() is
actually costly, we should probably cache our logic op state in our
screen, since there's no way the GL could make that switch statement
as cheap as the caller caching it would be.

v2: Don't forget to set the logic op in Xephyr's drawing.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-03-24 12:43:34 -07:00
Keith Packard
697f8581e0 glamor: Eliminate GLAMOR_USE_SCREEN and GLAMOR_USE_PICTURE_SCREEN
Remove these defines as we start to remove support for non-standard
glamor layering as used by the intel driver.

v2: Rebase on the blockhandler change and the Xephyr init failure
    change (by anholt), fix stray NO_DRI3 addition to xwayland.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24 12:01:39 -07:00
Olivier Fourdan
4f534c26c6 xwayland: Add dependency on glamor libs
So that Xwayland gets re-linked each time glamor is modified.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24 12:01:38 -07:00
Olivier Fourdan
251a067993 ephyr: Fail if glamor is requested but not usable
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24 12:01:38 -07:00
Jon TURNEY
234fe39180 hw/xwin: Report OS version in log
Report OS version in log
Report if WoW64 is in use
Manifest for compatbility with Windows versions, so we don't get lied to by GetVersionEx()
Also, make the description in the manifest a bit more generic

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-03-23 16:01:58 +00:00
Jon TURNEY
7a22912edb hw/xwin: Remove Shadow DirectDraw engine
Maybe a long time ago this made some kind of sense, but now there's no good
reason to ever use this, rather than the Shadow DirectDraw NonLocking engine.

Also remove screen private data members used by other removed engines.

Also remove no longer needed OS version check in winDetectSupportedEngines()

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-03-23 16:01:55 +00:00
Jon TURNEY
55a84be085 hw/xwin: Only set native positions if XINERAMA is enabled
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-03-23 16:01:44 +00:00
Jon TURNEY
23e07d71b6 hw/xwin: Register native screens with pseudoramiX
Update man page to document pseudo-xinerama

v2: Make the use of PseudoramiXExtensionInit() match the prototype
v3: Update for nonsdk_extinit.h

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-03-23 15:59:27 +00:00
Jon TURNEY
e036cbfccb Make PseudoramiXExtensionInit() prototype more generally available
Make PseudoramiXExtensionInit() prototype available to hw/xwin

Rather than avoiding a reference to it being pulled in to Xorg by sdksyms by
hiding this prototype behind the INXQUARTZ define, which is only defined when
building Xquartz, introduce nonsdk_extinit.h and move it there.

(The only remaining use of INXQUARTZ is in mi/miiniext.c, in order
to do PseudoramiXExtensionInit() at the point apparently needed by Xquartz)

Also remove duplicate declaration of noPseudoramiXExtension from pseudoramiX.h

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-03-16 16:56:17 +00:00
Jon TURNEY
3aad9b7556 hw/xwin: Turn on -hostintitle by default
Turn on -hostintitle by default
Provide -nohostintitle to disable if needed

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-03-16 16:54:05 +00:00
Jon TURNEY
b2aaf69e62 hw/xwin: Report Cygwin version information in log
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-03-16 16:41:17 +00:00
Jon TURNEY
d02f9611c8 hw/xwin/glx: Improve code generator to deal with latest Khronos OpenGL registry XML
Improve the parsing of the <proto> XML element

Include all text from the param element, in the order it appears in the xml
document, as part of the formal parameter declaration

This is needed to correctly handle the XML description added in svn r27498 of
glPathGlyphIndexRangeNV()'s baseAndCount parameter of type GLuint[2]

This fixes the way the parameter declaration is generated so it is in the
correct form 'GLuint baseAndCount_[2]' and not 'GLuint baseAndCount[2]_'

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-03-16 16:35:19 +00:00
Jon TURNEY
5071cb7e0a hw/xwin/glx: Refactor parsing of the <proto> XML element
Factor out duplicated code used in parsing of the <proto> XML element in the
code generator

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-03-16 16:35:01 +00:00
Jon TURNEY
f42520c5f1 ephyr: Avoid a segfault with 'DISPLAY= Xephy -glamor'
ephyr_glamor_connect() returns NULL if we failed, but applying
xcb_connection_has_error() to NULL is not permitted.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Daniel Martin <consume.noise@gmail.com>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-03-16 15:58:53 +00:00
Jürg Billeter
0a78b599b3 int10: Fix error check for pci_device_map_legacy
pci_device_map_legacy returns 0 on success.

Signed-off-by: Jürg Billeter <j@bitron.ch>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-03-13 12:31:21 +10:00
Egbert Eich
21b896939c symbols: Fix sdksyms.sh to cope with gcc5
Gcc5 adds additional lines stating line numbers before and
after __attribute__() which need to be skipped.

Signed-off-by: Egbert Eich <eich@freedesktop.org>
Tested-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-03-13 12:31:21 +10:00
Peter Hutterer
f485a1af64 Drop valuator mask argument from GetKeyboardEvents
Nothing was using it and if anyone had they would've gotten a warning and
noticed that it doesn't actually work. Drop this, it has been unused for years.

Input ABI 22

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2015-03-13 12:31:21 +10:00
Alan Coopersmith
4a758f59a8 dmx: include header for DMXExtensionInit() in dmx.c
Gets rid of gcc 4.8 warning:

dmx.c:1193:1: warning: no previous prototype for ‘DMXExtensionInit’ [-Wmissing-prototypes]
 DMXExtensionInit(void)
 ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-02-10 18:14:45 -08:00
Alan Coopersmith
a0e44ddfb0 dmx: constify GCOps & GCFuncs pointers
Gets rid of 16 instances of gcc 4.8 warnings:

In file included from dmxgc.c:41:0:
dmx.h:327:23: warning: assignment discards ‘const’ qualifier from
 pointer target type [enabled by default]
     (_saved)->_entry  = (_actual)->_entry;    \
                       ^
dmxgc.h:80:5: note: in expansion of macro ‘DMX_WRAP’
     DMX_WRAP(funcs, &dmxGCFuncs, _pGCPriv, (_pGC));   \
     ^
dmxgc.c:192:5: note: in expansion of macro ‘DMX_GC_FUNC_EPILOGUE’
     DMX_GC_FUNC_EPILOGUE(pGC);
     ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-02-10 18:14:45 -08:00
Alan Coopersmith
9682c47e22 dmx: Mark glxIsExtensionSupported as a const char *
Gets rid of 9 instances of gcc 4.8 warning:

glxcmds.c: In function ‘CreateContext’:
glxcmds.c:378:13: warning: passing argument 1 of ‘glxIsExtensionSupported’
 discards ‘const’ qualifier from pointer target type [enabled by default]
             else if (glxIsExtensionSupported("GLX_SGIX_fbconfig")) {
             ^
In file included from glxserver.h:49:0,
                 from glxcmds.c:41:
glxscreens.h:53:12: note: expected ‘char *’ but argument is of type
 ‘const char *’
 extern int glxIsExtensionSupported(char *ext);

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-02-10 18:14:45 -08:00
Alan Coopersmith
45ec646d77 dmx: remove redundant redeclarations of variables from other headers
Gets rid of these gcc 4.8 warnings:

dmxcb.c:50:12: warning: redundant redeclaration of ‘PanoramiXPixWidth’
 [-Wredundant-decls]
 extern int PanoramiXPixWidth;
            ^
In file included from dmxcb.c:49:0:
../../Xext/panoramiXsrv.h:12:22: note: previous declaration of
 ‘PanoramiXPixWidth’ was here
 extern _X_EXPORT int PanoramiXPixWidth;
                      ^
dmxcb.c:51:12: warning: redundant redeclaration of ‘PanoramiXPixHeight’
 [-Wredundant-decls]
 extern int PanoramiXPixHeight;
            ^
In file included from dmxcb.c:49:0:
../../Xext/panoramiXsrv.h:13:22: note: previous declaration of
 ‘PanoramiXPixHeight’ was here
 extern _X_EXPORT int PanoramiXPixHeight;
                      ^
dmxcb.c:52:12: warning: redundant redeclaration of ‘PanoramiXNumScreens’
 [-Wredundant-decls]
 extern int PanoramiXNumScreens;
            ^
In file included from dmxcb.c:49:0:
../../Xext/panoramiXsrv.h:11:22: note: previous declaration of
 ‘PanoramiXNumScreens’ was here
 extern _X_EXPORT int PanoramiXNumScreens;
                      ^

dmxpict.c:60:12: warning: redundant redeclaration of ‘RenderErrBase’
 [-Wredundant-decls]
 extern int RenderErrBase;
            ^
In file included from ../../render/glyphstr.h:29:0,
                 from ../../render/picturestr.h:28,
                 from dmx.h:65,
                 from dmxpict.c:42:
../../render/picture.h:176:22: note: previous declaration of ‘RenderErrBase’
 was here
 extern _X_EXPORT int RenderErrBase;
                      ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-02-10 18:14:44 -08:00
Alan Coopersmith
1033b85196 dmx: remove redundant declaration of dmxFontPrivateIndex from dmxfont.h
Gets rid of 8 instances of gcc 4.8 warning:

In file included from glxcmds.c:38:0:
../../../hw/dmx/dmxfont.h:57:12: warning: redundant redeclaration of
 ‘dmxFontPrivateIndex’ [-Wredundant-decls]
 extern int dmxFontPrivateIndex;
            ^
In file included from glxcmds.c:35:0:
../../../hw/dmx/dmx.h:388:12: note: previous declaration of
 ‘dmxFontPrivateIndex’ was here
 extern int dmxFontPrivateIndex;        /**< Private index for Fonts     */
            ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-02-10 18:14:44 -08:00
Alan Coopersmith
ac64a653fb dmx: glxproxy prototype cleanup
Gets rid of 107 -Wmissing-prototypes & -Wredundant-decls warnings
from gcc 4.8

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-02-10 18:14:44 -08:00
Alan Coopersmith
bd563fd48f dmx: more unshadowing of variables
Gets rid of gcc 4.8 warnings:

dmxinputinit.c: In function ‘dmxInputScanForExtensions’:
dmxinputinit.c:877:14: warning: declaration of ‘display’ shadows a global declaration [-Wshadow]
     Display *display;
              ^
In file included from ../../../include/windowstr.h:60:0,
                 from dmxinputinit.c:72:
../../../include/opaque.h:52:30: warning: shadowed declaration is here [-Wshadow]
 extern _X_EXPORT const char *display;
                              ^

glxcmds.c: In function ‘__glXCreatePbuffer’:
glxcmds.c:3397:21: warning: declaration of ‘pc’ shadows a parameter [-Wshadow]
             CARD32 *pc = (CARD32 *) (be_req + 1);
                     ^
glxcmds.c:3314:52: warning: shadowed declaration is here [-Wshadow]
 __glXCreatePbuffer(__GLXclientState * cl, GLbyte * pc)
                                                    ^

glxscreens.c: In function ‘CalcServerVersionAndExtensions’:
glxscreens.c:139:35: warning: declaration of ‘req’ shadows a previous local [-Wshadow]
         xGLXQueryServerStringReq *req;
                                   ^
glxscreens.c:68:26: warning: shadowed declaration is here [-Wshadow]
     xGLXQueryVersionReq *req;
                          ^
glxscreens.c:140:36: warning: declaration of ‘reply’ shadows a previous local [-Wshadow]
         xGLXQueryServerStringReply reply;
                                    ^
glxscreens.c:69:27: warning: shadowed declaration is here [-Wshadow]
     xGLXQueryVersionReply reply;
                           ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-02-10 18:14:44 -08:00
Alan Coopersmith
57e08fae82 dmx: attempt to untangle nested loops using same index variable
This doesn't just make gcc sad, it makes my brain sad.

Change from:
    for (i = 0; i < dmxNumScreens; i++) {
        int i;
        for (i = 0; i < nconfigs; i++) {
            for (j = 0; j < dmxScreen->beNumVisuals; j++) {

to the easier to follow:
    for (i = 0; i < dmxNumScreens; i++) {
        for (j = 0; j < nconfigs; j++) {
            for (k = 0; k < dmxScreen->beNumVisuals; k++) {

Gets rid of gcc 4.8 warning:

dmxinit.c: In function ‘InitOutput’:
dmxinit.c:765:17: warning: declaration of ‘i’ shadows a previous local [-Wshadow]
             int i;
                 ^
dmxinit.c:608:9: warning: shadowed declaration is here [-Wshadow]
     int i;
         ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-02-10 18:14:44 -08:00
Alan Coopersmith
0fbebad724 dmx: remove unused variables
Gets rid of gcc 4.8 warnings:

dmxscrinit.c: In function ‘dmxBEScreenInit’:
dmxscrinit.c:83:15: warning: unused variable ‘gcvals’ [-Wunused-variable]
     XGCValues gcvals;
               ^

dmxwindow.c: In function ‘dmxResizeWindow’:
dmxwindow.c:860:19: warning: variable ‘pSibPriv’ set but not used [-Wunused-but-set-variable]
     dmxWinPrivPtr pSibPriv;
                   ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-02-10 18:14:44 -08:00
Alan Coopersmith
f358f0d50c dmx: fix printf format argument warnings
Gets rid of these gcc 4.8 warnings:

dmxinit.c: In function ‘dmxErrorHandler’:
dmxinit.c:167:16: warning: format ‘%x’ expects argument of type ‘unsigned int’,
 but argument 3 has type ‘XID64’ [-Wformat=]
                ev->resourceid);
                ^
dmxinit.c:171:16: warning: format ‘%x’ expects argument of type ‘unsigned int’,
 but argument 3 has type ‘XID64’ [-Wformat=]
                ev->resourceid);
                ^
dmxinit.c:175:16: warning: format ‘%x’ expects argument of type ‘unsigned int’,
 but argument 3 has type ‘XID64’ [-Wformat=]
                ev->resourceid);
                ^
dmxinit.c:181:12: warning: format ‘%d’ expects argument of type ‘int’,
 but argument 3 has type ‘long unsigned int’ [-Wformat=]
            ev->serial);
            ^
dmxinit.c:183:12: warning: format ‘%d’ expects argument of type ‘int’,
 but argument 3 has type ‘long unsigned int’ [-Wformat=]
            dpy->request);
            ^
dmxinit.c: In function ‘InitOutput’:
dmxinit.c:637:9: warning: format ‘%d’ expects argument of type ‘int’,
 but argument 3 has type ‘long unsigned int’ [-Wformat=]
         dmxLog(dmxInfo, "Generation:         %d\n", dmxGeneration);
         ^

dmxprop.c: In function ‘dmxPropertyCheckOtherWindows’:
dmxprop.c:223:24: warning: format ‘%lu’ expects argument of type ‘long
 unsigned int’, but argument 4 has type ‘Window’ [-Wformat=]
                        dmxScreen->name, win, tp.value);
                        ^
dmxprop.c: In function ‘dmxPropertyWindow’:
dmxprop.c:364:16: warning: format ‘%lu’ expects argument of type ‘long
 unsigned int’, but argument 5 has type ‘Window’ [-Wformat=]
                other->index, other->name, other->scrnWin);
                ^
dmxprop.c:364:16: warning: format ‘%lu’ expects argument of type ‘long
 unsigned int’, but argument 8 has type ‘Window’ [-Wformat=]

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-02-10 18:14:44 -08:00
Alan Coopersmith
11af200b00 dmx: move format strings inline so gcc can check
Gets rid of gcc 4.8 warnings:

dmxprint.c: In function ‘dmxConfigPrintPair’:
dmxprint.c:284:25: warning: format not a string literal,
  argument types not checked [-Wformat-nonliteral]
                         p->ysign < 0 ? '-' : '+', p->y);
                         ^
dmxprint.c:289:9: warning: format not a string literal,
  argument types not checked [-Wformat-nonliteral]
         dmxConfigOutput(addSpace, 0, p->comment, format, p->x, p->y);
         ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-02-10 18:14:44 -08:00
Alan Coopersmith
5e01eac10e dmx: Add _X_ATTRIBUTE_PRINTF to dmxConfigLog() & dmxConfigOutput()
Gets rid of gcc 4.8 warnings:

dmxparse.c: In function ‘dmxConfigLog’:
dmxparse.c:61:5: warning: function might be possible candidate for
 ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
     vprintf(format, args);      /* RATS: All calls to dmxConfigLog from
     ^

dmxprint.c: In function ‘dmxConfigOutput’:
dmxprint.c:149:9: warning: function might be possible candidate for
 ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
         pos += vfprintf(str, format, args);     /* assumes no newlines! */

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-02-10 18:14:44 -08:00
Adel Gadllah
62fcd364ac dri2: Set vdpau driver name if ddx does not provide any driver name
Currently when the ddx does not set any driver name we set DRI2 driver but
not the VDPAU driver name. The result is that VDPAU drivers will not get found
by libvdpau when the modesetting driver is being used.

Just assume that the VDPAU driver matches the DRI2 driver name, this is true
for nouveau, r300, r600 and radeonsi i.e all VDPAU drivers currently supported
by mesa.

Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-26 10:42:26 -08:00
Jason Ekstrand
fef2f6357b modesetting: Return the crtc for a drawable even if it's rotated
All of our checks for what crtc we are on take rotation into account so we
select the correct crtc.  The only problem is that we weren't returning it
we were rotated.  This caused X to think DRI3 apps were not on any crtc and
limit them to 1 FPS.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-23 10:50:11 -08:00
Jason Ekstrand
3dcd591fa9 modesetting: Add support for using RandR shadow buffers
This replaces the stubs for shadow buffer creation/allocation with actual
functions and adds a shadow_destroy function.  With this, we actually get
shadow buffers and RandR now works properly.  Most of this is copied from
the xf86-video-intel driver and modified for modesetting.

v2 Jason Ekstrand <jason.ekstrand@intel.com>:
 - Fix build with --disable-glamor
 - Set the pixel data pointer in the pixmap header for dumb shadow bo's
 - Call drmmode_create_bo with the right bpp

v2 Jason Ekstrand <jason.ekstrand@intel.com>:
 - Make shadow buffers per-crtc and leave shadow_enable alone

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-23 10:50:00 -08:00
Jason Ekstrand
7c656bfcae modesetting: Add drmmode_bo_has_bo and drmmode_bo_map helper function
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-23 10:49:38 -08:00
Jason Ekstrand
b4703a5a6e modesetting: Refactor drmmode_glamor_new_screen_pixmap
The original drmmode_glamor_new_screen_pixmap function was specific to the
primary screen pixmap.  This commit pulls the guts out into a new, more
general, drmmode_set_pixmap_bo function for setting a buffer on a pixmap.
The new function also properly tears down the glamor bits if the buffer
being set is NULL.  The drmmode_glamor_new_screen_pixmap function is now
just a 3-line wrapper around drmmode_set_pixmap_bo.

v2 Jason Ekstrand <jason.ekstrand@intel.com>:
 - Re-arranged code in drmmode_set_pixmap_bo and
   drmmode_glamor_handle_new_screen_pixmap so that glamor_set_screen_pixmap
   only gets called for the screen pixmap
 - Guard the call to glamor_set_screen_pixmapa with a drmmode->glamor check

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-23 10:49:33 -08:00
Chris Wilson
0829310148 dri2: SourceOffloads may be for DRI3 only
As a DDX may declare offload support without supporting DRI2
(because it is using an alternative acceleration mechanism like DRI3),
when iterating the list of offload_source Screens to find a matching
DRI2 provider we need to check before assuming it is DRI2 capable.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88514
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-23 10:11:30 -08:00
Carlos Olmedo Escobar
f27d743c18 Avoid possible null pointer dereference.
Signed-off-by: Carlos Olmedo Escobar <carlos.olmedo.e@gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-23 10:03:57 -08:00
Keith Packard
3d12941b40 drivers/modesetting: Save current BlockHandler on return in msBlockHandler
If the BlockHandler chain is modified while it is active, we need to
re-fetch the current value and store it in our private for use the
next time through.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-23 09:06:41 -08:00
Markus Wick
5af2f5b7d2 xwayland: Set glamor filter to nearest
glEGLImageTargetTexture2DOES only set the first level.
Mesa handles this new texture as incomplete and renders a black screen.
We also want to prevent linear filtering.

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

Signed-off-by: Markus Wick <markus@selfnet.de>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-01-17 07:47:53 +13:00
Keith Packard
5f2e8ac51c Merge remote-tracking branch 'whot/for-keith' 2015-01-10 14:51:57 +13:00