Commit Graph

538 Commits

Author SHA1 Message Date
Jeremy White
ecf6275508 Define prototypes for hw/xfree86/modes/xf86Modes.c only in xf86Modes.h.
This removes a large number of redundant declaration warnings.

Signed-off-by: Jeremy White <jwhite@codeweavers.com>
Reviewed-by: Robert Morell <rmorell@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-04-08 09:19:34 -07:00
vdb@picaros.org
ac4c2abe98 xserver: add monitor Option "ZoomModes" [v2]
Section "Monitor"
  Identifier "a21inch"
  Option "PreferredMode" "1600x1200"
  Option "ZoomModes" "1600x1200 1280x1024 1280x1024 640x480"
EndSection

The option's effect is to search for and mark once each named mode in
the output modes list.  So the specification order is free and the zoom
modes sequence follows the order of the output modes list.  All marked
modes are available via the Ctrl+Alt+Keypad-{Plus,Minus} key
combination.

See also http://bugs.freedesktop.org/show_bug.cgi?id=17954.

This option has its use for combined monitor and television setups.
It allows for easy switching between 60 Hz and 50 Hz modes even when a
monitor refuses to display the input signal.

(Includes a few minor changes suggested by Aaron for v2)

Signed-off-by: Servaas Vandenberghe <vdb@picaros.org>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-03-26 13:53:06 -07:00
Dave Airlie
8f4640bdb9 randr: cleanup provider properly
So in the cold plug server shutdown case, we reap the resources
before we call CloseScreen handlers, so the config->randr_provider
is a dangling pointer when the xf86CrtcCloseScreen handler is called,

however in the hot screen unplug case, we can't rely on automatically
reaped resources, so we need to clean up the provider in the xf86CrtcCloseScreen
case.

This patch provides a cleanup callback from the randr provider removal
into the DDX so it can cleanup properly, this then gets called by the automatic
code for cold plug, or if hot unplug it gets called explicitly.

Fixes a number of random server crashes on shutdown
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58174
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=891140

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-03-01 18:14:28 +10:00
Dave Airlie
3ec35c45ca xf86: actually set the compat output in the failure case
The previous fix for the previous fix, didn't fully work,

If we don't set compat_output we end up doing derferences
of arrays with -1, leading to valgrind warnings.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-03-01 18:14:28 +10:00
Keith Packard
6703a7c7cf hw/xfree86: Require only one working CRTC to start the server.
Instead of requiring every mode set to complete successfully, start up
as long as at least one CRTC is working. This avoids failures when one
or more CRTCs can't start due to mode setting conflicts.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2013-01-08 20:24:32 -08:00
Chris Wilson
e54f71a2c7 xf86: select a fake output for headless servers
Following commit 37d956e3ac
Author: Keith Packard <keithp@keithp.com>
Date:   Mon Sep 10 11:14:20 2012 +1000

    xf86: fix compat output selection for no output GPUs

headless servers can no longer startup as we no longer select a compat
output for the fake framebuffer.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56343
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>
2012-11-27 16:30:53 -08:00
Keith Packard
37d956e3ac xf86: fix compat output selection for no output GPUs
This should work properly with dynamic outputs.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-19 15:48:12 +10:00
Dave Airlie
20f601a0fb xf86/crtc: don't free config->name
This is set by pre_init not screen init, so if we free it here
and then recycle the server, we lose all the providers.

I think we need to wrap FreeScreen here to do this properly,
will investigate for 1.14 most likely, safer to just leak this
on server exit for now.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-04 16:15:52 +10:00
Keith Packard
c0540b4c8d Kludge -- Call RandR screen before cleaning up xf86 crtcs
The core RandR screen cleanup now involves cleaning up any GPU screen
associations, and those call down into DDX to clean up the driver. If
the pointers from the xf86 structures back to the core randr
structures are set to NULL at that point, bad things happen.

This patch "knows" that the core RandR close screen is underneath the
xf86 randr close screen function, and so makes sure it gets called
first.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-08-14 17:14:55 -07:00
Alan Coopersmith
9f7ef7f7f0 Fix up formatting of initializers for arrays of structs
The indenter seems to have gotten confused by initializing arrays of
structs with the struct defined inline - for predefined structs it did
a better job, so match that.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-08-06 15:22:53 -07:00
Keith Packard
5a51cb86f3 xfree86: When xf86CrtcCloseScreen is called, the randr CRTCs are gone
The RandR CRTC structures are freed when their resource IDs are
destroyed during server shut down, which is before the screen is
closed. Calling back into RandR with stale pointers just segfaults the
server.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Tested-by: Knut Petersen <knut_petersen@t-online.de>
2012-08-06 15:05:38 -07:00
Rui Matos
1bf81af4a6 xf86RandR12: Don't call ConstrainCursorHarder() if panning is enabled
Panning is at odds with CRTC cursor confinement. This disables CRTC cursor
confinement as long as panning is enabled.

Fixes regression introduced in 56c90e29f0.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Rui Matos <tiagomatos@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-08-06 15:03:47 -07:00
Adam Jackson
ff56f88616 randr: Fix up yet another corner case in preferred mode selection
Let's say - purely for the sake of argument, mind you - that you had a
server GPU with anemic memory bandwidth, and you walked up to it and
plugged in a monitor that was 1920x1080 because that's what happened to
be on the crash cart.  Say the memory bandwidth is such that anything
larger than 1280x1024 gets filtered away.  Now you're in trouble,
because the established timings section includes a 720x400 mode because
that's what DOS 80x25 is, and that happens to just about match the
physical aspect ratio.

Instead let's reuse the logic from the existing aspect-match path: pick
the larger mode of either the physical aspect ratio or 4:3.

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-08-06 15:03:47 -07:00
Maarten Lankhorst
deb08658e2 xfree86: Strip dangling pointers from desiredMode
Based on the original patch by Chris Wilson, which was a better fix than mine.

We stash a copy of the desiredMode on the crtc so that we can restore it
after a vt switch. This copy is a simple memcpy and so also stashes a
references to the pointers contained within the desiredMode. Those
pointers are freed the next time the outputs are probed and mode list
rebuilt, resulting in us chasing those dangling pointers on the next
mode switch.

==22787== Invalid read of size 1
==22787==    at 0x40293C2: __GI_strlen (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==22787==    by 0x668F875: strdup (strdup.c:42)
==22787==    by 0x5DBA00: XNFstrdup (utils.c:1124)
==22787==    by 0x4D72ED: xf86DuplicateMode (xf86Modes.c:209)
==22787==    by 0x4CA848: xf86CrtcSetModeTransform (xf86Crtc.c:276)
==22787==    by 0x4D05B4: xf86SetDesiredModes (xf86Crtc.c:2677)
==22787==    by 0xA7479D0: sna_create_screen_resources
(sna_driver.c:220)
==22787==    by 0x4CB914: xf86CrtcCreateScreenResources (xf86Crtc.c:725)
==22787==    by 0x425498: main (main.c:216)
==22787==  Address 0x72c60e0 is 0 bytes inside a block of size 9 free'd
==22787==    at 0x4027AAE: free (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==22787==    by 0x4A547E: xf86DeleteMode (xf86Mode.c:1984)
==22787==    by 0x4CD84F: xf86ProbeOutputModes (xf86Crtc.c:1578)
==22787==    by 0x4DC405: xf86RandR12GetInfo12 (xf86RandR12.c:1537)
==22787==    by 0x518119: RRGetInfo (rrinfo.c:202)
==22787==    by 0x51D997: rrGetScreenResources (rrscreen.c:335)
==22787==    by 0x51E0D0: ProcRRGetScreenResources (rrscreen.c:475)
==22787==    by 0x513852: ProcRRDispatch (randr.c:493)
==22787==    by 0x4346DB: Dispatch (dispatch.c:439)
==22787==    by 0x4256E4: main (main.c:287)

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36108
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-11 15:55:22 -07:00
Dave Airlie
e2fd447e76 xf86: add callback for offloak sink setting support.
This adds support for setting the offload sink to the xf86 ddx.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-07 10:39:03 +01:00
Dave Airlie
22f02120eb xf86: store scanout pixmap in the xf86 struct as well.
This is so we can tell the scanout pixmap has changed between calls
to the crtc set function.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-07 10:37:45 +01:00
Dave Airlie
a7c01da54a xf86: make sure rotate calcs are done on the right screen boundaries
This fixes a segfault where this code believes we are outside the screen
boundaries on a slave device, but we aren't.

Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-07 10:37:45 +01:00
Dave Airlie
98686512cb xf86: add output source setting callback (v2)
This adds support for the randr callback for setting the output source
for a device.

v2: drop root clip change on detach

Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-07 10:37:42 +01:00
Dave Airlie
88bc02bfaa xf86/crtc: add new interface to detach slave crtcs
This will detach any scanout pixmaps attached to slave crtcs.

Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-07 10:37:11 +01:00
Dave Airlie
2ed3f64d9d xf86: add initial scanout pixmap support (v2)
Add the simple passthrough interface for drivers to use,
so they can set scanout pixmaps.

v2: detach scanout pixmap properly.

Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-07 10:37:10 +01:00
Dave Airlie
05d2472cd2 xf86dga: handle DGAAvailable for gpu screens. (v2)
v2: Split out DGAAvailable into two interfaces, one for calls from protocol
decoding and one for internal usage, after discussion with ajax and keithp.

Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-07 10:37:10 +01:00
Dave Airlie
d0e138c3f3 dix: attach unbound screens to protocol screen 0 (v2)
This is the default attachment, unbound gpu screens get
attached to the 0 protocol screen.

detach on hotunplug.

v2: detach after tearing down crtc/outputs.

Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-07 10:37:05 +01:00
Dave Airlie
9b5cf2ed76 xfree86: add framework for provider support in ddx. (v4)
This adds the framework for DDX provider support.

v2: as per keithp's suggestion remove the xf86 provider object
and just store it in the toplevel object.

v3: update for new protocol

v4: drop devPrivate, free name

Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-06 22:16:08 +01:00
Torsten Kaiser
7c9d8cbd36 xfree86: EDID Est III parsing skips some modes
This loop needs to count from 7 to 0, not only from 7 to 1.
The current code always skips the modes {1152, 864, 75, 0}, {1280, 1024, 85, 0},
{1400, 1050, 75, 0}, {1600, 1200, 70, 0} and {1920, 1200, 60, 0}.

Signed-off-by: Torsten Kaiser <x11@ariolc.dyndns.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-06 12:11:48 -07:00
Torsten Kaiser
0b3abacb64 xfree86: EDID Est III parsing can walk off end of array
Using -O3 gcc notes that m could reach beyound the end of the EstIIIModes array,
if the last bits of the 11s byte where set.
Fix this, by extending the array to cover all possible bits from est.

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

Signed-off-by: Torsten Kaiser <x11@ariolc.dyndns.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-06 12:11:42 -07:00
Dave Airlie
957bf959fb dix/render: consolidate window format matching code.
This code existed in 3 different forms, perhaps it should be
consolidated.

Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-06-28 10:43:35 -07:00
Dave Airlie
1f0e8bd5eb api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.

Its been squashed to make bisection easier.

Full patch log below:

commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Mon May 14 15:16:11 2012 -0700

    xfree86: Bump video ABI to 13.0

    The ABI was broken by changes to convert from screen index numbers to ScreenPtr
    / ScrnInfoPtr in various structures and function signatures.

    Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date:   Thu May 24 10:56:57 2012 +0100

    xf86: xf86ClearEntityListForScreen should take a pScrn

    When adding GPU screens this make life easier.

    (also fix comment, as pointed out by Alan)

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date:   Thu May 24 07:07:32 2012 +0100

    xf86i2c: add pscrn for drivers to use

    This just adds a pScrn pointer into the struct for the drivers to use
    instead of scrnIndex. Mostly scrnIndex is used for logging, but some
    drivers use it to lookup xf86Screens, so let them stash a pScrn instead.

    Removing the scrnIndex is a bit more involved and I'm not sure its worth
    the effort. Doing i2c in the X server is legacy code as far as I'm concerned.

    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 23 19:25:20 2012 +0100

    dix/gc: consolidate GC object creation in one place

    The standard GC create and scratch GC create were 90% the same really,
    and I have a need in the future for creating GC objects without the
    other bits, so wanted to avoid a third copy.

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 23 10:24:06 2012 +0100

    xf86: add a define to denote the new non-index interfaces are being used

    This can be used by drivers to provide compatible APIs.

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 23 15:09:12 2012 +0100

    dix: make Create/Free scratch pixmaps take a ScreenPtr

    While technically an API/ABI change I doubt anyone uses it,
    but it helps in splitting screens up.

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 23 14:57:55 2012 +0100

    xf86/xv: remove scrnIndexfrom xf86FindXvOptions.

    Move this interface to taking an ScrnInfoPtr.

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 23 14:53:59 2012 +0100

    xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)

    stop passing indices into this function.

    v2: drop flags argument.

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 23 14:48:09 2012 +0100

    xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 14:18:59 2012 +0100

    xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)

    Instead of passing an index, pass the actual ScreenPtr. This allows
    more moving towards not abusing xf86Screens + screenInfo.

    v2: drop the blockData/wakeupData args as per ajax's suggestion.,
    fix docs.

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date:   Wed Apr 11 09:53:14 2012 +0100

    xf86/common: remove some more pScrn->pScreen uses

    remove some more conversions that appeared after api cleanups.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 16:34:53 2012 +0100

    ddc: change API to take ScrnInfoPtr (v2)

    This removes all xf86Screens usage from ddc code,
    it modifies the API for some functions to avoid taking indices.

    v2: address Alan's comments about dropping DDC2Init parameter.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 16:31:26 2012 +0100

    vbe: don't use index for VBEInterpretPanelID (API)

    Remove use of xf86screens from vbe module.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 16:25:11 2012 +0100

    int10/vbe: don't use xf86Screens. (ABI) (v3)

    Pass the ScrnInfoPtr instead of the index in the int10 struct.

    This saves us using it to dereference xf86Screens.

    v2: address Alan's comment to fix struct alignment.

    v3: squash in all the int10 fixes, test the vm86 code builds,
    after comments by Keith.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:30:18 2012 +0100

    xserver: drop index argument to ScreenInit (ABI/API) (v2)

    This drops the index argument, its the same as pScreen->myNum,
    and its the last major index abuse I can find.

    v2: address Alan's review - update docs, fix xwin/xnest/darwin

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:23:01 2012 +0100

    xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)

    This migrates PointerMoved from an index to ScrnInfoPtr.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:20:46 2012 +0100

    xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)

    This migrates the PMEvent from index to ScrnInfoPtr.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:18:30 2012 +0100

    xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)

    This migrates the SetDGAMode callback from an index to ScrnInfoPtr.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:14:11 2012 +0100

    xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)

    This migrates the ChangeGamma interface to avoid passing a index.

    v2: fix xf86RandR12.c + xf86cmap.c call

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:11:09 2012 +0100

    xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)

    The EXA interface migrates to ScreenPtr,
    and the xf86 interface migrated to ScrnInfoPtr.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:02:11 2012 +0100

    xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)

    This migrates the ValidMode to passing a ScrnInfoPtr instead
    of an index.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 14:59:46 2012 +0100

    xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)

    This migrate the SwitchMode interface to take a ScrnInfoPtr
    instead of an index.

    v2: drop flags.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 14:50:37 2012 +0100

    xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)

    This converts AdjustFrame code paths to passing a ScrnInfoPtr
    instead of an integer index.

    v2: drop flags args.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 14:41:27 2012 +0100

    xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)

    Another index->pScrn conversion.

    v2: drop flags arg.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 14:35:41 2012 +0100

    xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)

    This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
    instead of an index into xf86Screens. This allows dropping more
    public dereferences of the xf86Screens and screenInfo.

    v2: drop flags args as suggested by Keith, fix docs.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 14:04:59 2012 +0100

    xserver: remove index from CloseScreen (API/ABI breakage)

    This drops the index from the CloseScreen callback,
    its always been useless really, since the pScreen contains it.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 13:22:18 +01:00
Dave Airlie
2e237c838f xf86: reimplement XF86SCRNINFO macro using new functions.
This macro did lookups via privates but we can just use the ScreenToScrn
conversion instead.

This patch drops all in-server uses, we should drop the macro later,
once drivers have been converted to not use it.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-21 12:59:20 +01:00
Dave Airlie
8da35202f3 xf86/modes: drop more pScrn->pScreen usages
Just simple conversion to use the lookup function.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-21 12:59:20 +01:00
Dave Airlie
738367ac9b xf86/modes: drop two uses of screenInfo
Just use new macros to access scrn->screen.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-21 12:59:20 +01:00
Dave Airlie
41151f88a6 xf86: migrate to using xf86ScreenToScrn wrapper (v2)
migrate to new helper API.

This just wraps all the obvious uses of xf86Screens[pScreen->myNum],
and should be fairly simple to review.

v2: remove commented out lines.

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-21 12:59:08 +01:00
James Cloos
afc153a5b4
Fix RANDR’s gamma_to_ramp().
In order to generate a 256-entry ramp in [0,65535] which covers the full
range, one must mupliply eight-bit values not by 256 but rather by 257.

Many years back – well before the RANDR extension was written, and
before xorg@fdo – a similar bug fix was made to the DIX for converting
client-supplied eight-bit color values into sixteen-bit values.

Noticed by: Elle Stone and Graeme Gill.

Signed-off-by: James Cloos <cloos@jhcloos.com>
2012-05-08 17:55:10 -04:00
Michal Suchanek
fa6dddc6ce xfree86: workaround crash on close
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=41653

Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Knut Petersen <Knut_Petersen@t-online.de>
2012-04-23 20:20:42 -07:00
Yaakov Selkowitz
cb5661e86d xf86Crtc: include "xf86xv.h" only if XV
Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-05 21:56:59 -05:00
Keith Packard
9838b7032e Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh'
from util/modular. Compared to the patch that Daniel posted in
January, I've added a few indent flags:

	-bap
	-psl
	-T PrivatePtr
	-T pmWait
	-T _XFUNCPROTOBEGIN
	-T _XFUNCPROTOEND
	-T _X_EXPORT

The typedefs were needed to make the output of sdksyms.sh match the
previous output, otherwise, the code is formatted badly enough that
sdksyms.sh generates incorrect output.

The generated code was compared with the previous version and found to
be essentially identical -- "assert" line numbers and BUILD_TIME were
the only differences found.

The comparison was done with this script:

dir1=$1
dir2=$2

for dir in $dir1 $dir2; do
	(cd $dir && find . -name '*.o' | while read file; do
		dir=`dirname $file`
		base=`basename $file .o`
		dump=$dir/$base.dump
		objdump -d $file > $dump
	done)
done

find $dir1 -name '*.dump' | while read dump; do
	otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
	diff -u $dump $otherdump
done

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-03-21 13:54:42 -07:00
Alan Coopersmith
471e5373b6 Remove duplicate declaration of xf86ValidateModesFlags in xf86Modes.h
Clears gcc warning in every file that includes xf86Modes.h:
xf86Modes.h:102:1: warning: redundant redeclaration of 'xf86ValidateModesFlags'
xf86Modes.h:72:1: note: previous declaration of 'xf86ValidateModesFlags' was here

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12 17:03:12 -08:00
Alan Coopersmith
632d205b30 Fix gcc -Wwrite-strings warnings in xf86Modes code
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:07 -08:00
Ross Burton
58864146fb edid: Add quirk for Acer Aspire One 110
At least one revision of the AAO reports a 190x110mm maximum size but a
451x113mm mode.

X.Org Bug 41141 <https://bugs.freedesktop.org/show_bug.cgi?id=41141>

Signed-off-by: Ross Burton <ross@linux.intel.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-18 11:26:03 -08:00
Pierre-Loup A. Griffais
a551f126cc xfree86: Fix RandR rotation across server generations
245cb8e94f fixed xf86RotateDestroy() to actually run its teardown
code, causing the Damage object to properly be re-allocated after a
server regeneration. However the block that does that still thinks the
Rotate layer BlockHandler is wrapped from the last generation, meaning
the shadow pixmap is never re-allocated and the Damage object is never
re-registered, causing a blank screen, and potentially a driver crash
on the next teardown after the server asks it to free a 0x0 Pixmap.

Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-11-14 09:14:20 -08:00
Keith Packard
d91aa0e660 Merge remote-tracking branch 'whot/two-screen-coordinates' 2011-11-02 21:20:07 -07:00
Dave Airlie
17416e88dc xf86Crtc: handle no outputs with no modes harder.
If you started an X server with no connected outputs, we pick a default
1024x768 mode, however if you then ran an xvidmode using app against that
server it would segfault the server due to not finding any valid modes.

This was due to the no output mode set code, only adding the modes to the
scrn->modes once, when something called randr 1.2 xf86SetScrnInfoModes would
get called and remove all the modes and we'd end up with 0.

This change fixes xf86SetScrnInfoModes to always report a scrn mode of at
least 1024x768, and pushes the initial configuration to just call it instead
of setting up the mode itself.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=746926

I've seen other bugs like this on other distros so it might also actually fix them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-24 18:09:35 -07:00
Jesse Barnes
3e145d3d67 crtc: match full preferred modes if possible when choosing an initial config
It's fairly common to have multiple, identical monitors plugged in.  In
that case, it's preferable to run the monitor's preferred mode on each
output, rather than just matching the width & height and end up with
different timings or refresh rates.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-19 17:19:44 -07:00
Tiago Vignatti
6817050f31 configure: wrap PCI code with macro and set it at build time
--disable-pciaccess, used together with --disable-module-int10, can be used to
disable all pci code inside the server.

Note that XSERVER_LIBPCIACCESS was previously used only in the driver side and
now it defines also whether the library is used inside the server. Also,
XORG_BUS_PCI automake variable is introduced to track PCI code needs.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-15 21:18:47 -07:00
Peter Hutterer
8bebb4b489 Store desktop dimensions in screenInfo.
For Zaphod mode screen crossing handling we need to know the size of all
screens together (i.e. the whole desktop size). Store that in the screenInfo to
have it readily available in events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-13 11:26:09 +10:00
Julien Cristau
eabd5532fb xfree86: fix build with xv disabled
https://bugs.freedesktop.org/show_bug.cgi?id=29111

Signed-off-by: Julien Cristau <jcristau@debian.org>
Tested-by: Cyril Brulebois <kibi@debian.org>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
2011-10-09 17:08:34 -07:00
vdb@picaros.org
e4cddf509e Fix a rare memory leak
Signed-off-by: Servaas Vandenberghe <vdb@picaros.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-04 20:18:17 -07:00
Pauli Nieminen
463dd87062 xf86/modes: Fix shadow rotation crashing when screen pixmap changes
Driver may change screen pixmaps after page flipping that would then
make damage lose track of the root pixmap.

Using root window for shadow damages fixes the problem because
SetWindowPixmap is implemented in shadow code.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-03 11:41:22 -07:00
Aaron Plattner
57cd32e934 xfree86/modes: Make cursor position transform a helper function
When the driver can handle the crtc transform in hardware, it sets
crtc->driverIsPerformingTransform, which turns off both the shadow
layer and the cursor's position-transforming code.  However, some
drivers actually do require the cursor position to still be
transformed in these cases.  Move the cursor position transform into a
helper function that can be called by such drivers.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2011-10-03 11:30:04 -07:00
Aaron Plattner
245cb8e94f xfree86/modes: Let the driver handle the transform
If a driver can use hardware to handle the crtc transform, then
there's no need for the server's shadow layer to do it.  Add a crtc
flag that lets the driver indicate that it is handling the transform.
If it's set, consider the transformed size of the screen but don't
actually enable the shadow layer.  Also stop adjusting the cursor
image and position.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2011-10-03 11:30:00 -07:00
Keith Packard
b018b81533 Merge remote-tracking branch 'jamey/reviewed' 2011-09-21 14:17:14 -07:00
vdb@picaros.org
2f47433fef print DisplayMode type bits
Dear,

A patch I posted on xorg-devel was reviewed and is ready for
inclusion in xserver.  Would you be willing to apply the patch so that
it finds its way into the master branch ?

Thank you, Servaas Vandenberghe.

http://lists.x.org/archives/xorg-devel/2011-August/024769.html
http://lists.x.org/archives/xorg-devel/2011-August/024777.html

This patch adds printing of the DisplayMode type bits to
xf86PrintModeline().  It helps to trace the modeline origin and to
understand the initial configured modeline.

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
Signed-off-by: Servaas Vandenberghe
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-09-21 13:46:57 -07:00
Jamey Sharp
8f69c935f6 Eliminate MAXSCREENS-sized CursorScreenKey array.
Use new per-screen privates API instead.

Commit by Jamey Sharp and Josh Triplett.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-09-19 22:53:05 -07:00
Matěj Cepl
b27d61e443 Fix UTF-8 encoding
Report to find out all non-UTF-8 files created by

cat extensions |xargs -I XXXX find . -name \*.XXXX |while read FILE ; do
    if ( iconv -f utf8 -t ucs2 $FILE >/dev/null 2>/dev/null ) ; then
        /bin/true
    else
        echo $FILE
    fi
done >>report

Signed-off-by: Matěj Cepl <mcepl@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>

[Daniel: git am failed for me, so I redid it.  The method listed in the
         commit message also failed, so I just used file/grep/iconv.  The
         results are the same though.]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-06-30 16:38:31 +10:00
Nicolas Kaiser
387f45a707 hw/xfree86/modes: remove duplicated include
Remove duplicated include.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-04-24 19:46:06 -07:00
Adam Jackson
3d688316af xfree86: warning fix
xf86RandR12.c: In function 'xf86RandR12EnterVT':
xf86RandR12.c:1769:5: warning: ISO C90 forbids mixed declarations and code

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-28 13:01:03 -04:00
Erkki Seppälä
d3adf2d935 xfree86/modes: Fixed memory leak in xf86InitialConfiguration
There were two memory leaks in the function: one was the lack of free
for "enabled", the other was the full lack of releasing anything when
configuration was too small. The first issue was fixed by adding the
missing free, the other was addressed by replacing the duplicate
memory releasing sequences with one that is gotoed into.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-03-14 13:14:04 -07:00
Keith Packard
6c90e839d9 Merge remote branch 'whot/for-keith' 2011-03-03 14:41:44 -08:00
Keith Packard
365ad68fb9 Merge remote branch 'ajax/for-keithp' 2011-02-24 18:49:40 -08:00
Keith Packard
b833f9b924 Revert "Replace huge argument list in xf86CrtcSetModeTransform with struct"
This reverts commit 8b35118c03.
2011-02-23 11:18:35 -08:00
Keith Packard
a91d33917b Revert "randr: Add sprite position transforms"
This reverts commit 66294afcab.
2011-02-23 11:18:12 -08:00
Keith Packard
3d4ee25a1e Revert "randr: Implement RRSetCrtcConfigs"
This reverts commit d94a035ea9.
2011-02-23 11:18:08 -08:00
Keith Packard
8b0e651f7d Revert "hw/xfree86/modes: Add optional driver API for RRSetCrtcConfigs"
This reverts commit 86c489c319.
2011-02-23 11:18:05 -08:00
Keith Packard
9e8c20b0d4 Revert "randr: Add per-crtc pixmaps"
This reverts commit 82612045e1.
2011-02-23 11:17:42 -08:00
Keith Packard
793a242c89 Revert "DIX is responsible for ref counting scanout pixmaps."
This reverts commit 96b4d4787b.
2011-02-23 11:17:33 -08:00
Keith Packard
7b7cd3f121 Revert "Set sprite transforms from RRSetCrtcConfigs"
This reverts commit a88d70fb20.
2011-02-23 11:17:29 -08:00
Keith Packard
fd9331f6eb Revert "Separate out screen size and screen pixmap sizes in RRScreenSizeSet"
This reverts commit 752c368421.
2011-02-23 11:17:24 -08:00
Adam Jackson
dc498b433f xfree86: If the driver found modes on an output, don't add more
Inferring modes from sync ranges is only valid if the monitor says it's
valid.  If the monitor says it's valid, then we'll have already added
those modes during EDID block parse.  If it doesn't, then we should
believe it.

If there's no EDID for an output, but sync ranges from the config, we'll
still add default modes as normal.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-02-23 13:39:22 -05:00
Peter Hutterer
e48bf3b640 xfree86: replace two inputInfo.pointer uses with device loops.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-02-22 14:35:44 +10:00
Adam Jackson
994b7b3dc9 xfree86: warning fix
Did you know that anonymous enums with function scope will not only
override the enum values from global scope, but will be treated as
entirely different types?  C's type system just rules.

xf86Crtc.c: In function 'handle_detailed_monrec':
xf86Crtc.c:1555:33: warning: comparison between 'enum det_monrec_source' and 'enum <anonymous>'
xf86Crtc.c:1562:33: warning: comparison between 'enum det_monrec_source' and 'enum <anonymous>'

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-02-08 12:41:04 -05:00
Evan Broder
12b0f7df2c xfree86/modes: Be sure to only use new EDID for physical output dimensions
The EDID processing regards physical dimensions of 0mm x 0mm as
invalid. Previously the old values for height and width would be
preserved if none of the physical dimension specifications in the new
EDID were considered valid.

This will come up in particular if first a monitor is connected to an
output, and then a projector is connected. Since projectors generally
report physical dimensions of 0mm x 0mm, this would result in the
projector claiming to have the physical dimensions of the monitor.

Signed-off-by: Evan Broder <ebroder@mokafive.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-02-02 14:58:45 -08:00
Keith Packard
0dede200c9 Merge remote branch 'vsyrjala/misc_fixes' 2011-01-05 08:51:46 -08:00
Zhao Yakui
86ca434a1a edid: Fix incorrect timings for VIC61
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
2011-01-04 14:08:16 -05:00
Ville Syrjälä
2e781457d4 xfree86/modes: Take rotation into account when checking mode size
Assume that a mode can be used in either landscape or portrait
orientation. I suppose the correct thing to do would be to
collect all the supported rotations from the CRTCs that can be used
with a specific output, but that information doesn't seem to be
readily available when these checks are done. So just assume that
either orientation is fine.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-12-27 20:03:52 +02:00
Jörn Horstmann
4b88c7be8d Add EDID quirk for HP Compaq nc8430.
Like some other LPL panels, this one reports the vertical size in cm rather
than mm.
Patch taken from Launchpad bug #380009 <https://launchpad.net/bugs/380009>

X.Org Bug 28414 <https://bugs.freedesktop.org/show_bug.cgi?id=28414>

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-12-19 16:43:48 -08:00
Alan Coopersmith
446482efaa Convert cvt code to use XNFasprintf()
Requires linking xprintf.c into standalone cvt utility

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-12-07 11:10:36 -08:00
Alan Coopersmith
d2c42b1027 Replace alloc+strcpy+strcat with asprintf() & XNFasprintf() calls
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-12-07 11:10:35 -08:00
Alan Coopersmith
03e8bfa1d1 Convert existing Xprintf style calls to asprintf style
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-12-07 11:10:35 -08:00
Keith Packard
752c368421 Separate out screen size and screen pixmap sizes in RRScreenSizeSet
This provides for separate sizes for the screen scanout and rendering
buffer and the application-visible screen size.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2010-12-06 20:09:04 -08:00
Keith Packard
a88d70fb20 Set sprite transforms from RRSetCrtcConfigs
These were getting ignored.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2010-12-06 20:08:58 -08:00
Keith Packard
96b4d4787b DIX is responsible for ref counting scanout pixmaps.
Remove some extra ref counting inside hw/xfree86/modes

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2010-12-06 20:08:54 -08:00
Keith Packard
82612045e1 randr: Add per-crtc pixmaps
This adds new driver hooks to allocate scanout pixmaps and
changes the mode setting APIs to pass the new scanout pixmaps
along from DIX. DIX is responsible for reference counting the pixmaps
by tracking them through RRCrtcNotify.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2010-12-06 20:08:48 -08:00
Keith Packard
86c489c319 hw/xfree86/modes: Add optional driver API for RRSetCrtcConfigs
This provides a driver hook which can either completely replace, or
just validate the parameters for, the RRSetCrtcConfigs request.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2010-12-06 20:08:46 -08:00
Keith Packard
d94a035ea9 randr: Implement RRSetCrtcConfigs
This provides a driver-independent implementation of the
RRSetCrtcConfigs API by simply using the existing interfaces.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2010-12-06 20:08:43 -08:00
Keith Packard
66294afcab randr: Add sprite position transforms
This implements sprite position transformations. Sprite image
transforms are passed all the way to the DDX layer, but the images are
not yet manipulated before being passed to the drivers.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2010-12-06 20:08:40 -08:00
Keith Packard
8b35118c03 Replace huge argument list in xf86CrtcSetModeTransform with struct
xf86CrtcSetModeTransform was starting to get ridiculous with 6
arguments, this change has it take a single structure that contains
all of those values along with a set of flags that says which have
changed.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2010-12-06 20:08:18 -08:00
Keith Packard
5de312a60d Merge remote branch 'alanc/master' 2010-12-06 19:22:52 -08:00
Keith Packard
3824417335 Merge remote branch 'vsyrjala/xv_reput' 2010-12-02 08:39:33 -08:00
Alan Coopersmith
29e467a1f1 xf86OutputRename: Replace another strlen/malloc/strcpy set with strdup
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-11-30 16:18:35 -08:00
Aaron Plattner
ffcbfa0063 xfree86: Fix rotation of 2-color non-interleaved cursor images
When RandR 1.2's transformation code is enabled, it rotates the cursor
image so that it appears upright on a rotated screen.  This code
completely mangles 2-color cursors on hardware where the the mask and
source images are not interleaved due to two problems:

1. stride is calculated as (width / 4) rather than (width / 8), so the
   expression (y * stride) skips two lines instead of one for every
   time y is incremented.
2. cursor_bitpos ignores the 'mask' parameter if the hardware doesn't
   specify any of the HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_* flags.

To fix this, refactor the code to pass the whole xf86CursorInfoPtr
through to cursor_bitpos and compute the correct stride there based on
the flags.  If none of the SOURCE_MASK_INTERLEAVE flags are set, use
the total cursor size to move the 'image' variable into the mask part
of the image before computing the desired byte pointer.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Robert Morell <rmorell@nvidia.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Tested-by: Cyril Brulebois <kibi@debian.org>
2010-11-30 10:31:43 -08:00
Ville Syrjälä
640c8716e0 xfree86/modes: Provide a ModeSet hook in ScrnInfo
Add a new hook ModeSet that will be called after display mode is
changed, or after the display has been panned.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Reviewed-by: Luc Verhaegen <luc.verhaegen@basyskom.de>
2010-11-26 18:01:06 +02:00
Bill Nottingham
566d09a5cd xfree86: store the screen's gamma information on init.
This fixes a gamma issue on vt switch observed with KDM. VT switching away
and back would result in a black screen. Avoid this by storing the current
gamma information on init.

https://bugzilla.redhat.com/show_bug.cgi?id=533217

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-11-24 11:35:04 -08:00
Adam Jackson
c050aa2f5f xfree86: apply gamma settings on EnterVT.
When entering the VT, re-apply the saved gamma settings for each screen.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-11-24 11:29:31 -08:00
Keith Packard
4ed4915bc0 Merge remote branch 'whot/for-keith' 2010-11-10 16:58:21 -08:00
Eric Anholt
f36153e3ef Replace usage of DamageRegionAppend with DamageDamageRegion to fix reportAfter.
In all these cases, any rendering implied by this damage has already
occurred, and we want to get the damage out to the client.  Some of
the DamageRegionAppend calls were explicitly telling damage to flush
the reportAfter damage out, but not all.

Bug #30260. Fixes the compiz wallpaper plugin with client damage
changed to reportAfter.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-11-10 15:51:03 -08:00
Cyril Brulebois
b142b0d274 Remove more superfluous if(p!=NULL) checks around free(p).
This patch has been generated by the following Coccinelle semantic patch:

@@
expression E;
@@
- if (E != NULL)
-   free(E);
+ free(E);

Signed-off-by: Cyril Brulebois <kibi@debian.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-11-11 08:29:54 +10:00
Adam Jackson
b2f9ce201c edid: Fix the HDTV sync pulse adjustment
Simple typo, should have been adjusting the horizontal timings
consistently since we're not trying to mangle vertical at all.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Patrick E. Kane <pekane52@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-10-05 08:19:25 -07:00
Chris Wilson
5c6a2f93eb xfree86: Kill pixmapPrivate with a vengeance (v2)
ScrnInfo->pixmapPrivate only existed in order to catch invalid access to
the framebuffer by making the backing data NULL across the VT switch.
This was causing more confusion in the higher layers during mode setting
without any real benefit, so remove it.

v2: Kill ShadowModifyPixmapHeader() as well.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Julien Cristau <jcristau@debian.org>
Cc: Andrew Guertin <lists@dolphinling.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-09-28 08:07:21 -07:00
Chris Wilson
fdabcec57a modes: Beware the driver switching root pixmaps
Program received signal SIGSEGV, Segmentation fault.
0x080d4a2d in xf86RandR12ScreenSetSize (pScreen=0x8dca3a0, width=800,
    height=600, mmWidth=210, mmHeight=157)
    at ../../../../hw/xfree86/modes/xf86RandR12.c:731
731     ../../../../hw/xfree86/modes/xf86RandR12.c: No such file or directory.
        in ../../../../hw/xfree86/modes/xf86RandR12.c
(gdb) bt full
    height=600, mmWidth=210, mmHeight=157)
    at ../../../../hw/xfree86/modes/xf86RandR12.c:731
        randrp = 0x8dcae68
        pScrn = 0x8dbeb28
        config = <value optimized out>
        pRoot = 0x8e08e30
        pScrnPix = 0xb6d12008
        ret = 1
        c = <value optimized out>
    mmWidth=210, mmHeight=157) at ../../randr/rrscreen.c:185
No locals.
    at ../../randr/rrscreen.c:307
        pWin = 0x8e08e30
        pScreen = 0x8dca3a0
        i = <value optimized out>
        rc = 0
../../randr/randr.c:485

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Julien Cristau <jcristau@debian.org>
Tested-by: Julien Cristau <jcristau@debian.org>
Cc: Keith Packard <keithp@keithp.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-09-28 08:07:21 -07:00
Jamey Sharp
e4d4d6ddd5 Xserver need not be compatible with old versions of xserver.
Delete time-traveling multiple personality disorder from the server.

Gaetan notes:

    There were a couple of drivers containing an unknown version of the
    modes/parser code. This was done in server 1.2 time frame because it
    was released without mode code. It was barely or not maintained
    afterwards. There are currently no video drivers with a copy of the
    modes code.

Most of these ifdefs were introduced in commit
a8d760f567, where Aaron wrote,

    This change uses XORG_VERSION_CURRENT < 7.0 to mean "server newer
    than 1.2" since XORG_VERSION current went backwards at some point.

Alan explains that:

    In Xorg 1.3, when we first released an Xorg server release decoupled
    from the katamari release schedule.  (1.0 through 1.2 were released
    as part of X11R7.0 through 7.2, while 1.3 came out between X11R7.2 &
    7.3.)

Commit by Jamey Sharp and Josh Triplett.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2010-09-18 11:17:18 +02:00
Ville Syrjälä
390a8466dd xfree86/modes: Allow the driver to specify initial rotation
When the "Rotate" option isn't specified allow the driver to specify
the initial rotation mode. This way the driver can choose to retain
the same settings that were used by software that was used prior to
starting X.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-30 08:47:22 -07:00
Dave Airlie
80d1a548d6 rotation: fix cursor and overlap of one pixel.
Commit 77c7a64e88 was introduced to fix
a cursor off by one on Intel hw, however it also move the whole crtc
into an off by one position and you could see gnom-eshell overlapping.

This commit reverts that and instead fixes the cursor hotspot
translation to work like pixman does. We add 0.5 to the cursor vector
before translating, and floor the value afterwards.

Thanks to Soeren (ssp) for pointing out where the real problem was
after explaning how pixman translates points.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-22 11:38:30 -07:00
Keith Packard
68a9ee8370 Clean up RandR12 bits on screen close (bug 27114)
When resetting the server, pScrn->EnterVT must be unwrapped or the
next server generation will end up wrapping the wrapper and causing an
infinite recursion on EnterVT.

Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Michael Stapelberg <michael+freedesktop@stapelberg.de>
2010-06-15 14:39:25 -07:00
Matt Turner
f4190feb25 Remove more superfluous if(p) checks around free(p)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-06-11 19:05:46 +07:00
Mikhail Gusarov
7287ef9e6c Remove unnecessary parentheses around return values in functions
This patch was generated by the following Perl code:

perl -i -pe 's/([^_])return\s*\(\s*([^(]+?)\s*\)s*;(\s+(\n))?/$1return $2;$4/g;'

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-10 06:42:42 -07:00
Ben Skeggs
f7af00e9f0 randr: prevent an unnecessary screen resize with multiple displays
crtc->{x,y} is always 0 when xf86DefaultScreenLimits() is called, so we
calculate too small an area for the initial framebuffer and force a resize
to happen.

This commit fixes the code to use desired{X,Y} instead, which contains the
initial output positions.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-07 19:59:38 -07:00
Mikhail Gusarov
0a4d8cbdcd Remove more superfluous if(p) checks around free(p)
This patch has been generated by the following Coccinelle semantic patch:

@@
expression E;
@@

-if(E) { free(E); }
+free(E);

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-06-06 20:27:18 +07:00
Keith Packard
faeebead7b Change the devPrivates API to require dixRegisterPrivateKey
This patch only changes the API, not the implementation of the
devPrivates infrastructure. This will permit a new devPrivates
implementation to be layed into the server without requiring
simultaneous changes in every devPrivates user.

Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-06-05 19:23:03 -07:00
Keith Packard
2dc138922b Rename region macros to eliminate screen argument
This is a combination of a huge mechanical patch and a few small
fixups required to finish the job. They were reviewed separately, but
because the server does not build without both pieces, I've merged
them together at this time.

The mechanical changes were performed by running the included
'fix-region' script over the whole tree:

$ git ls-files | grep -v '^fix-' | xargs ./fix-region

And then, the white space errors in the resulting patch were fixed
using the provided fix-patch-whitespace script.

$ sh ./fix-patch-whitespace

Thanks to Jamey Sharp for the mighty fine sed-generating sed script.

The hand-done changes involve removing functions from dix/region.c
that duplicate inline functions in include/regionstr.h, along with
their declarations in regionstr.h, mi.h and mispans.h.

Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05 18:59:00 -07:00
Jamey Sharp
e7fae9ecc4 Move each screen's root-window pointer into ScreenRec.
Many references to the WindowTable array already had the corresponding
screen pointer handy, which meant they usually looked like
"WindowTable[pScreen->myNum]". Adding a field to ScreenRec instead of
keeping this information in a parallel array simplifies those
expressions, and eliminates a MAXSCREENS-sized array.

Since dix uses this data, a screen private entry isn't appropriate.

xf86-video-dummy currently uses WindowTable, so it needs to be updated
to reflect this change.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03 14:03:23 -07:00
Dave Airlie
5939e39a64 xf86: allow for no outputs connected at startup operation.
When nothing is connected at startup and we canGrow, allow the server to start with a 1024x768 framebuffer, and when the drivers send hotplug events this will expand to the correct size dynamically.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-23 17:30:09 -07:00
Simon Farnsworth
cfc6291488 Add configuration option to disable default modes on an output
Setting 'Option "DefaultModes" "No"' in an output will guarantee that
X will omit the default modes, just picking up modes from the
configuration file and modes provided by the output.

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-20 09:15:41 -07:00
Mikhail Gusarov
3f3ff971ec Replace X-allocation functions with their C89 counterparts
The only remaining X-functions used in server are XNF*, the rest is converted to
plain alloc/calloc/realloc/free/strdup.

X* functions are still exported from server and x* macros are still defined in
header file, so both ABI and API are not affected by this change.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13 00:22:37 +07:00
Cyril Brulebois
fa6c701257 Fix null pointer dereference in xf86_reload_cursors().
Upon resume, X may try to dereference a null pointer, which has been
reported in Debian bug #507916 (http://bugs.debian.org/507916).

Jim Paris came up with a patch which solves the problem for him. Here's
a (hopefully) fixed version of his patch (without the typo).

Cc: Jim Paris <jim@jtan.com>
Signed-off-by: Cyril Brulebois <kibi@debian.org>
Reviewed-By: Matthias Hopf <mhopf@suse.de>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-11 08:35:28 -07:00
Adam Jackson
ffaae7c0c6 Remove mibank support
Banked framebuffers are so 1990.  As of 7.4 the only drivers remaining
that used this were chips, neomagic, trident, and vesa.  vesa only used
it when not using shadowfb, which is broadly undesirable anyway, and no
longer uses it at all as of 2.3.0.  neomagic never used it by default,
and support for it is gone in git master.  The other two effectively
only ever used it for ISA chips; since ISA support is now gone from
the server, they have been modified to only compile mibank support when
ISA support is available.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-27 11:14:03 -07:00
Keith Packard
28b7b2b8d0 unifdef -B -DRENDER to always include RENDER code
This patch was created with:

git ls-files '*.[ch]' | while read f; do unifdef -B -DRENDER -o $f $f; done

Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-19 09:26:10 -07:00
Roland Scheidegger
75efb46a14 hw/xfree86: fix refcounting in xf86_use_hw_cursor
This is the same fix as was done in
fcdc1d78cc for xf86_use_hw_cursor_argb.

Signed-off-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-03-15 08:36:33 -07:00
Keith Packard
de86a3a344 Allow for missing or disabled compat_output
When the compat output is missing (I don't think this is actually
possible), or is disabled (and hence has no crtc), we would like to
avoid dereferencing NULL pointers. This patch creates inline functions
to extract the current compat output, crtc or associated RandR crtc
structure, carefully checking for NULL pointers everywhere.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-02-25 12:48:27 -08:00
Keith Packard
fbbadca7e8 Share enum definition for det_monrec_parameter sync_source
There were two separate enum definitions, one inside
det_monrec_parameter struct and one for a local variable (which was then
stored inside the struct). Sharing a single definition makes the
code more obviously correct while making the compiler happier.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-02-25 12:48:06 -08:00
Simon Farnsworth
93ff1bc588 Always enable outputs that have been forced on in the configuration file
If the user has gone to the effort of manually enabling an output in
the configuration file assume that they know what they're doing.

X.org Bug 14611 <http://bugs.freedesktop.org/show_bug.cgi?id=14611>

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-02-22 13:28:40 -08:00
Michael Vogt
1e6fd65d0b xfree86/modes: only call gamma_set if its non NULL
I ran accross a crash with xf86-video-nv-2.1.15 [1] and xserver
1.7.3.901. It looks like the problem is that gamma_set is called even
if that is NULL.

[1] https://launchpad.net/bugs/494627

Reviewed-By: Matthias Hopf <mhopf@suse.de>
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-27 14:10:48 -08:00
Peter Hutterer
faca1bc582 xfree86: belately init RandR12 if xinerama fails. (#24627)
On Fri, Dec 11, 2009 at 10:19:01AM -0800, Keith Packard wrote:
> On Wed, 9 Dec 2009 11:55:14 +1000, Peter Hutterer <peter.hutterer@who-t.net> wrote:
> > On Tue, Dec 08, 2009 at 05:24:06PM -0800, Aaron Plattner wrote:
> > > On Tue, Dec 08, 2009 at 03:52:27PM -0800, Peter Hutterer wrote:
> > > > Xorg +xinerama crashes immediately due to whacky dependency between Xinerama
> > > > and RandR12. The latter doesn't initialize if Xinerama is enabled, but if
> > > > only one screen is found, Xinerama is disabled again and RandR12 tries to
> > > > access data it never initialized.
>
> I'd sure like to have RandR get enabled when xinerama doesn't; is there
> an easy way of making that happen here? Perhaps having the RandR12 code
> disable Xinerama when only one screen is found? Or some other kludge?

you know the dependency better than I do so any hints are apreciated.
afaict, the screenInfo.numScreens (the check used by Xinerama) isn't
necessarily initialized at this point so we can't use the same check.
The following seems to work though:

From 670b3ebdb7312a6433a8f093d0820785db2aea20 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Mon, 14 Dec 2009 11:00:58 +1000
Subject: [PATCH] xfree86: if only one screen was found, disable Xinerama (#24627)

Xorg +xinerama crashes immediately due to whacky dependency between Xinerama
and RandR12. The latter doesn't initialize if Xinerama is enabled, but if
only one screen is found, Xinerama is disabled again and RandR12 tries to
access data it never initialized.

Dependency chain is:
- ProcessCommandLine sets noPanoramiXExtension to FALSE
- xf86RandR12Init() is a noop
- PanoramiXExtensionInit sets noPanoramiXExtension to TRUE
- xf86RandR12CreateScreenResources tries to use the devPrivates key it never
  initialized.

This hack checks if there's only one screen at the time RandR12 is
initialized. If so, we expect Xinerama to fail anyhow so we disable it
ourselves and proceed as planned.

X.Org Bug 24627 <http://bugs.freedesktop.org/show_bug.cgi?id=24627>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-16 21:50:00 -08:00
Zhao Yakui
19f7c15e20 xfree86: Edid quirk for Philips LCD LP154W01
v1->v2: Make one condition case for one quirk instead of merging them
together. This is based on the Keithp's suggestion.

Move the EDID quirk for Philips LCD LP154W01 as the panel reports the vertical
size in cm.

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

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-20 07:21:26 -08:00
Adam Jackson
a5e59230de randr: Turn on ModeDebug during server setup
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-06 06:24:10 -08:00
Adam Jackson
ec98d7fc78 EDID: Extend the HDTV hack to handle "1368x769"
Hate televisions so much.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2009-10-29 14:06:00 -04:00
Adam Jackson
7c0803f555 modes: Fix duplicate detection, and do it more consistently
Signed-off-by: Adam Jackson <ajax@redhat.com>
2009-10-29 14:06:00 -04:00
Adam Jackson
25236d19e6 EDID: Fix interlaced detailed timings to be frame size, not field size
Signed-off-by: Adam Jackson <ajax@redhat.com>
2009-10-29 14:06:00 -04:00
Adam Jackson
fb86433d89 modes: Decorate interlaced mode names with a trailing 'i'
Signed-off-by: Adam Jackson <ajax@redhat.com>
2009-10-29 14:06:00 -04:00
Ma Ling
fc2ec95664 EDID: CEA extension support
Reviewed-by: Adam Jackson <ajax@redhat.com>
2009-10-29 14:04:55 -04:00
Tormod Volden
757c11630d xfree86: Fix description of DDC_QUIRK_DETAILED_USE_MAXIMUM_SIZE
The message ending up in the log is misleading as to what the quirk
actually does: It ignores the sizes in the detailed timings and
replaces them with the display "Max Image Size".

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-28 15:57:21 -07:00
Dave Airlie
3ebb82d61c rotate: drop unwrapping inside block handler.
Keith has shown half the block handlers wrappers are wrong, also
dynamic wrapping/unwrapping from what I can see will happen after
the drivers, so its really accidental ABI, that we can't change
now without modifing drivers. So be safe for 1.7.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Declared-as-sane-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-10-02 12:15:58 +10:00
Keith Packard
db98b26ee1 Re-fix DGA removal.
Removing DGA ended up breaking any drivers calling into the old
xf86DiDGAInit function as it tried to see if DGA was already enabled
and ended up crashing if the VT wasn't completely initialized. Oops.

Also, if the driver initializes DGA itself, have the DiDGA
initialization overwrite that information as the DiDGA code will call
ReInit on mode detect.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-10-01 11:02:25 +10:00
Peter Hutterer
83023ffd09 xfree86: use the DDC size if either width or height of DisplaySize is bogus.
If either width or height of DisplaySize is invalid, assume that the
configuration is invalid and use the DDC-reported values instead.

See Comment 9, Bug 9758.
http://bugs.freedesktop.org/show_bug.cgi?id=9758#c9

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Dave Airlie <airlied@redhat.com>
2009-09-28 14:51:39 +10:00
Keith Packard
fcdc1d78cc Fix sporadic segfault on resume due to accidentally freeing cursor.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-22 11:38:22 +10:00
Matthias Hopf
91e1fe5863 Revert fe31f9c + 977953b to fix issue for good.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-22 11:38:17 +10:00
Matthias Hopf
977953bf14 Less intrusive workaround for sporadic segfault on resume.
Hopefully fixes fdo #24010 (memleak).
2009-09-21 16:41:49 +02:00
Keith Packard
0b7c6c728c xfree86/modes: Remove all framebuffer support from DGA
This removes all rendering and mapping code from xf86DiDGA, leaving
just mode setting and raw input device access. The mapping code didn't
have the offset within /dev/mem for the frame buffer and the pixmap
support assumed that the framebuffer was never reallocated.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-21 16:20:25 +10:00
Keith Packard
6086a60656 xf8CrtcSetModeTransform: free adjusted_mode name too
The adjusted mode was freed, but any name allocated for that was leaked.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-20 20:45:25 +10:00
Matthias Hopf
3bdf364761 Work around sporadic segfault on resume with intel/KMS due to cursor->bits == NULL.
Apparently SavedCursor is sometime tried to be set while already being set.
2009-09-16 16:05:36 +02:00
Peter Hutterer
72f6be5408 xfree86: remove now unused xf86CrtcShadowClear
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-09 11:36:37 +10:00
Adam Jackson
17545ed80e randr: Fix crtcs using set_mode_major()
We'd never mark the crtc as active, meaning (among other things) gamma
upload wouldn't work.
2009-09-02 14:40:07 -04:00
Keith Packard
e7dd1efef4 Ensure that rotation updates happen frequently
The smart scheduler is designed to minimize scheduler overhead by
increasing the interval between WaitForSomething calls when a single
client is running. However, the software rotation code depends on
its BlockHandler being invoked for screen updates; the long delays
caused by the smart scheduler optimizations means that screen updates
can be delayed a long time as well.

The change is simple -- prevent the smart scheduler from increasing
the scheduling interval while any screen is using software rotation.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-08-25 18:14:19 -07:00
Keith Packard
1740cda7a3 Perform rotation redisplay before calling driver block handler (which may flush rendering)
The rotation block handler uses regular driver rendering functions to
repaint the screen, if those functions queue commands in the driver,
it's important that the driver block handler be invoked after the
rotated image is drawn.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-08-25 18:14:19 -07:00
Keith Packard
4aab05e3b3 xf86_reload_cursors: fix cursor position to eliminate jumping after mode set
xf86_reload_cursors restores the cursor to the correct position, but
that must adjust for cursor hot spot and frame before calling down to
the hardware function, otherwise the cursor jumps to the wrong
position until it is repositioned by the user.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-08-25 18:14:19 -07:00
Michel Dänzer
9dc8106ba0 randr12: Add compatibility for XF86VidMode gamma ramps.
Fixes screensaver fadeout effects.

Also make all RandR 1.2 compatibility code for XF86VidMode operate only on the
CRTC associated with the compatibility output, not all CRTCs at once.
2009-07-21 14:34:47 +02:00
Adam Jackson
a98acb2907 s/xf86EnableOutputs/xf86CollectEnabledOutputs/ for clarity 2009-07-17 15:23:39 -04:00
Adam Jackson
8fab7f72f2 randr: Add Option "Primary" to Monitor sections 2009-07-17 15:23:30 -04:00
Adam Jackson
8868bb4131 randr: Un-duplicate the reduced blanking check. 2009-07-17 15:03:56 -04:00
Adam Jackson
453ee39bc6 xfree86: Fix some misleading comments 2009-07-17 15:03:56 -04:00
Adam Jackson
0bb9a7e165 displayid: Implement mode decoding. 2009-07-17 14:48:55 -04:00
Adam Jackson
2f1a9c5baa ddc: s/xf86DDCMonitorSet/xf86EdidMonitorSet/
Since we need a second path for DisplayID.
2009-07-17 13:42:57 -04:00