2005-12-28 11:37:17 +01:00
|
|
|
/*
|
|
|
|
* Copyright © 2003 Keith Packard
|
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, distribute, and sell this software and its
|
|
|
|
* documentation for any purpose is hereby granted without fee, provided that
|
|
|
|
* the above copyright notice appear in all copies and that both that
|
|
|
|
* copyright notice and this permission notice appear in supporting
|
|
|
|
* documentation, and that the name of Keith Packard not be used in
|
|
|
|
* advertising or publicity pertaining to distribution of the software without
|
|
|
|
* specific, written prior permission. Keith Packard makes no
|
|
|
|
* representations about the suitability of this software for any purpose. It
|
|
|
|
* is provided "as is" without express or implied warranty.
|
|
|
|
*
|
|
|
|
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
|
|
|
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
|
|
|
* EVENT SHALL KEITH PACKARD 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _SHMINT_H_
|
|
|
|
#define _SHMINT_H_
|
|
|
|
|
2009-07-15 08:51:05 +02:00
|
|
|
#include <X11/extensions/shmproto.h>
|
2005-12-28 11:37:17 +01:00
|
|
|
|
|
|
|
#include "screenint.h"
|
|
|
|
#include "pixmap.h"
|
|
|
|
#include "gc.h"
|
|
|
|
|
2009-07-15 08:51:05 +02:00
|
|
|
#define XSHM_PUT_IMAGE_ARGS \
|
|
|
|
DrawablePtr /* dst */, \
|
|
|
|
GCPtr /* pGC */, \
|
|
|
|
int /* depth */, \
|
|
|
|
unsigned int /* format */, \
|
|
|
|
int /* w */, \
|
|
|
|
int /* h */, \
|
|
|
|
int /* sx */, \
|
|
|
|
int /* sy */, \
|
|
|
|
int /* sw */, \
|
|
|
|
int /* sh */, \
|
|
|
|
int /* dx */, \
|
|
|
|
int /* dy */, \
|
2012-03-21 20:55:09 +01:00
|
|
|
char * /* data */
|
2009-07-15 08:51:05 +02:00
|
|
|
|
|
|
|
#define XSHM_CREATE_PIXMAP_ARGS \
|
|
|
|
ScreenPtr /* pScreen */, \
|
|
|
|
int /* width */, \
|
|
|
|
int /* height */, \
|
|
|
|
int /* depth */, \
|
2012-03-21 20:55:09 +01:00
|
|
|
char * /* addr */
|
2009-07-15 08:51:05 +02:00
|
|
|
|
|
|
|
typedef struct _ShmFuncs {
|
2012-03-21 20:55:09 +01:00
|
|
|
PixmapPtr (*CreatePixmap) (XSHM_CREATE_PIXMAP_ARGS);
|
|
|
|
void (*PutImage) (XSHM_PUT_IMAGE_ARGS);
|
2009-07-15 08:51:05 +02:00
|
|
|
} ShmFuncs, *ShmFuncsPtr;
|
|
|
|
|
2013-11-12 23:01:45 +01:00
|
|
|
#if XTRANS_SEND_FDS
|
2013-11-03 19:08:15 +01:00
|
|
|
#define SHM_FD_PASSING 1
|
|
|
|
#endif
|
|
|
|
|
2013-01-19 06:43:40 +01:00
|
|
|
typedef struct _ShmDesc {
|
|
|
|
struct _ShmDesc *next;
|
|
|
|
int shmid;
|
|
|
|
int refcnt;
|
|
|
|
char *addr;
|
|
|
|
Bool writable;
|
|
|
|
unsigned long size;
|
2013-11-03 19:08:15 +01:00
|
|
|
#ifdef SHM_FD_PASSING
|
|
|
|
Bool is_fd;
|
2013-11-03 22:12:40 +01:00
|
|
|
struct busfault *busfault;
|
2013-11-03 19:08:15 +01:00
|
|
|
XID resource;
|
|
|
|
#endif
|
2013-01-19 06:43:40 +01:00
|
|
|
} ShmDescRec, *ShmDescPtr;
|
|
|
|
|
2013-11-03 19:08:15 +01:00
|
|
|
#ifdef SHM_FD_PASSING
|
|
|
|
#define SHMDESC_IS_FD(shmdesc) ((shmdesc)->is_fd)
|
|
|
|
#else
|
|
|
|
#define SHMDESC_IS_FD(shmdesc) (0)
|
|
|
|
#endif
|
|
|
|
|
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
|
|
|
extern _X_EXPORT void
|
2012-03-21 20:55:09 +01:00
|
|
|
ShmRegisterFuncs(ScreenPtr pScreen, ShmFuncsPtr funcs);
|
2005-12-28 11:37:17 +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
|
|
|
extern _X_EXPORT void
|
2012-03-21 20:55:09 +01:00
|
|
|
ShmRegisterFbFuncs(ScreenPtr pScreen);
|
2005-12-28 11:37:17 +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
|
|
|
extern _X_EXPORT RESTYPE ShmSegType;
|
|
|
|
extern _X_EXPORT int ShmCompletionCode;
|
|
|
|
extern _X_EXPORT int BadShmSegCode;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
#endif /* _SHMINT_H_ */
|