Commit Graph

104 Commits

Author SHA1 Message Date
Daniel Stone
a1d41e311c Move extension initialisation prototypes into extinit.h
Create extinit.h (and xf86Extensions.h, for Xorg-specific extensions) to
hold all our extension initialisation prototypes, rather than
duplicating them everywhere.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09 23:06:41 -07:00
Dave Airlie
53b66c084f xfree86: add DDX gpu screen support. (v3)
This just adds the structures and interfaces required for adding/deleteing
gpu screens at the DDX level. The platform probe can pass a new flag
to the driver, so they can call xf86AllocateScreen and pass back the new
gpu screen flag.

It also calls the gpu screens preinit and screeninit routines at
startup.

v2: fix delete screen use after free.

v3: split out pScrn into separate patch

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-06 10:35:19 +01:00
Dave Airlie
cf66471353 xfree86: use udev to provide device enumeration for kms devices (v10)
On Linux in order for future hotplug work, we are required to interface
to udev to detect device creation/removal. In order to try and get
some earlier testing on this, this patch adds the ability to use
udev for device enumeration on Linux.

At startup the list of drm/kms devices is probed and this info is
used to load drivers.

A new driver probing method is introduced that passes the udev
device info to the driver for probing.

The probing integrates with the pci probing code and will fallback
to the pci probe and old school probe functions in turn.

The flags parameter to the probe function will be used later
to provide hotplug and gpu screen flags for the driver to behave
in a different way.

This patch changes the driver ABI, all drivers should at least
be set with a NULL udev probe function after this commit.

v2: rename to platform bus, now with 100% less udev specific,

this version passes config_odev_attribs around which are an array
of id/string pairs, then the udev code can attach the set of attribs
it understands, the OS specific code can attach its attrib, and then
the core/drivers can lookup the required attribs.

also add MATCH_PCI_DEVICES macro.

This version is mainly to address concerns raised by ajax.

v3: Address comments from Peter.
fix whitespace that snuck in.
rework to use a linked list with some core functions that
xf86 wraps.

v4: add free list, fix struct whitespace.
ajax this address most of your issues?

v5: drop probe ifdef, fix logic issue

v6: some overhaul after more testing.

Implement primaryBus for platform devices.
document hotplug.h dev attribs - drop sysname attrib
fix build with udev kms disabled
make probing work like the PCI probe code,
   match against bus id if one exists, or primary device.

RFC: add new bus id support "PLAT:syspath". we probably
want to match on this a bit different, or use a different
property maybe. I was mainly wanting this for use with
specifying usb devices in xorg.conf directly, but PLAT:path
could also work I suppose.

v6.1: add missing noop platform function

v7: fix two interactions with pci probing and slot claiming, prevents
pci and platform trying to load two drivers for same slot.

v8: test with zaphod mode on -ati driver, fixup resulting issue
clean up common probe code into another function, change busid
matching to allow dropping end of strings.

v9: fix platform probing logic so it actually works.
v9.1: fix pdev init to NULL properly.

v10: address most of Keith's concerns.

v4 was thanks to Reviewed-by: Adam Jackson <ajax@redhat.com>
v5 was Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-06 10:20:19 +01: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
53932b3803 xf86: add helper functions to convert to from ScrnInfoPtr/ScreenPtr (v2)
These are just simple functions that we should start migrating drivers
to using.

The end goal is to remove xf86Screens and screenInfo from the ABI.

This includes a define XF86_HAS_SCRN_CONV that drivers can ifdef to provide
their own copies. I'll probably post a generic compat.h file for drivers later.

v2: add asserts.

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:58:33 +01:00
Dave Airlie
39f73e813f xf86/pci: fix slot claiming counting.
Currently if we claim a slot for a PCI driver, we never let it go properly,
this prevents the fallback probe from reusing the slot, even though it
isn't claimed for that pci slot.

So if you set the modesetting driver to point at a specific kms device,
that isn't a PCI device (i.e. USB dongle), then the modesetting driver
loads, the pci probe tries to bind the config slot to the primary PCI
device, however we then check the kms device bus id to discover it
isn't valid. However we don't remove the claim on the slot. Next the
old probe function is called and there is no slots to claim.

This patch fixes that and converts the pciSlotClaimed boolean into
a counter, and changes the unclaim api to take a device pointer
to remove from the entity.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-21 12:58:33 +01: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
7801b3dcd6 Add some printf format attributes suggested by gcc
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
b967bf2af2 Remove xf86FormatPciBusNumber from API, inline the one place its used
Found no calls from current driver modules

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:06 -08: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
Adam Jackson
c0b63ff88a xfree86: Move xf86GetClocks to vgahw
This is really a vga-specific hack anyway.  The only modern driver that
uses it is trident, but it's already loaded vgahw by the time it would
call xf86GetClocks.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:45 -07:00
Keith Packard
afb1fe695d Merge remote-tracking branch 'whot/next' 2011-09-26 20:24:15 -07:00
Peter Hutterer
24823f1ab0 xfree86: switch options from pointer to XF86OptionPtr
In all cases, the pointer was simply type-cast anyway. Let's get some
compile-time type safety going, how about that.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>

Squashed in:
xfree86: Move definition of xf86OptionPtr into separate header file

The pile of spaghettis that is the xfree86 include dependencies make it
rather hard to have a single typedef somewhere that's not interfering with
everything else or drags in a whole bunch of other includes.

Move the xf86OptionRec and GenericListRec declarations into a separate
header.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-09-27 11:43:36 +10:00
Jamey Sharp
6ad7bb69ee Remove PC98 support.
Gaetan Nadon wrote:

    Alan Coopersmith wrote:

    "I think we recently dropped PC98 support from the X server, so I'd
    be okay with dropping the documentation now".

Let's make them be right, shall we?

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Acked-by: Gaetan Nadon <memsize@videotron.ca>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-09-15 10:11:43 -05:00
Adam Jackson
ce13a1dbbf xfree86: Remove xf86EnterServerState
Back when we had RAC this was a vaguely meaningful thing.  Since then
it's been a glorified (and confusing) wrapper around xf86BlockSIGIO.

Note that the APM and VT switch code are unusual relative to other code
that cares about SIGIO state.  Most callers push a SIGIO disable to
create a critical section for the duration of the caller's stack frame,
but those two effectively disable SIGIO after their return and re-enable
on their next entry.

Reviewed-by: Tiago Vignatti <tigo.vignatti@nokia.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-12-20 12:14:32 -05:00
Adam Jackson
040d54fb88 xfree86: Remove unused xf86inSuspend
What is this, I don't even.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-12-20 12:09:16 -05:00
Adam Jackson
1b3c57f075 xfree86: Remove unused xf86PixmapKeyRec
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-30 13:46:09 -05:00
Peter Hutterer
9dca441670 xfree86: add a hook to replace the new console handler.
This hook is only necessary for the keyboard driver to remove the race
condition between drain_console() and the driver's ReadInput (Bug 29969).

The idea is that a driver that needs to handle events from the console
calls xf86ReplaceConsoleHandler() with it's own ReadInput (or NULL) and thus
removes the drain_console call. It's the driver's responsibility to restore
the previous behaviour when the driver is unloaded.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
CC: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-09-10 09:09:47 +10: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
Tiago Vignatti
b0eef11018 xfree86: organize and group all pci related stuff inside xf86.h
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2010-05-24 19:31:57 +03:00
Tiago Vignatti
0dd299864a xfree86: remove xf86EnableAccess
It's RAC remnant. This was substituted by xf86VGAarbiter{Lock, Unlock}
mechanism.

It's an API break, but the few drivers using it were covered already with
macros to avoid problems.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19 18:34:35 +03:00
Tiago Vignatti
971768e688 xfree86: bus: enable declaration of sparc function as its code usage
The code in xf86sbusBus.c seems too OS-specific to be usable on OpenBSD.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19 18:34:10 +03:00
Jeremy Huddleston
bca85e2e12 Use _X_ATTRIBUTE_PRINTF _X_DEPRECATED _X_NORETURN
Use the values from xproto rather than duplicating the effort

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-13 10:03:23 -07:00
Tiago Vignatti
79182538b4 xfree86: removal of some dead code due VGA arbiter's inclusion
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2009-08-31 19:25:48 +03:00
Tiago Vignatti
792dee3854 xfree86: remove bus state change notification callback
No one is using bus notifications now. We hope that the kernel take care of
this properly.

For other not-so-urgent-notifications (ACPI wakeups, etc) we can just register
a handler on server's scheduler (using xf86AddGeneralHandler). And for
external applications, the "trend" is to use HAL to kick notifications. So
we're already provided of enough notification schemes.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2009-08-20 13:57:45 +03:00
Tiago Vignatti
c553161e17 xfree86: delete devices probe code (-probe and -probeonly options)
Inside a windowing system, it's not the place to probe for devices. Goodbye
-probe and -probeonly.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2009-07-28 18:20:22 +03:00
Tiago Vignatti
c09779f95a xfree86: delete stupid video driver dump (-modalias option)
Such stupid and ugly way to dump PCI information! Oh boy... Anyway, this
doesn't belong to the X server at all. Go away!

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2009-07-28 18:20:18 +03:00
Dave Airlie
4b42448a23 xserver: remove RAC/resource handling code.
This changes the ABI, but since the video ABI is at 6 already
it should be fine.

driver changes are in the pipeline after this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-07-28 15:14:28 +10:00
Matthias Hopf
43ee8d2ead Unclaim PCI slot if driver probing fails.
Otherwise no subsequent driver will be able to claim this pci slot.
Example for this: fbdev tries to claim, but framebuffer device is not
available. Later on VESA cannot claim the device.
2009-07-06 18:38:26 +02:00
Adam Jackson
71a83d68ab xfree86: Remove loader symbol list ABI stubs
These have been nops since 2006 and functionally void since 7.0.
2009-05-28 15:32:03 -04:00
Adam Jackson
2107becb0c xfree86: Remove unused (and useless) xf86{Add,Delete}ModuleInfo 2009-05-27 17:13:19 -04:00
Adam Jackson
2d0a4fff79 DPMS: Remove unused DPMSGet() 2009-04-03 18:22:20 -04:00
Adam Jackson
fc5e8dc4a2 Unexport xf86SetPriority 2009-03-13 14:00:37 -04:00
Topi Kanerva
c4081fee09 Make DGA optional. 2009-03-04 10:23:10 -05:00
Adam Jackson
db83671519 Revert "Bus: Remove xf86SetAccessFuncs() and related machinery"
This reverts commit 2fe79990e3.

Reminder: nvidia uses this, because other parts of RAC are broken in
worse ways, and it needs to disable that.
2009-02-04 23:27:32 -05:00
Adam Jackson
2fe79990e3 Bus: Remove xf86SetAccessFuncs() and related machinery
Only mga was using this, and even then only behind an ifdef that no one
ever built.  Not a great idea in the first place.
2009-02-04 22:49:37 -05:00
Paulo Cesar Pereira de Andrade
44c8c3cf7d Remove static symbol address tables in hw/xfree86/loader/*sym.{c,h}
Those tables were once used to decide what symbols are visible to
modules, but they were outdated. The only real usage was that, since
it was taking the address of symbols, linkage should fail if the
symbols were not available.
  Now the proper way to make symbols available to modules should
be to use the _X_EXPORT macro, or not compile with hidden symbols,
so that all symbols would be available.
  All symbols in the tables were revised to ensure they are exported,
and only symbols that were not exported are ClientSleepUntil() and
DuplicateModule(), that were not in the sdk for quite some time
already, and should not have any users outside of the X Server
(and/or builtin modules).
2008-12-05 04:26:57 -02:00
Paulo Cesar Pereira de Andrade
49f77fff14 Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.

  This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)

  LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.

  xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 05:43:34 -02:00
Paulo Cesar Pereira de Andrade
fb22d4d928 Remove declarations of symbols that are never defined.
These symbols were removed from the X Server, or never declared.
  One symbol that may need special attention is XkbBuildCoreState(),
that doesn't have a prototype anywhere, but is called from
xkb/xkbEvents.c:XkbFilterEvents(), and also used by the macros
XkbStateFieldFromRec() and XkbGrabStateFromRec() defined in
include/xkbstr.h.
  fb/wfbrename.h also may need some cleanup, as it makes several
"renames" of non existing symbols.
2008-11-30 01:33:20 -02:00
Alan Coopersmith
d5f9a131a2 Fix const-mismatch warnings for DisplayModePtr's
Includes fixes for:
"xf86Config.c", line 2434: warning: argument #1 is incompatible with prototype:
	prototype: pointer to struct _DisplayModeRec: "xf86.h", line 351
	argument : pointer to const struct _DisplayModeRec

"xf86EdidModes.c", line 312: warning: argument #1 is incompatible with prototype:
	prototype: pointer to struct _DisplayModeRec: "../../../hw/xfree86/common/xf86.h", line 351
	argument : pointer to const struct _DisplayModeRec

"xf86EdidModes.c", line 438: warning: assignment type mismatch:
	pointer to struct _DisplayModeRec "=" pointer to const struct _DisplayModeRec

"xf86Modes.c", line 701: warning: assignment type mismatch:
	pointer to struct _DisplayModeRec "=" pointer to const struct _DisplayModeRec
2008-11-25 15:51:17 -08:00
Adam Jackson
df14682a31 Bus: Remove ISA support.
No, really.  PCI is old enough to drive now.  If you want this, get the kernel
to expose a framebuffer device.
2008-11-24 23:40:06 -05:00
Stefan Dirsch
f6e01fa1b8 Added '-showopts' option to print available driver options (#5564). 2008-11-23 11:16:03 +01:00
Nathaniel McCallum
8e368cf5b9 Xorg: add -modalias option
This scans the installed video drivers and prints a Linux-style modalias
listing of the devices each driver claims to support.
2008-10-14 09:50:29 -04:00
Aaron Plattner
3fc4f40b6c Restore xf86{Enable, Disable}GeneralHandler.
These were useful as part of the generic handler ABI, and are used by the NVIDIA
driver.

This reverts part of commit 50081d2dfb.
2008-10-12 16:08:26 -07:00
Aaron Plattner
2217d22a76 Revert "xfree86: xf86{Enable, Disable}InputHandler can be static."
These were potentially useful as part of the input handler ABI, even if nobody
currently uses them.

This reverts commit 278c11f01f.
2008-10-12 16:07:24 -07:00
Tiago Vignatti
278c11f01f xfree86: xf86{Enable, Disable}InputHandler can be static. 2008-10-08 01:18:49 -03:00
Tiago Vignatti
50081d2dfb xfree86: remove xf86{Enable, Disable}GeneralHandler and others unused. 2008-10-08 01:11:38 -03:00
Aaron Plattner
b574365fca Revert "Unexport (and unimplement) xf86SetAccessFuncs" for now.
The nvidia driver currently uses these hooks to work around problems where RAC
will disable access to the hardware at unexpected times.  This change restores
these hooks until we can come up with a better API for working around RAC.

This reverts commit c1df4fbede.
2008-10-07 13:09:11 -07:00
Aaron Plattner
fe85ec34ec Revert "Remove unused server state change callbackery" for now.
The nvidia driver currently uses these callbacks to work around problems where
RAC will disable access to the hardware at unexpected times.  This change
restores these hooks until we can come up with a better API for working around
RAC.

This reverts commit d7c0ba2e9e.

Conflicts:

	hw/xfree86/loader/xf86sym.c
2008-10-07 13:08:38 -07:00