2003-11-14 17:48:57 +01:00
|
|
|
/***********************************************************
|
|
|
|
Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts,
|
|
|
|
and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
|
|
|
|
|
|
|
|
All Rights Reserved
|
|
|
|
|
2014-10-31 00:45:12 +01:00
|
|
|
Permission to use, copy, modify, and distribute this software and its
|
|
|
|
documentation for any purpose and without fee is hereby granted,
|
2003-11-14 17:48:57 +01:00
|
|
|
provided that the above copyright notice appear in all copies and that
|
2014-10-31 00:45:12 +01:00
|
|
|
both that copyright notice and this permission notice appear in
|
2003-11-14 17:48:57 +01:00
|
|
|
supporting documentation, and that the names of Digital or MIT not be
|
|
|
|
used in advertising or publicity pertaining to distribution of the
|
2014-10-31 00:45:12 +01:00
|
|
|
software without specific, written prior permission.
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
|
|
|
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
|
|
|
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
|
|
|
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
|
|
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
|
|
|
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|
|
|
SOFTWARE.
|
|
|
|
|
|
|
|
******************************************************************/
|
|
|
|
|
|
|
|
/*
|
2014-10-31 00:45:12 +01:00
|
|
|
** File:
|
2003-11-14 17:48:57 +01:00
|
|
|
**
|
|
|
|
** xvmain.c --- Xv server extension main device independent module.
|
2014-10-31 00:45:12 +01:00
|
|
|
**
|
|
|
|
** Author:
|
2003-11-14 17:48:57 +01:00
|
|
|
**
|
|
|
|
** David Carver (Digital Workstation Engineering/Project Athena)
|
|
|
|
**
|
|
|
|
** Revisions:
|
|
|
|
**
|
|
|
|
** 04.09.91 Carver
|
|
|
|
** - change: stop video always generates an event even when video
|
|
|
|
** wasn't active
|
|
|
|
**
|
|
|
|
** 29.08.91 Carver
|
|
|
|
** - change: unrealizing windows no longer preempts video
|
|
|
|
**
|
|
|
|
** 11.06.91 Carver
|
|
|
|
** - changed SetPortControl to SetPortAttribute
|
|
|
|
** - changed GetPortControl to GetPortAttribute
|
|
|
|
** - changed QueryBestSize
|
|
|
|
**
|
|
|
|
** 28.05.91 Carver
|
|
|
|
** - fixed Put and Get requests to not preempt operations to same drawable
|
|
|
|
**
|
|
|
|
** 15.05.91 Carver
|
|
|
|
** - version 2.0 upgrade
|
|
|
|
**
|
|
|
|
** 19.03.91 Carver
|
|
|
|
** - fixed Put and Get requests to honor grabbed ports.
|
|
|
|
** - fixed Video requests to update di structure with new drawable, and
|
|
|
|
** client after calling ddx.
|
|
|
|
**
|
|
|
|
** 24.01.91 Carver
|
|
|
|
** - version 1.4 upgrade
|
2014-10-31 00:45:12 +01:00
|
|
|
**
|
2003-11-14 17:48:57 +01:00
|
|
|
** Notes:
|
|
|
|
**
|
|
|
|
** Port structures reference client structures in a two different
|
|
|
|
** ways: when grabs, or video is active. Each reference is encoded
|
|
|
|
** as fake client resources and thus when the client is goes away so
|
|
|
|
** does the reference (it is zeroed). No other action is taken, so
|
|
|
|
** video doesn't necessarily stop. It probably will as a result of
|
|
|
|
** other resources going away, but if a client starts video using
|
|
|
|
** none of its own resources, then the video will continue to play
|
|
|
|
** after the client disappears.
|
|
|
|
**
|
|
|
|
**
|
|
|
|
*/
|
|
|
|
|
2005-07-03 09:02:09 +02:00
|
|
|
#ifdef HAVE_DIX_CONFIG_H
|
|
|
|
#include <dix-config.h>
|
|
|
|
#endif
|
|
|
|
|
2006-02-10 23:00:30 +01:00
|
|
|
#include <string.h>
|
|
|
|
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/X.h>
|
|
|
|
#include <X11/Xproto.h>
|
2005-07-03 10:53:54 +02:00
|
|
|
#include "misc.h"
|
|
|
|
#include "os.h"
|
2003-11-14 17:48:57 +01:00
|
|
|
#include "scrnintstr.h"
|
|
|
|
#include "windowstr.h"
|
|
|
|
#include "pixmapstr.h"
|
|
|
|
#include "gc.h"
|
|
|
|
#include "extnsionst.h"
|
2012-07-10 03:02:56 +02:00
|
|
|
#include "extinit.h"
|
2003-11-14 17:48:57 +01:00
|
|
|
#include "dixstruct.h"
|
|
|
|
#include "resource.h"
|
|
|
|
#include "opaque.h"
|
|
|
|
#include "input.h"
|
|
|
|
|
|
|
|
#define GLOBAL
|
|
|
|
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/extensions/Xv.h>
|
|
|
|
#include <X11/extensions/Xvproto.h>
|
2003-11-14 17:48:57 +01:00
|
|
|
#include "xvdix.h"
|
|
|
|
|
|
|
|
#ifdef PANORAMIX
|
|
|
|
#include "panoramiX.h"
|
|
|
|
#include "panoramiXsrv.h"
|
|
|
|
#endif
|
2007-12-02 20:15:36 +01:00
|
|
|
#include "xvdisp.h"
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2010-04-27 02:22:21 +02:00
|
|
|
static DevPrivateKeyRec XvScreenKeyRec;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2010-04-27 02:22:21 +02:00
|
|
|
#define XvScreenKey (&XvScreenKeyRec)
|
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 08:43:34 +01:00
|
|
|
unsigned long XvExtensionGeneration = 0;
|
|
|
|
unsigned long XvScreenGeneration = 0;
|
|
|
|
unsigned long XvResourceGeneration = 0;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
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 08:43:34 +01:00
|
|
|
int XvReqCode;
|
|
|
|
int XvEventBase;
|
|
|
|
int XvErrorBase;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2011-02-28 22:25:23 +01:00
|
|
|
RESTYPE XvRTPort;
|
|
|
|
RESTYPE XvRTEncoding;
|
|
|
|
RESTYPE XvRTGrab;
|
|
|
|
RESTYPE XvRTVideoNotify;
|
|
|
|
RESTYPE XvRTVideoNotifyList;
|
|
|
|
RESTYPE XvRTPortNotify;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
/* EXTERNAL */
|
|
|
|
|
|
|
|
static void WriteSwappedVideoNotifyEvent(xvEvent *, xvEvent *);
|
|
|
|
static void WriteSwappedPortNotifyEvent(xvEvent *, xvEvent *);
|
|
|
|
static Bool CreateResourceTypes(void);
|
|
|
|
|
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 14:22:18 +02:00
|
|
|
static Bool XvCloseScreen(ScreenPtr);
|
2003-11-14 17:48:57 +01:00
|
|
|
static Bool XvDestroyPixmap(PixmapPtr);
|
|
|
|
static Bool XvDestroyWindow(WindowPtr);
|
2012-03-21 20:55:09 +01:00
|
|
|
static void XvResetProc(ExtensionEntry *);
|
2013-12-15 10:05:51 +01:00
|
|
|
static int XvdiDestroyGrab(void *, XID);
|
|
|
|
static int XvdiDestroyEncoding(void *, XID);
|
|
|
|
static int XvdiDestroyVideoNotify(void *, XID);
|
|
|
|
static int XvdiDestroyPortNotify(void *, XID);
|
|
|
|
static int XvdiDestroyVideoNotifyList(void *, XID);
|
|
|
|
static int XvdiDestroyPort(void *, XID);
|
2003-11-14 17:48:57 +01:00
|
|
|
static int XvdiSendVideoNotify(XvPortPtr, DrawablePtr, int);
|
|
|
|
|
|
|
|
/*
|
|
|
|
** XvExtensionInit
|
|
|
|
**
|
|
|
|
**
|
|
|
|
*/
|
|
|
|
|
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 08:43:34 +01:00
|
|
|
void
|
2007-04-09 23:33:15 +02:00
|
|
|
XvExtensionInit(void)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
ExtensionEntry *extEntry;
|
|
|
|
|
|
|
|
if (!dixRegisterPrivateKey(&XvScreenKeyRec, PRIVATE_SCREEN, 0))
|
|
|
|
return;
|
|
|
|
|
2012-02-27 09:50:46 +01:00
|
|
|
/* Look to see if any screens were initialized; if not then
|
|
|
|
init global variables so the extension can function */
|
2012-03-21 20:55:09 +01:00
|
|
|
if (XvScreenGeneration != serverGeneration) {
|
|
|
|
if (!CreateResourceTypes()) {
|
|
|
|
ErrorF("XvExtensionInit: Unable to allocate resource types\n");
|
|
|
|
return;
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
#ifdef PANORAMIX
|
|
|
|
XineramaRegisterConnectionBlockCallback(XineramifyXv);
|
|
|
|
#endif
|
2012-03-21 20:55:09 +01:00
|
|
|
XvScreenGeneration = serverGeneration;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (XvExtensionGeneration != serverGeneration) {
|
|
|
|
XvExtensionGeneration = serverGeneration;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
extEntry = AddExtension(XvName, XvNumEvents, XvNumErrors,
|
|
|
|
ProcXvDispatch, SProcXvDispatch,
|
|
|
|
XvResetProc, StandardMinorOpcode);
|
|
|
|
if (!extEntry) {
|
|
|
|
FatalError("XvExtensionInit: AddExtensions failed\n");
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
XvReqCode = extEntry->base;
|
|
|
|
XvEventBase = extEntry->eventBase;
|
|
|
|
XvErrorBase = extEntry->errorBase;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
EventSwapVector[XvEventBase + XvVideoNotify] =
|
|
|
|
(EventSwapPtr) WriteSwappedVideoNotifyEvent;
|
|
|
|
EventSwapVector[XvEventBase + XvPortNotify] =
|
|
|
|
(EventSwapPtr) WriteSwappedPortNotifyEvent;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
SetResourceTypeErrorValue(XvRTPort, _XvBadPort);
|
|
|
|
(void) MakeAtom(XvName, strlen(XvName), xTrue);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
2007-04-09 23:33:15 +02:00
|
|
|
CreateResourceTypes(void)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (XvResourceGeneration == serverGeneration)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
XvResourceGeneration = serverGeneration;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!(XvRTPort = CreateNewResourceType(XvdiDestroyPort, "XvRTPort"))) {
|
|
|
|
ErrorF("CreateResourceTypes: failed to allocate port resource.\n");
|
|
|
|
return FALSE;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2009-12-11 09:58:25 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!(XvRTGrab = CreateNewResourceType(XvdiDestroyGrab, "XvRTGrab"))) {
|
|
|
|
ErrorF("CreateResourceTypes: failed to allocate grab resource.\n");
|
|
|
|
return FALSE;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2009-12-11 09:58:25 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!(XvRTEncoding = CreateNewResourceType(XvdiDestroyEncoding,
|
|
|
|
"XvRTEncoding"))) {
|
|
|
|
ErrorF("CreateResourceTypes: failed to allocate encoding resource.\n");
|
|
|
|
return FALSE;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2009-12-11 09:58:25 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!(XvRTVideoNotify = CreateNewResourceType(XvdiDestroyVideoNotify,
|
|
|
|
"XvRTVideoNotify"))) {
|
|
|
|
ErrorF
|
|
|
|
("CreateResourceTypes: failed to allocate video notify resource.\n");
|
|
|
|
return FALSE;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2009-12-11 09:58:25 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!
|
|
|
|
(XvRTVideoNotifyList =
|
|
|
|
CreateNewResourceType(XvdiDestroyVideoNotifyList,
|
|
|
|
"XvRTVideoNotifyList"))) {
|
|
|
|
ErrorF
|
|
|
|
("CreateResourceTypes: failed to allocate video notify list resource.\n");
|
|
|
|
return FALSE;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!(XvRTPortNotify = CreateNewResourceType(XvdiDestroyPortNotify,
|
|
|
|
"XvRTPortNotify"))) {
|
|
|
|
ErrorF
|
|
|
|
("CreateResourceTypes: failed to allocate port notify resource.\n");
|
|
|
|
return FALSE;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
return TRUE;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
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 08:43:34 +01:00
|
|
|
int
|
2003-11-14 17:48:57 +01:00
|
|
|
XvScreenInit(ScreenPtr pScreen)
|
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
XvScreenPtr pxvs;
|
|
|
|
|
|
|
|
if (XvScreenGeneration != serverGeneration) {
|
|
|
|
if (!CreateResourceTypes()) {
|
|
|
|
ErrorF("XvScreenInit: Unable to allocate resource types\n");
|
|
|
|
return BadAlloc;
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
#ifdef PANORAMIX
|
|
|
|
XineramaRegisterConnectionBlockCallback(XineramifyXv);
|
|
|
|
#endif
|
2012-03-21 20:55:09 +01:00
|
|
|
XvScreenGeneration = serverGeneration;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!dixRegisterPrivateKey(&XvScreenKeyRec, PRIVATE_SCREEN, 0))
|
|
|
|
return BadAlloc;
|
2010-04-27 02:22:21 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (dixLookupPrivate(&pScreen->devPrivates, XvScreenKey)) {
|
|
|
|
ErrorF("XvScreenInit: screen devPrivates ptr non-NULL before init\n");
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
/* ALLOCATE SCREEN PRIVATE RECORD */
|
|
|
|
|
|
|
|
pxvs = malloc(sizeof(XvScreenRec));
|
|
|
|
if (!pxvs) {
|
|
|
|
ErrorF("XvScreenInit: Unable to allocate screen private structure\n");
|
|
|
|
return BadAlloc;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
dixSetPrivate(&pScreen->devPrivates, XvScreenKey, pxvs);
|
|
|
|
|
|
|
|
pxvs->DestroyPixmap = pScreen->DestroyPixmap;
|
|
|
|
pxvs->DestroyWindow = pScreen->DestroyWindow;
|
|
|
|
pxvs->CloseScreen = pScreen->CloseScreen;
|
|
|
|
|
|
|
|
pScreen->DestroyPixmap = XvDestroyPixmap;
|
|
|
|
pScreen->DestroyWindow = XvDestroyWindow;
|
|
|
|
pScreen->CloseScreen = XvCloseScreen;
|
|
|
|
|
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
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 14:22:18 +02:00
|
|
|
XvCloseScreen(ScreenPtr pScreen)
|
2012-03-21 20:55:09 +01:00
|
|
|
{
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
XvScreenPtr pxvs;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XvScreenKey);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pScreen->DestroyPixmap = pxvs->DestroyPixmap;
|
|
|
|
pScreen->DestroyWindow = pxvs->DestroyWindow;
|
|
|
|
pScreen->CloseScreen = pxvs->CloseScreen;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
free(pxvs);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
dixSetPrivate(&pScreen->devPrivates, XvScreenKey, NULL);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
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 14:22:18 +02:00
|
|
|
return (*pScreen->CloseScreen) (pScreen);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
XvResetProc(ExtensionEntry * extEntry)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2007-12-02 20:15:36 +01:00
|
|
|
XvResetProcVector();
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
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 08:43:34 +01:00
|
|
|
DevPrivateKey
|
2007-08-28 15:28:25 +02:00
|
|
|
XvGetScreenKey(void)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2007-08-28 15:28:25 +02:00
|
|
|
return XvScreenKey;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
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 08:43:34 +01:00
|
|
|
unsigned long
|
2007-04-09 23:33:15 +02:00
|
|
|
XvGetRTPort(void)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
return XvRTPort;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
|
|
|
XvDestroyPixmap(PixmapPtr pPix)
|
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
Bool status;
|
|
|
|
ScreenPtr pScreen;
|
|
|
|
XvScreenPtr pxvs;
|
|
|
|
XvAdaptorPtr pa;
|
|
|
|
int na;
|
|
|
|
XvPortPtr pp;
|
|
|
|
int np;
|
|
|
|
|
|
|
|
pScreen = pPix->drawable.pScreen;
|
|
|
|
|
|
|
|
SCREEN_PROLOGUE(pScreen, DestroyPixmap);
|
|
|
|
|
|
|
|
pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XvScreenKey);
|
|
|
|
|
|
|
|
/* CHECK TO SEE IF THIS PORT IS IN USE */
|
|
|
|
|
|
|
|
pa = pxvs->pAdaptors;
|
|
|
|
na = pxvs->nAdaptors;
|
|
|
|
while (na--) {
|
|
|
|
np = pa->nPorts;
|
|
|
|
pp = pa->pPorts;
|
|
|
|
|
|
|
|
while (np--) {
|
|
|
|
if (pp->pDraw == (DrawablePtr) pPix) {
|
|
|
|
XvdiSendVideoNotify(pp, pp->pDraw, XvPreempted);
|
|
|
|
|
2014-07-31 06:11:51 +02:00
|
|
|
(void) (*pp->pAdaptor->ddStopVideo) (pp, pp->pDraw);
|
2012-03-21 20:55:09 +01:00
|
|
|
|
|
|
|
pp->pDraw = NULL;
|
|
|
|
pp->client = NULL;
|
|
|
|
pp->time = currentTime;
|
|
|
|
}
|
|
|
|
pp++;
|
|
|
|
}
|
|
|
|
pa++;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
status = (*pScreen->DestroyPixmap) (pPix);
|
|
|
|
|
|
|
|
SCREEN_EPILOGUE(pScreen, DestroyPixmap, XvDestroyPixmap);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
return status;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
|
|
|
XvDestroyWindow(WindowPtr pWin)
|
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
Bool status;
|
|
|
|
ScreenPtr pScreen;
|
|
|
|
XvScreenPtr pxvs;
|
|
|
|
XvAdaptorPtr pa;
|
|
|
|
int na;
|
|
|
|
XvPortPtr pp;
|
|
|
|
int np;
|
|
|
|
|
|
|
|
pScreen = pWin->drawable.pScreen;
|
|
|
|
|
|
|
|
SCREEN_PROLOGUE(pScreen, DestroyWindow);
|
|
|
|
|
|
|
|
pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XvScreenKey);
|
|
|
|
|
|
|
|
/* CHECK TO SEE IF THIS PORT IS IN USE */
|
|
|
|
|
|
|
|
pa = pxvs->pAdaptors;
|
|
|
|
na = pxvs->nAdaptors;
|
|
|
|
while (na--) {
|
|
|
|
np = pa->nPorts;
|
|
|
|
pp = pa->pPorts;
|
|
|
|
|
|
|
|
while (np--) {
|
|
|
|
if (pp->pDraw == (DrawablePtr) pWin) {
|
|
|
|
XvdiSendVideoNotify(pp, pp->pDraw, XvPreempted);
|
|
|
|
|
2014-07-31 06:11:51 +02:00
|
|
|
(void) (*pp->pAdaptor->ddStopVideo) (pp, pp->pDraw);
|
2012-03-21 20:55:09 +01:00
|
|
|
|
|
|
|
pp->pDraw = NULL;
|
|
|
|
pp->client = NULL;
|
|
|
|
pp->time = currentTime;
|
|
|
|
}
|
|
|
|
pp++;
|
|
|
|
}
|
|
|
|
pa++;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
status = (*pScreen->DestroyWindow) (pWin);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
SCREEN_EPILOGUE(pScreen, DestroyWindow, XvDestroyWindow);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
return status;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
static int
|
2013-12-15 10:05:51 +01:00
|
|
|
XvdiDestroyPort(void *pPort, XID id)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2014-04-05 11:55:45 +02:00
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2013-12-15 10:05:51 +01:00
|
|
|
XvdiDestroyGrab(void *pGrab, XID id)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
((XvGrabPtr) pGrab)->client = NULL;
|
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2013-12-15 10:05:51 +01:00
|
|
|
XvdiDestroyVideoNotify(void *pn, XID id)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
/* JUST CLEAR OUT THE client POINTER FIELD */
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
((XvVideoNotifyPtr) pn)->client = NULL;
|
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2013-12-15 10:05:51 +01:00
|
|
|
XvdiDestroyPortNotify(void *pn, XID id)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
/* JUST CLEAR OUT THE client POINTER FIELD */
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
((XvPortNotifyPtr) pn)->client = NULL;
|
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2013-12-15 10:05:51 +01:00
|
|
|
XvdiDestroyVideoNotifyList(void *pn, XID id)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
XvVideoNotifyPtr npn, cpn;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
/* ACTUALLY DESTROY THE NOTITY LIST */
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
cpn = (XvVideoNotifyPtr) pn;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
while (cpn) {
|
|
|
|
npn = cpn->next;
|
|
|
|
if (cpn->client)
|
|
|
|
FreeResource(cpn->id, XvRTVideoNotify);
|
|
|
|
free(cpn);
|
|
|
|
cpn = npn;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2013-12-15 10:05:51 +01:00
|
|
|
XvdiDestroyEncoding(void *value, XID id)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2009-01-11 08:16:12 +01:00
|
|
|
XvdiSendVideoNotify(XvPortPtr pPort, DrawablePtr pDraw, int reason)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
XvVideoNotifyPtr pn;
|
|
|
|
|
2013-12-15 10:05:51 +01:00
|
|
|
dixLookupResourceByType((void **) &pn, pDraw->id, XvRTVideoNotifyList,
|
2012-03-21 20:55:09 +01:00
|
|
|
serverClient, DixReadAccess);
|
|
|
|
|
|
|
|
while (pn) {
|
2012-07-10 04:12:44 +02:00
|
|
|
xvEvent event = {
|
|
|
|
.u.videoNotify.reason = reason,
|
|
|
|
.u.videoNotify.time = currentTime.milliseconds,
|
|
|
|
.u.videoNotify.drawable = pDraw->id,
|
|
|
|
.u.videoNotify.port = pPort->id
|
|
|
|
};
|
2012-03-21 20:55:09 +01:00
|
|
|
event.u.u.type = XvEventBase + XvVideoNotify;
|
2012-07-10 04:12:44 +02:00
|
|
|
WriteEventsToClient(pn->client, 1, (xEventPtr) &event);
|
2012-03-21 20:55:09 +01:00
|
|
|
pn = pn->next;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
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 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
XvdiSendPortNotify(XvPortPtr pPort, Atom attribute, INT32 value)
|
|
|
|
{
|
|
|
|
XvPortNotifyPtr pn;
|
|
|
|
|
|
|
|
pn = pPort->pNotify;
|
|
|
|
|
|
|
|
while (pn) {
|
2012-07-10 04:12:44 +02:00
|
|
|
xvEvent event = {
|
|
|
|
.u.portNotify.time = currentTime.milliseconds,
|
|
|
|
.u.portNotify.port = pPort->id,
|
|
|
|
.u.portNotify.attribute = attribute,
|
|
|
|
.u.portNotify.value = value
|
|
|
|
};
|
2012-03-21 20:55:09 +01:00
|
|
|
event.u.u.type = XvEventBase + XvPortNotify;
|
2012-07-10 04:12:44 +02:00
|
|
|
WriteEventsToClient(pn->client, 1, (xEventPtr) &event);
|
2012-03-21 20:55:09 +01:00
|
|
|
pn = pn->next;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
#define CHECK_SIZE(dw, dh, sw, sh) { \
|
|
|
|
if(!dw || !dh || !sw || !sh) return Success; \
|
|
|
|
/* The region code will break these if they are too large */ \
|
|
|
|
if((dw > 32767) || (dh > 32767) || (sw > 32767) || (sh > 32767)) \
|
|
|
|
return BadValue; \
|
|
|
|
}
|
|
|
|
|
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 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
XvdiPutVideo(ClientPtr client,
|
|
|
|
DrawablePtr pDraw,
|
|
|
|
XvPortPtr pPort,
|
|
|
|
GCPtr pGC,
|
|
|
|
INT16 vid_x, INT16 vid_y,
|
|
|
|
CARD16 vid_w, CARD16 vid_h,
|
|
|
|
INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h)
|
|
|
|
{
|
|
|
|
DrawablePtr pOldDraw;
|
|
|
|
|
|
|
|
CHECK_SIZE(drw_w, drw_h, vid_w, vid_h);
|
|
|
|
|
|
|
|
/* UPDATE TIME VARIABLES FOR USE IN EVENTS */
|
|
|
|
|
|
|
|
UpdateCurrentTime();
|
|
|
|
|
|
|
|
/* CHECK FOR GRAB; IF THIS CLIENT DOESN'T HAVE THE PORT GRABBED THEN
|
|
|
|
INFORM CLIENT OF ITS FAILURE */
|
|
|
|
|
|
|
|
if (pPort->grab.client && (pPort->grab.client != client)) {
|
|
|
|
XvdiSendVideoNotify(pPort, pDraw, XvBusy);
|
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
/* CHECK TO SEE IF PORT IS IN USE; IF SO THEN WE MUST DELIVER INTERRUPTED
|
|
|
|
EVENTS TO ANY CLIENTS WHO WANT THEM */
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pOldDraw = pPort->pDraw;
|
|
|
|
if ((pOldDraw) && (pOldDraw != pDraw)) {
|
|
|
|
XvdiSendVideoNotify(pPort, pPort->pDraw, XvPreempted);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2014-07-31 06:11:51 +02:00
|
|
|
(void) (*pPort->pAdaptor->ddPutVideo) (pDraw, pPort, pGC,
|
2012-03-21 20:55:09 +01:00
|
|
|
vid_x, vid_y, vid_w, vid_h,
|
|
|
|
drw_x, drw_y, drw_w, drw_h);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if ((pPort->pDraw) && (pOldDraw != pDraw)) {
|
|
|
|
pPort->client = client;
|
|
|
|
XvdiSendVideoNotify(pPort, pPort->pDraw, XvStarted);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pPort->time = currentTime;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
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 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
XvdiPutStill(ClientPtr client,
|
|
|
|
DrawablePtr pDraw,
|
|
|
|
XvPortPtr pPort,
|
|
|
|
GCPtr pGC,
|
|
|
|
INT16 vid_x, INT16 vid_y,
|
|
|
|
CARD16 vid_w, CARD16 vid_h,
|
|
|
|
INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h)
|
|
|
|
{
|
|
|
|
int status;
|
|
|
|
|
|
|
|
CHECK_SIZE(drw_w, drw_h, vid_w, vid_h);
|
|
|
|
|
|
|
|
/* UPDATE TIME VARIABLES FOR USE IN EVENTS */
|
|
|
|
|
|
|
|
UpdateCurrentTime();
|
|
|
|
|
|
|
|
/* CHECK FOR GRAB; IF THIS CLIENT DOESN'T HAVE THE PORT GRABBED THEN
|
|
|
|
INFORM CLIENT OF ITS FAILURE */
|
|
|
|
|
|
|
|
if (pPort->grab.client && (pPort->grab.client != client)) {
|
|
|
|
XvdiSendVideoNotify(pPort, pDraw, XvBusy);
|
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pPort->time = currentTime;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2014-07-31 06:11:51 +02:00
|
|
|
status = (*pPort->pAdaptor->ddPutStill) (pDraw, pPort, pGC,
|
2012-03-21 20:55:09 +01:00
|
|
|
vid_x, vid_y, vid_w, vid_h,
|
|
|
|
drw_x, drw_y, drw_w, drw_h);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
return status;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
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 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
XvdiPutImage(ClientPtr client,
|
|
|
|
DrawablePtr pDraw,
|
|
|
|
XvPortPtr pPort,
|
|
|
|
GCPtr pGC,
|
|
|
|
INT16 src_x, INT16 src_y,
|
|
|
|
CARD16 src_w, CARD16 src_h,
|
|
|
|
INT16 drw_x, INT16 drw_y,
|
|
|
|
CARD16 drw_w, CARD16 drw_h,
|
|
|
|
XvImagePtr image,
|
|
|
|
unsigned char *data, Bool sync, CARD16 width, CARD16 height)
|
|
|
|
{
|
|
|
|
CHECK_SIZE(drw_w, drw_h, src_w, src_h);
|
|
|
|
|
|
|
|
/* UPDATE TIME VARIABLES FOR USE IN EVENTS */
|
|
|
|
|
|
|
|
UpdateCurrentTime();
|
|
|
|
|
|
|
|
/* CHECK FOR GRAB; IF THIS CLIENT DOESN'T HAVE THE PORT GRABBED THEN
|
|
|
|
INFORM CLIENT OF ITS FAILURE */
|
|
|
|
|
|
|
|
if (pPort->grab.client && (pPort->grab.client != client)) {
|
|
|
|
XvdiSendVideoNotify(pPort, pDraw, XvBusy);
|
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pPort->time = currentTime;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2014-07-31 06:11:51 +02:00
|
|
|
return (*pPort->pAdaptor->ddPutImage) (pDraw, pPort, pGC,
|
2012-03-21 20:55:09 +01:00
|
|
|
src_x, src_y, src_w, src_h,
|
|
|
|
drw_x, drw_y, drw_w, drw_h,
|
|
|
|
image, data, sync, width, height);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
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 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
XvdiGetVideo(ClientPtr client,
|
|
|
|
DrawablePtr pDraw,
|
|
|
|
XvPortPtr pPort,
|
|
|
|
GCPtr pGC,
|
|
|
|
INT16 vid_x, INT16 vid_y,
|
|
|
|
CARD16 vid_w, CARD16 vid_h,
|
|
|
|
INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h)
|
|
|
|
{
|
|
|
|
DrawablePtr pOldDraw;
|
|
|
|
|
|
|
|
CHECK_SIZE(drw_w, drw_h, vid_w, vid_h);
|
|
|
|
|
|
|
|
/* UPDATE TIME VARIABLES FOR USE IN EVENTS */
|
|
|
|
|
|
|
|
UpdateCurrentTime();
|
|
|
|
|
|
|
|
/* CHECK FOR GRAB; IF THIS CLIENT DOESN'T HAVE THE PORT GRABBED THEN
|
|
|
|
INFORM CLIENT OF ITS FAILURE */
|
|
|
|
|
|
|
|
if (pPort->grab.client && (pPort->grab.client != client)) {
|
|
|
|
XvdiSendVideoNotify(pPort, pDraw, XvBusy);
|
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
/* CHECK TO SEE IF PORT IS IN USE; IF SO THEN WE MUST DELIVER INTERRUPTED
|
|
|
|
EVENTS TO ANY CLIENTS WHO WANT THEM */
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pOldDraw = pPort->pDraw;
|
|
|
|
if ((pOldDraw) && (pOldDraw != pDraw)) {
|
|
|
|
XvdiSendVideoNotify(pPort, pPort->pDraw, XvPreempted);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2014-07-31 06:11:51 +02:00
|
|
|
(void) (*pPort->pAdaptor->ddGetVideo) (pDraw, pPort, pGC,
|
2012-03-21 20:55:09 +01:00
|
|
|
vid_x, vid_y, vid_w, vid_h,
|
|
|
|
drw_x, drw_y, drw_w, drw_h);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if ((pPort->pDraw) && (pOldDraw != pDraw)) {
|
|
|
|
pPort->client = client;
|
|
|
|
XvdiSendVideoNotify(pPort, pPort->pDraw, XvStarted);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pPort->time = currentTime;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
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 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
XvdiGetStill(ClientPtr client,
|
|
|
|
DrawablePtr pDraw,
|
|
|
|
XvPortPtr pPort,
|
|
|
|
GCPtr pGC,
|
|
|
|
INT16 vid_x, INT16 vid_y,
|
|
|
|
CARD16 vid_w, CARD16 vid_h,
|
|
|
|
INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h)
|
|
|
|
{
|
|
|
|
int status;
|
|
|
|
|
|
|
|
CHECK_SIZE(drw_w, drw_h, vid_w, vid_h);
|
|
|
|
|
|
|
|
/* UPDATE TIME VARIABLES FOR USE IN EVENTS */
|
|
|
|
|
|
|
|
UpdateCurrentTime();
|
|
|
|
|
|
|
|
/* CHECK FOR GRAB; IF THIS CLIENT DOESN'T HAVE THE PORT GRABBED THEN
|
|
|
|
INFORM CLIENT OF ITS FAILURE */
|
|
|
|
|
|
|
|
if (pPort->grab.client && (pPort->grab.client != client)) {
|
|
|
|
XvdiSendVideoNotify(pPort, pDraw, XvBusy);
|
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2014-07-31 06:11:51 +02:00
|
|
|
status = (*pPort->pAdaptor->ddGetStill) (pDraw, pPort, pGC,
|
2012-03-21 20:55:09 +01:00
|
|
|
vid_x, vid_y, vid_w, vid_h,
|
|
|
|
drw_x, drw_y, drw_w, drw_h);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pPort->time = currentTime;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
return status;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
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 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
XvdiGrabPort(ClientPtr client, XvPortPtr pPort, Time ctime, int *p_result)
|
|
|
|
{
|
|
|
|
unsigned long id;
|
|
|
|
TimeStamp time;
|
|
|
|
|
|
|
|
UpdateCurrentTime();
|
|
|
|
time = ClientTimeToServerTime(ctime);
|
|
|
|
|
|
|
|
if (pPort->grab.client && (client != pPort->grab.client)) {
|
|
|
|
*p_result = XvAlreadyGrabbed;
|
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if ((CompareTimeStamps(time, currentTime) == LATER) ||
|
|
|
|
(CompareTimeStamps(time, pPort->time) == EARLIER)) {
|
|
|
|
*p_result = XvInvalidTime;
|
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (client == pPort->grab.client) {
|
|
|
|
*p_result = Success;
|
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
id = FakeClientID(client->index);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!AddResource(id, XvRTGrab, &pPort->grab)) {
|
|
|
|
return BadAlloc;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
/* IF THERE IS ACTIVE VIDEO THEN STOP IT */
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if ((pPort->pDraw) && (client != pPort->client)) {
|
|
|
|
XvdiStopVideo(NULL, pPort, pPort->pDraw);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pPort->grab.client = client;
|
|
|
|
pPort->grab.id = id;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pPort->time = currentTime;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
*p_result = Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
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 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
XvdiUngrabPort(ClientPtr client, XvPortPtr pPort, Time ctime)
|
|
|
|
{
|
|
|
|
TimeStamp time;
|
|
|
|
|
|
|
|
UpdateCurrentTime();
|
|
|
|
time = ClientTimeToServerTime(ctime);
|
|
|
|
|
|
|
|
if ((!pPort->grab.client) || (client != pPort->grab.client)) {
|
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if ((CompareTimeStamps(time, currentTime) == LATER) ||
|
|
|
|
(CompareTimeStamps(time, pPort->time) == EARLIER)) {
|
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
/* FREE THE GRAB RESOURCE; AND SET THE GRAB CLIENT TO NULL */
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
FreeResource(pPort->grab.id, XvRTGrab);
|
|
|
|
pPort->grab.client = NULL;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pPort->time = currentTime;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
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 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
XvdiSelectVideoNotify(ClientPtr client, DrawablePtr pDraw, BOOL onoff)
|
|
|
|
{
|
|
|
|
XvVideoNotifyPtr pn, tpn, fpn;
|
|
|
|
int rc;
|
|
|
|
|
|
|
|
/* FIND VideoNotify LIST */
|
|
|
|
|
2013-12-15 10:05:51 +01:00
|
|
|
rc = dixLookupResourceByType((void **) &pn, pDraw->id,
|
2012-03-21 20:55:09 +01:00
|
|
|
XvRTVideoNotifyList, client, DixWriteAccess);
|
|
|
|
if (rc != Success && rc != BadValue)
|
|
|
|
return rc;
|
|
|
|
|
|
|
|
/* IF ONE DONES'T EXIST AND NO MASK, THEN JUST RETURN */
|
|
|
|
|
|
|
|
if (!onoff && !pn)
|
|
|
|
return Success;
|
|
|
|
|
|
|
|
/* IF ONE DOESN'T EXIST CREATE IT AND ADD A RESOURCE SO THAT THE LIST
|
|
|
|
WILL BE DELETED WHEN THE DRAWABLE IS DESTROYED */
|
|
|
|
|
|
|
|
if (!pn) {
|
|
|
|
if (!(tpn = malloc(sizeof(XvVideoNotifyRec))))
|
|
|
|
return BadAlloc;
|
|
|
|
tpn->next = NULL;
|
|
|
|
if (!AddResource(pDraw->id, XvRTVideoNotifyList, tpn)) {
|
|
|
|
free(tpn);
|
|
|
|
return BadAlloc;
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
else {
|
|
|
|
/* LOOK TO SEE IF ENTRY ALREADY EXISTS */
|
|
|
|
|
|
|
|
fpn = NULL;
|
|
|
|
tpn = pn;
|
|
|
|
while (tpn) {
|
|
|
|
if (tpn->client == client) {
|
|
|
|
if (!onoff)
|
|
|
|
tpn->client = NULL;
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
if (!tpn->client)
|
|
|
|
fpn = tpn; /* TAKE NOTE OF FREE ENTRY */
|
|
|
|
tpn = tpn->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* IF TUNNING OFF, THEN JUST RETURN */
|
|
|
|
|
|
|
|
if (!onoff)
|
|
|
|
return Success;
|
|
|
|
|
|
|
|
/* IF ONE ISN'T FOUND THEN ALLOCATE ONE AND LINK IT INTO THE LIST */
|
|
|
|
|
|
|
|
if (fpn) {
|
|
|
|
tpn = fpn;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (!(tpn = malloc(sizeof(XvVideoNotifyRec))))
|
|
|
|
return BadAlloc;
|
|
|
|
tpn->next = pn->next;
|
|
|
|
pn->next = tpn;
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
/* INIT CLIENT PTR IN CASE WE CAN'T ADD RESOURCE */
|
|
|
|
/* ADD RESOURCE SO THAT IF CLIENT EXITS THE CLIENT PTR WILL BE CLEARED */
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
tpn->client = NULL;
|
|
|
|
tpn->id = FakeClientID(client->index);
|
|
|
|
AddResource(tpn->id, XvRTVideoNotify, tpn);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
tpn->client = client;
|
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
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 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
XvdiSelectPortNotify(ClientPtr client, XvPortPtr pPort, BOOL onoff)
|
|
|
|
{
|
|
|
|
XvPortNotifyPtr pn, tpn;
|
|
|
|
|
|
|
|
/* SEE IF CLIENT IS ALREADY IN LIST */
|
|
|
|
|
|
|
|
tpn = NULL;
|
|
|
|
pn = pPort->pNotify;
|
|
|
|
while (pn) {
|
|
|
|
if (!pn->client)
|
|
|
|
tpn = pn; /* TAKE NOTE OF FREE ENTRY */
|
|
|
|
if (pn->client == client)
|
|
|
|
break;
|
|
|
|
pn = pn->next;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
/* IS THE CLIENT ALREADY ON THE LIST? */
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (pn) {
|
|
|
|
/* REMOVE IT? */
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!onoff) {
|
|
|
|
pn->client = NULL;
|
|
|
|
FreeResource(pn->id, XvRTPortNotify);
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2014-10-31 00:45:12 +01:00
|
|
|
/* DIDN'T FIND IT; SO REUSE LIST ELEMENT IF ONE IS FREE OTHERWISE
|
2012-03-21 20:55:09 +01:00
|
|
|
CREATE A NEW ONE AND ADD IT TO THE BEGINNING OF THE LIST */
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!tpn) {
|
|
|
|
if (!(tpn = malloc(sizeof(XvPortNotifyRec))))
|
|
|
|
return BadAlloc;
|
|
|
|
tpn->next = pPort->pNotify;
|
|
|
|
pPort->pNotify = tpn;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
tpn->client = client;
|
|
|
|
tpn->id = FakeClientID(client->index);
|
|
|
|
AddResource(tpn->id, XvRTPortNotify, tpn);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
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 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
XvdiStopVideo(ClientPtr client, XvPortPtr pPort, DrawablePtr pDraw)
|
|
|
|
{
|
|
|
|
int status;
|
|
|
|
|
|
|
|
/* IF PORT ISN'T ACTIVE THEN WE'RE DONE */
|
|
|
|
|
|
|
|
if (!pPort->pDraw || (pPort->pDraw != pDraw)) {
|
|
|
|
XvdiSendVideoNotify(pPort, pDraw, XvStopped);
|
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
/* CHECK FOR GRAB; IF THIS CLIENT DOESN'T HAVE THE PORT GRABBED THEN
|
|
|
|
INFORM CLIENT OF ITS FAILURE */
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if ((client) && (pPort->grab.client) && (pPort->grab.client != client)) {
|
|
|
|
XvdiSendVideoNotify(pPort, pDraw, XvBusy);
|
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
XvdiSendVideoNotify(pPort, pDraw, XvStopped);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2014-07-31 06:11:51 +02:00
|
|
|
status = (*pPort->pAdaptor->ddStopVideo) (pPort, pDraw);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pPort->pDraw = NULL;
|
|
|
|
pPort->client = (ClientPtr) client;
|
|
|
|
pPort->time = currentTime;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
return status;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
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 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
XvdiMatchPort(XvPortPtr pPort, DrawablePtr pDraw)
|
|
|
|
{
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
XvAdaptorPtr pa;
|
|
|
|
XvFormatPtr pf;
|
|
|
|
int nf;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pa = pPort->pAdaptor;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (pa->pScreen != pDraw->pScreen)
|
|
|
|
return BadMatch;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
nf = pa->nFormats;
|
|
|
|
pf = pa->pFormats;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
while (nf--) {
|
|
|
|
if (pf->depth == pDraw->depth)
|
|
|
|
return Success;
|
|
|
|
pf++;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
return BadMatch;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
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 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
XvdiSetPortAttribute(ClientPtr client,
|
|
|
|
XvPortPtr pPort, Atom attribute, INT32 value)
|
|
|
|
{
|
|
|
|
int status;
|
|
|
|
|
|
|
|
status =
|
2014-07-31 06:11:51 +02:00
|
|
|
(*pPort->pAdaptor->ddSetPortAttribute) (pPort, attribute,
|
2012-03-21 20:55:09 +01:00
|
|
|
value);
|
|
|
|
if (status == Success)
|
|
|
|
XvdiSendPortNotify(pPort, attribute, value);
|
|
|
|
|
|
|
|
return status;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
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 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
XvdiGetPortAttribute(ClientPtr client,
|
|
|
|
XvPortPtr pPort, Atom attribute, INT32 *p_value)
|
|
|
|
{
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
return
|
2014-07-31 06:11:51 +02:00
|
|
|
(*pPort->pAdaptor->ddGetPortAttribute) (pPort, attribute,
|
2012-03-21 20:55:09 +01:00
|
|
|
p_value);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
WriteSwappedVideoNotifyEvent(xvEvent * from, xvEvent * to)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
to->u.u.type = from->u.u.type;
|
|
|
|
to->u.u.detail = from->u.u.detail;
|
|
|
|
cpswaps(from->u.videoNotify.sequenceNumber,
|
|
|
|
to->u.videoNotify.sequenceNumber);
|
|
|
|
cpswapl(from->u.videoNotify.time, to->u.videoNotify.time);
|
|
|
|
cpswapl(from->u.videoNotify.drawable, to->u.videoNotify.drawable);
|
|
|
|
cpswapl(from->u.videoNotify.port, to->u.videoNotify.port);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
WriteSwappedPortNotifyEvent(xvEvent * from, xvEvent * to)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
to->u.u.type = from->u.u.type;
|
|
|
|
to->u.u.detail = from->u.u.detail;
|
|
|
|
cpswaps(from->u.portNotify.sequenceNumber, to->u.portNotify.sequenceNumber);
|
|
|
|
cpswapl(from->u.portNotify.time, to->u.portNotify.time);
|
|
|
|
cpswapl(from->u.portNotify.port, to->u.portNotify.port);
|
|
|
|
cpswapl(from->u.portNotify.value, to->u.portNotify.value);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
}
|
2013-12-28 06:54:26 +01:00
|
|
|
|
|
|
|
void
|
|
|
|
XvFreeAdaptor(XvAdaptorPtr pAdaptor)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
free(pAdaptor->name);
|
|
|
|
pAdaptor->name = NULL;
|
|
|
|
|
|
|
|
if (pAdaptor->pEncodings) {
|
|
|
|
XvEncodingPtr pEncode = pAdaptor->pEncodings;
|
|
|
|
|
|
|
|
for (i = 0; i < pAdaptor->nEncodings; i++, pEncode++)
|
|
|
|
free(pEncode->name);
|
|
|
|
free(pAdaptor->pEncodings);
|
|
|
|
pAdaptor->pEncodings = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
free(pAdaptor->pFormats);
|
|
|
|
pAdaptor->pFormats = NULL;
|
|
|
|
|
|
|
|
free(pAdaptor->pPorts);
|
|
|
|
pAdaptor->pPorts = NULL;
|
|
|
|
|
|
|
|
if (pAdaptor->pAttributes) {
|
|
|
|
XvAttributePtr pAttribute = pAdaptor->pAttributes;
|
|
|
|
|
|
|
|
for (i = 0; i < pAdaptor->nAttributes; i++, pAttribute++)
|
|
|
|
free(pAttribute->name);
|
|
|
|
free(pAdaptor->pAttributes);
|
|
|
|
pAdaptor->pAttributes = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
free(pAdaptor->pImages);
|
|
|
|
pAdaptor->pImages = NULL;
|
|
|
|
|
|
|
|
free(pAdaptor->devPriv.ptr);
|
|
|
|
pAdaptor->devPriv.ptr = NULL;
|
|
|
|
}
|
2014-04-05 10:07:18 +02:00
|
|
|
|
|
|
|
void
|
|
|
|
XvFillColorKey(DrawablePtr pDraw, CARD32 key, RegionPtr region)
|
|
|
|
{
|
|
|
|
ScreenPtr pScreen = pDraw->pScreen;
|
|
|
|
ChangeGCVal pval[2];
|
|
|
|
BoxPtr pbox = RegionRects(region);
|
|
|
|
int i, nbox = RegionNumRects(region);
|
|
|
|
xRectangle *rects;
|
|
|
|
GCPtr gc;
|
|
|
|
|
|
|
|
gc = GetScratchGC(pDraw->depth, pScreen);
|
2014-04-05 10:09:17 +02:00
|
|
|
if (!gc)
|
|
|
|
return;
|
|
|
|
|
2014-04-05 10:07:18 +02:00
|
|
|
pval[0].val = key;
|
|
|
|
pval[1].val = IncludeInferiors;
|
|
|
|
(void) ChangeGC(NullClient, gc, GCForeground | GCSubwindowMode, pval);
|
|
|
|
ValidateGC(pDraw, gc);
|
|
|
|
|
|
|
|
rects = malloc(nbox * sizeof(xRectangle));
|
2014-04-05 10:09:17 +02:00
|
|
|
if (rects) {
|
|
|
|
for (i = 0; i < nbox; i++, pbox++) {
|
|
|
|
rects[i].x = pbox->x1 - pDraw->x;
|
|
|
|
rects[i].y = pbox->y1 - pDraw->y;
|
|
|
|
rects[i].width = pbox->x2 - pbox->x1;
|
|
|
|
rects[i].height = pbox->y2 - pbox->y1;
|
|
|
|
}
|
2014-04-05 10:07:18 +02:00
|
|
|
|
2014-04-05 10:09:17 +02:00
|
|
|
(*gc->ops->PolyFillRect) (pDraw, gc, nbox, rects);
|
2014-04-05 10:07:18 +02:00
|
|
|
|
2014-04-05 10:09:17 +02:00
|
|
|
free(rects);
|
|
|
|
}
|
2014-04-05 10:07:18 +02:00
|
|
|
FreeScratchGC(gc);
|
|
|
|
}
|