Commit fc9368ce authored by Zhenyu Wang's avatar Zhenyu Wang

split xvmc user lib chipset drivers

parent cc892d1b
......@@ -36,14 +36,20 @@
#define INTEL_XVMC_COMMAND_DISPLAY 0x00
#define INTEL_XVMC_COMMAND_UNDISPLAY 0x01
/* hw xvmc support type */
#define XVMC_I915_MPEG2_MC 0x01
#define XVMC_I965_MPEG2_MC 0x02
#define XVMC_I945_MPEG2_VLD 0x04
#define XVMC_I965_MPEG2_VLD 0x08
/* common header for context private */
struct _intel_xvmc_common {
unsigned int type;
};
#ifdef _INTEL_XVMC_SERVER_
#include <xf86xvmc.h>
#define XVMC_DRIVER_MPEG2_MC 0x0001
#define XVMC_DRIVER_MPEG2_VLD 0x0002
#define XVMC_DRIVER_H264_MC 0x0004
#define XVMC_DRIVER_H264_VLD 0x0008
struct intel_xvmc_driver {
char *name;
XF86MCAdaptorPtr adaptor;
......
......@@ -56,7 +56,6 @@
#endif
#define _INTEL_XVMC_SERVER_
#include "i830_hwmc.h"
#include "i915_hwmc.h"
#define I915_XVMC_MAX_BUFFERS 2
......@@ -531,6 +530,7 @@ static int I915XvMCCreateContext (ScrnInfoPtr pScrn, XvMCContextPtr pContext,
return BadAlloc;
}
contextRec->comm.type = xvmc_driver->flag;
contextRec->ctxno = i;
contextRec->sis.handle = ctxpriv->sis_handle;
contextRec->sis.offset = ctxpriv->mcStaticIndirectState->offset;
......@@ -892,7 +892,7 @@ static void i915_xvmc_fini(ScrnInfoPtr pScrn)
struct intel_xvmc_driver i915_xvmc_driver = {
.name = "i915_xvmc",
.adaptor = &pAdapt,
.flag = XVMC_DRIVER_MPEG2_MC,
.flag = XVMC_I915_MPEG2_MC,
.init = i915_xvmc_init,
.fini = i915_xvmc_fini,
.putimage_size = i915_xvmc_putimage_size,
......
......@@ -27,6 +27,8 @@
#ifndef _I915_HWMC_H
#define _I915_HWMC_H
#include "i830_hwmc.h"
#define STRIDE(w) (((w) + 0x3ff) & ~0x3ff)
#define SIZE_Y420(w, h) (h * STRIDE(w))
#define SIZE_UV420(w, h) ((h >> 1) * STRIDE(w >> 1))
......@@ -55,6 +57,7 @@ struct hwmc_buffer
typedef struct
{
struct _intel_xvmc_common comm;
unsigned int ctxno; /* XvMC private context reference number */
struct hwmc_buffer sis;
struct hwmc_buffer ssb;
......
This diff is collapsed.
if DRI
lib_LTLIBRARIES=libI810XvMC.la libI915XvMC.la
lib_LTLIBRARIES=libI810XvMC.la libIntelXvMC.la
libI810XvMC_la_SOURCES = I810XvMC.c \
I810XvMC.h
......@@ -9,9 +9,10 @@ libI810XvMC_la_CFLAGS = @WARN_CFLAGS@ @XORG_CFLAGS@ @DRI_CFLAGS@ \
libI810XvMC_la_LDFLAGS = -version-number 1:0:0
libI810XvMC_la_LIBADD = @DRI_LIBS@
libI915XvMC_la_SOURCES = I915XvMC.c \
I915XvMC.h \
libIntelXvMC_la_SOURCES = intel_xvmc.c \
intel_xvmc.h \
I915XvMC.c \
I915XvMC.h \
intel_batchbuffer.c \
intel_batchbuffer.h \
xf86dri.c \
......@@ -19,7 +20,7 @@ libI915XvMC_la_SOURCES = I915XvMC.c \
xf86dristr.h \
driDrawable.c \
driDrawable.h
libI915XvMC_la_CFLAGS = @XORG_CFLAGS@ @DRI_CFLAGS@ -I$(top_srcdir)/src -DTRUE=1 -DFALSE=0
libI915XvMC_la_LDFLAGS = -version-number 1:0:0
libI915XvMC_la_LIBADD = @DRI_LIBS@
libIntelXvMC_la_CFLAGS = @XORG_CFLAGS@ @DRI_CFLAGS@ -I$(top_srcdir)/src -DTRUE=1 -DFALSE=0
libIntelXvMC_la_LDFLAGS = -version-number 1:0:0
libIntelXvMC_la_LIBADD = @DRI_LIBS@
endif
This diff is collapsed.
......@@ -2,12 +2,31 @@
#ifndef INTEL_XVMC_H
#define INTEL_XVMC_H
#include "xf86drm.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#include <fcntl.h>
#include <dirent.h>
#include <string.h>
#include <assert.h>
#include <signal.h>
#include <xf86drm.h>
#include "i830_common.h"
#include "i830_hwmc.h"
#include <X11/Xlibint.h>
#include <X11/Xutil.h>
#include <signal.h>
#include <fourcc.h>
#include <X11/extensions/Xv.h>
#include <X11/extensions/Xvlib.h>
#include <X11/extensions/XvMC.h>
#include <X11/extensions/XvMClib.h>
#include <drm_sarea.h>
#include "xf86dri.h"
#include "driDrawable.h"
#define DEBUG 0
......@@ -35,7 +54,7 @@
when a HW independent libXvMC is created.
*/
extern Status _xvmc_create_context(Display *dpy, XvMCContext *context,
int *priv_count, uint **priv_data);
int *priv_count, CARD32 **priv_data);
extern Status _xvmc_destroy_context(Display *dpy, XvMCContext *context);
......@@ -52,4 +71,44 @@ extern Status _xvmc_create_subpicture(Display *dpy, XvMCContext *context,
extern Status _xvmc_destroy_subpicture(Display *dpy,
XvMCSubpicture *subpicture);
struct _intel_xvmc_driver {
int type; /* hw xvmc type - i830_hwmc.h */
int screen; /* current screen num*/
#if 0
drm_handle_t hsarea; /* DRI open connect */
unsigned int sarea_size;
drmAddress sarea_address;
#endif
char busID[32];
int fd; /* drm file handler */
void *private;
/* XXX: api hooks */
int (*init)(/*XXX*/);
void (*fini)(/*XXX*/);
int (*create_context)(Display* display, XvMCContext *context, int priv_count, CARD32 *priv_data);
int (*destroy_context)(Display* display, XvMCContext *context);
int (*create_surface)(Display* display, XvMCContext *context, XvMCSurface *surface);
int (*destroy_surface)(Display* display, XvMCSurface *surface);
int (*render_surface)(Display *display, XvMCContext *context,
unsigned int picture_structure,
XvMCSurface *target_surface,
XvMCSurface *past_surface,
XvMCSurface *future_surface,
unsigned int flags,
unsigned int num_macroblocks,
unsigned int first_macroblock,
XvMCMacroBlockArray *macroblock_array,
XvMCBlockArray *blocks);
int (*put_surface)(Display *display,XvMCSurface *surface,
Drawable draw, short srcx, short srcy,
unsigned short srcw, unsigned short srch,
short destx, short desty,
unsigned short destw, unsigned short desth,
int flags);
int (*get_surface_status)(Display *display, XvMCSurface *surface, int *stat);
};
extern struct _intel_xvmc_driver i915_xvmc_mc_driver;
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment