summaryrefslogtreecommitdiff
authorZhenyu Wang <zhenyu.z.wang@intel.com>2007-10-08 08:13:26 (GMT)
committer Zhenyu Wang <zhenyu.z.wang@intel.com>2007-10-08 08:13:26 (GMT)
commitfd97edb62463e50a1860290d54684a68d5490bdc (patch)
tree9bb896cb727f60d24d9a2dd1a74c568036204de7
parent3a2b5222341b37322b788e329c2b9006dc14ecfd (diff)
downloadxf86-video-intel-fd97edb62463e50a1860290d54684a68d5490bdc.zip
xf86-video-intel-fd97edb62463e50a1860290d54684a68d5490bdc.tar.gz
xf86-video-intel-fd97edb62463e50a1860290d54684a68d5490bdc.tar.bz2
move some definition out of i915 specific header
-rw-r--r--src/i830_driver.c1
-rw-r--r--src/i830_hwmc.c1
-rw-r--r--src/i830_hwmc.h11
-rw-r--r--src/i830_video.c1
-rw-r--r--src/i915_hwmc.c3
-rw-r--r--src/i915_hwmc.h9
-rw-r--r--src/xvmc/I915XvMC.c3
-rw-r--r--src/xvmc/I915XvMC.h31
-rw-r--r--src/xvmc/intel_xvmc.h32
9 files changed, 50 insertions, 42 deletions
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 60cfe24..4d57dce 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -198,6 +198,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "i830_bios.h"
#ifdef XvMCExtension
+#define _INTEL_XVMC_SERVER_
#include "i830_hwmc.h"
#endif
diff --git a/src/i830_hwmc.c b/src/i830_hwmc.c
index 575bdbc..432733c 100644
--- a/src/i830_hwmc.c
+++ b/src/i830_hwmc.c
@@ -28,6 +28,7 @@
#include "config.h"
#endif
+#define _INTEL_XVMC_SERVER_
#include "i830.h"
#include "i830_hwmc.h"
diff --git a/src/i830_hwmc.h b/src/i830_hwmc.h
index 199a92a..60a4978 100644
--- a/src/i830_hwmc.h
+++ b/src/i830_hwmc.h
@@ -27,6 +27,16 @@
#ifndef I830_HWMC_H
#define I830_HWMC_H
+#define FOURCC_XVMC (('C' << 24) + ('M' << 16) + ('V' << 8) + 'X')
+
+/*
+ * Commands that client submits through XvPutImage:
+ */
+
+#define INTEL_XVMC_COMMAND_DISPLAY 0x00
+#define INTEL_XVMC_COMMAND_UNDISPLAY 0x01
+
+#ifdef _INTEL_XVMC_SERVER_
#include <xf86xvmc.h>
#define XVMC_DRIVER_MPEG2_MC 0x0001
@@ -55,5 +65,6 @@ extern Bool intel_xvmc_driver_init(ScreenPtr, XF86VideoAdaptorPtr);
extern Bool intel_xvmc_screen_init(ScreenPtr);
extern void intel_xvmc_finish(ScrnInfoPtr);
extern int intel_xvmc_putimage_size(ScrnInfoPtr);
+#endif
#endif
diff --git a/src/i830_video.c b/src/i830_video.c
index 09ba806..63e8618 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -75,6 +75,7 @@
#include "fourcc.h"
#ifdef XvMCExtension
+#define _INTEL_XVMC_SERVER_
#include "i830_hwmc.h"
#include "i915_hwmc.h"
#endif
diff --git a/src/i915_hwmc.c b/src/i915_hwmc.c
index 1e204ba..e0446ba 100644
--- a/src/i915_hwmc.c
+++ b/src/i915_hwmc.c
@@ -55,6 +55,7 @@
#include "xf86xvpriv.h"
#endif
+#define _INTEL_XVMC_SERVER_
#include "i830_hwmc.h"
#include "i915_hwmc.h"
@@ -830,7 +831,7 @@ static int I915XvMCPutImage(ScrnInfoPtr pScrn, short src_x, short src_y,
if (pI830->XvMCEnabled) {
if (FOURCC_XVMC == id) {
switch (i915XvMCData->command) {
- case I915_XVMC_COMMAND_DISPLAY:
+ case INTEL_XVMC_COMMAND_DISPLAY:
if ((i915XvMCData->srfNo >= I915_XVMC_MAX_SURFACES) ||
!pXvMC->surfaces[i915XvMCData->srfNo] ||
!pXvMC->sfprivs[i915XvMCData->srfNo]) {
diff --git a/src/i915_hwmc.h b/src/i915_hwmc.h
index 597d30c..21964cb 100644
--- a/src/i915_hwmc.h
+++ b/src/i915_hwmc.h
@@ -33,18 +33,9 @@
#define SIZE_YUV420(w, h) (h * (STRIDE(w) + STRIDE(w >> 1)))
#define SIZE_XX44(w, h) (h * STRIDE(w))
-#define FOURCC_XVMC (('C' << 24) + ('M' << 16) + ('V' << 8) + 'X')
-
#define I915_NUM_XVMC_ATTRIBUTES 0x02
#define I915_XVMC_VALID 0x80000000
-/*
- * Commands that client submits through XvPutImage:
- */
-
-#define I915_XVMC_COMMAND_DISPLAY 0x00
-#define I915_XVMC_COMMAND_UNDISPLAY 0x01
-
typedef struct
{
unsigned int command;
diff --git a/src/xvmc/I915XvMC.c b/src/xvmc/I915XvMC.c
index 94b5026..59d5730 100644
--- a/src/xvmc/I915XvMC.c
+++ b/src/xvmc/I915XvMC.c
@@ -45,7 +45,6 @@
#include <xf86drm.h>
#include <drm_sarea.h>
-#include "intel_xvmc.h"
#include "I915XvMC.h"
#include "i915_structs.h"
#include "i915_program.h"
@@ -2524,7 +2523,7 @@ Status XvMCPutSurface(Display *display,XvMCSurface *surface,
pI915XvMC->draw = draw;
pI915XvMC->xvImage->data = (char *)&buf;
- buf.command = I915_XVMC_COMMAND_DISPLAY;
+ buf.command = INTEL_XVMC_COMMAND_DISPLAY;
buf.ctxNo = pI915XvMC->ctxno;
buf.srfNo = pI915Surface->srfNo;
pI915SubPic = pI915Surface->privSubPic;
diff --git a/src/xvmc/I915XvMC.h b/src/xvmc/I915XvMC.h
index 78aea7d..d122bcc 100644
--- a/src/xvmc/I915XvMC.h
+++ b/src/xvmc/I915XvMC.h
@@ -31,12 +31,8 @@
/* #define XVMC_DEBUG(x) do {x; }while(0); */
#define XVMC_DEBUG(x)
-#include "xf86drm.h"
-#include "i830_common.h"
+#include "intel_xvmc.h"
#include "i915_hwmc.h"
-#include <X11/Xlibint.h>
-#include <X11/Xutil.h>
-#include <signal.h>
#define I915_SUBPIC_PALETTE_SIZE 16
#define MAX_SUBCONTEXT_LEN 1024
@@ -163,29 +159,4 @@ typedef struct _i915XvMCSurface {
* displaying. NULL if none. */
} i915XvMCSurface;
-/* Subpicture fourcc */
-#define FOURCC_IA44 0x34344149
-
-/*
- Definitions for temporary wire protocol hooks to be replaced
- when a HW independent libXvMC is created.
-*/
-extern Status _xvmc_create_context(Display *dpy, XvMCContext *context,
- int *priv_count, uint **priv_data);
-
-extern Status _xvmc_destroy_context(Display *dpy, XvMCContext *context);
-
-extern Status _xvmc_create_surface(Display *dpy, XvMCContext *context,
- XvMCSurface *surface, int *priv_count,
- uint **priv_data);
-
-extern Status _xvmc_destroy_surface(Display *dpy, XvMCSurface *surface);
-
-extern Status _xvmc_create_subpicture(Display *dpy, XvMCContext *context,
- XvMCSubpicture *subpicture,
- int *priv_count, uint **priv_data);
-
-extern Status _xvmc_destroy_subpicture(Display *dpy,
- XvMCSubpicture *subpicture);
-
#endif /* _I915XVMC_H */
diff --git a/src/xvmc/intel_xvmc.h b/src/xvmc/intel_xvmc.h
index 072a0f4..0726be4 100644
--- a/src/xvmc/intel_xvmc.h
+++ b/src/xvmc/intel_xvmc.h
@@ -2,6 +2,13 @@
#ifndef INTEL_XVMC_H
#define INTEL_XVMC_H
+#include "xf86drm.h"
+#include "i830_common.h"
+#include "i830_hwmc.h"
+#include <X11/Xlibint.h>
+#include <X11/Xutil.h>
+#include <signal.h>
+
#define DEBUG 0
#define XVMC_ERR(s, arg...) \
@@ -20,4 +27,29 @@
fprintf(stderr, "intel_xvmc debug: " s "\n", ##arg); \
} while (0)
+/* Subpicture fourcc */
+#define FOURCC_IA44 0x34344149
+
+/*
+ Definitions for temporary wire protocol hooks to be replaced
+ when a HW independent libXvMC is created.
+*/
+extern Status _xvmc_create_context(Display *dpy, XvMCContext *context,
+ int *priv_count, uint **priv_data);
+
+extern Status _xvmc_destroy_context(Display *dpy, XvMCContext *context);
+
+extern Status _xvmc_create_surface(Display *dpy, XvMCContext *context,
+ XvMCSurface *surface, int *priv_count,
+ uint **priv_data);
+
+extern Status _xvmc_destroy_surface(Display *dpy, XvMCSurface *surface);
+
+extern Status _xvmc_create_subpicture(Display *dpy, XvMCContext *context,
+ XvMCSubpicture *subpicture,
+ int *priv_count, uint **priv_data);
+
+extern Status _xvmc_destroy_subpicture(Display *dpy,
+ XvMCSubpicture *subpicture);
+
#endif