Commit c13efdd3 authored by Paulo Cesar Pereira de Andrade's avatar Paulo Cesar Pereira de Andrade Committed by Zhenyu Wang

More compile warning fixes.

o Check for RANDR_GET_CRTC_INTERFACE before defining functions that
  are used only if it is defined.
o Declare a variable before code, and rename it from ret to xvmc_status
  to better describe it.
o if 0 some static functions not used.
o Don't declare some unused variables.
o Declare as static some functions that are used only in the file defining it.
o Add a default/fallback return True to the Bool function
  src/xvmc/intel_batchbuffer.c:intelInitBatchBuffer().
o Ansify src/xvmc/xf86dri.c.
o Add missing prototype to src/xvmc/xf86dri.h and follow pattern of other
  headers by adding "extern" before function prototype.
parent 8cdbd55f
...@@ -391,6 +391,7 @@ i830_crt_destroy (xf86OutputPtr output) ...@@ -391,6 +391,7 @@ i830_crt_destroy (xf86OutputPtr output)
xfree (output->driver_private); xfree (output->driver_private);
} }
#ifdef RANDR_GET_CRTC_INTERFACE
static xf86CrtcPtr static xf86CrtcPtr
i830_crt_get_crtc(xf86OutputPtr output) i830_crt_get_crtc(xf86OutputPtr output)
{ {
...@@ -400,6 +401,7 @@ i830_crt_get_crtc(xf86OutputPtr output) ...@@ -400,6 +401,7 @@ i830_crt_get_crtc(xf86OutputPtr output)
return i830_pipe_to_crtc(pScrn, pipe); return i830_pipe_to_crtc(pScrn, pipe);
} }
#endif
static const xf86OutputFuncsRec i830_crt_output_funcs = { static const xf86OutputFuncsRec i830_crt_output_funcs = {
.dpms = i830_crt_dpms, .dpms = i830_crt_dpms,
......
...@@ -330,6 +330,7 @@ i830_dvo_destroy (xf86OutputPtr output) ...@@ -330,6 +330,7 @@ i830_dvo_destroy (xf86OutputPtr output)
} }
} }
#ifdef RANDR_GET_CRTC_INTERFACE
static xf86CrtcPtr static xf86CrtcPtr
i830_dvo_get_crtc(xf86OutputPtr output) i830_dvo_get_crtc(xf86OutputPtr output)
{ {
...@@ -341,6 +342,7 @@ i830_dvo_get_crtc(xf86OutputPtr output) ...@@ -341,6 +342,7 @@ i830_dvo_get_crtc(xf86OutputPtr output)
return i830_pipe_to_crtc(pScrn, pipe); return i830_pipe_to_crtc(pScrn, pipe);
} }
#endif
static const xf86OutputFuncsRec i830_dvo_output_funcs = { static const xf86OutputFuncsRec i830_dvo_output_funcs = {
.dpms = i830_dvo_dpms, .dpms = i830_dvo_dpms,
......
...@@ -879,6 +879,7 @@ i830_lvds_get_property(xf86OutputPtr output, Atom property) ...@@ -879,6 +879,7 @@ i830_lvds_get_property(xf86OutputPtr output, Atom property)
} }
#endif /* RANDR_13_INTERFACE */ #endif /* RANDR_13_INTERFACE */
#ifdef RANDR_GET_CRTC_INTERFACE
static xf86CrtcPtr static xf86CrtcPtr
i830_lvds_get_crtc(xf86OutputPtr output) i830_lvds_get_crtc(xf86OutputPtr output)
{ {
...@@ -888,6 +889,7 @@ i830_lvds_get_crtc(xf86OutputPtr output) ...@@ -888,6 +889,7 @@ i830_lvds_get_crtc(xf86OutputPtr output)
return i830_pipe_to_crtc(pScrn, pipe); return i830_pipe_to_crtc(pScrn, pipe);
} }
#endif
static const xf86OutputFuncsRec i830_lvds_output_funcs = { static const xf86OutputFuncsRec i830_lvds_output_funcs = {
.create_resources = i830_lvds_create_resources, .create_resources = i830_lvds_create_resources,
......
...@@ -1146,6 +1146,7 @@ i830_sdvo_destroy (xf86OutputPtr output) ...@@ -1146,6 +1146,7 @@ i830_sdvo_destroy (xf86OutputPtr output)
} }
} }
#ifdef RANDR_GET_CRTC_INTERFACE
static xf86CrtcPtr static xf86CrtcPtr
i830_sdvo_get_crtc(xf86OutputPtr output) i830_sdvo_get_crtc(xf86OutputPtr output)
{ {
...@@ -1157,6 +1158,7 @@ i830_sdvo_get_crtc(xf86OutputPtr output) ...@@ -1157,6 +1158,7 @@ i830_sdvo_get_crtc(xf86OutputPtr output)
return i830_pipe_to_crtc(pScrn, pipe); return i830_pipe_to_crtc(pScrn, pipe);
} }
#endif
static const xf86OutputFuncsRec i830_sdvo_output_funcs = { static const xf86OutputFuncsRec i830_sdvo_output_funcs = {
.dpms = i830_sdvo_dpms, .dpms = i830_sdvo_dpms,
......
...@@ -1640,6 +1640,7 @@ i830_tv_set_property(xf86OutputPtr output, Atom property, ...@@ -1640,6 +1640,7 @@ i830_tv_set_property(xf86OutputPtr output, Atom property,
} }
#endif /* RANDR_12_INTERFACE */ #endif /* RANDR_12_INTERFACE */
#ifdef RANDR_GET_CRTC_INTERFACE
static xf86CrtcPtr static xf86CrtcPtr
i830_tv_get_crtc(xf86OutputPtr output) i830_tv_get_crtc(xf86OutputPtr output)
{ {
...@@ -1649,6 +1650,7 @@ i830_tv_get_crtc(xf86OutputPtr output) ...@@ -1649,6 +1650,7 @@ i830_tv_get_crtc(xf86OutputPtr output)
return i830_pipe_to_crtc(pScrn, pipe); return i830_pipe_to_crtc(pScrn, pipe);
} }
#endif
static const xf86OutputFuncsRec i830_tv_output_funcs = { static const xf86OutputFuncsRec i830_tv_output_funcs = {
.create_resources = i830_tv_create_resources, .create_resources = i830_tv_create_resources,
......
...@@ -565,6 +565,9 @@ I830InitVideo(ScreenPtr pScreen) ...@@ -565,6 +565,9 @@ I830InitVideo(ScreenPtr pScreen)
XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL; XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL;
XF86VideoAdaptorPtr overlayAdaptor = NULL, texturedAdaptor = NULL; XF86VideoAdaptorPtr overlayAdaptor = NULL, texturedAdaptor = NULL;
int num_adaptors; int num_adaptors;
#ifdef INTEL_XVMC
Bool xvmc_status = FALSE;
#endif
#if 0 #if 0
{ {
...@@ -627,10 +630,9 @@ I830InitVideo(ScreenPtr pScreen) ...@@ -627,10 +630,9 @@ I830InitVideo(ScreenPtr pScreen)
I830InitOffscreenImages(pScreen); I830InitOffscreenImages(pScreen);
} }
#ifdef INTEL_XVMC #ifdef INTEL_XVMC
Bool ret = FALSE;
if (intel_xvmc_probe(pScrn)) { if (intel_xvmc_probe(pScrn)) {
if (texturedAdaptor) if (texturedAdaptor)
ret = intel_xvmc_driver_init(pScreen, texturedAdaptor); xvmc_status = intel_xvmc_driver_init(pScreen, texturedAdaptor);
} }
#endif #endif
...@@ -638,7 +640,7 @@ I830InitVideo(ScreenPtr pScreen) ...@@ -638,7 +640,7 @@ I830InitVideo(ScreenPtr pScreen)
xf86XVScreenInit(pScreen, adaptors, num_adaptors); xf86XVScreenInit(pScreen, adaptors, num_adaptors);
#ifdef INTEL_XVMC #ifdef INTEL_XVMC
if (ret) if (xvmc_status)
intel_xvmc_screen_init(pScreen); intel_xvmc_screen_init(pScreen);
#endif #endif
xfree(adaptors); xfree(adaptors);
......
...@@ -97,6 +97,7 @@ typedef struct _I915XvMC ...@@ -97,6 +97,7 @@ typedef struct _I915XvMC
#define ARRARY_SIZE(a) (sizeof(a) / sizeof(a[0])) #define ARRARY_SIZE(a) (sizeof(a) / sizeof(a[0]))
/*
static int yv12_subpicture_index_list[2] = static int yv12_subpicture_index_list[2] =
{ {
FOURCC_IA44, FOURCC_IA44,
...@@ -108,6 +109,7 @@ static XF86MCImageIDList yv12_subpicture_list = ...@@ -108,6 +109,7 @@ static XF86MCImageIDList yv12_subpicture_list =
ARRARY_SIZE(yv12_subpicture_index_list), ARRARY_SIZE(yv12_subpicture_index_list),
yv12_subpicture_index_list yv12_subpicture_index_list
}; };
*/
static XF86MCSurfaceInfoRec i915_YV12_mpg2_surface = static XF86MCSurfaceInfoRec i915_YV12_mpg2_surface =
{ {
...@@ -147,6 +149,7 @@ static XF86MCSurfaceInfoPtr ppSI[2] = ...@@ -147,6 +149,7 @@ static XF86MCSurfaceInfoPtr ppSI[2] =
(XF86MCSurfaceInfoPtr)&i915_YV12_mpg1_surface (XF86MCSurfaceInfoPtr)&i915_YV12_mpg1_surface
}; };
#if 0
/* List of subpicture types that we support */ /* List of subpicture types that we support */
static XF86ImageRec ia44_subpicture = XVIMAGE_IA44; static XF86ImageRec ia44_subpicture = XVIMAGE_IA44;
static XF86ImageRec ai44_subpicture = XVIMAGE_AI44; static XF86ImageRec ai44_subpicture = XVIMAGE_AI44;
...@@ -156,7 +159,7 @@ static XF86ImagePtr i915_subpicture_list[2] = ...@@ -156,7 +159,7 @@ static XF86ImagePtr i915_subpicture_list[2] =
(XF86ImagePtr)&ia44_subpicture, (XF86ImagePtr)&ia44_subpicture,
(XF86ImagePtr)&ai44_subpicture (XF86ImagePtr)&ai44_subpicture
}; };
#endif
/* /*
* Init and clean up the screen private parts of XvMC. * Init and clean up the screen private parts of XvMC.
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
* *
*/ */
#include <pthread.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include "i915_xvmc.h" #include "i915_xvmc.h"
...@@ -56,6 +55,7 @@ typedef union { ...@@ -56,6 +55,7 @@ typedef union {
uint u[2]; uint u[2];
} su_t; } su_t;
#if 0
static int findOverlap(unsigned int width, unsigned int height, static int findOverlap(unsigned int width, unsigned int height,
short *dstX, short *dstY, short *dstX, short *dstY,
short *srcX, short *srcY, short *srcX, short *srcY,
...@@ -91,6 +91,7 @@ static int findOverlap(unsigned int width, unsigned int height, ...@@ -91,6 +91,7 @@ static int findOverlap(unsigned int width, unsigned int height,
*areaH = (h <= mHeight) ? h : mHeight; *areaH = (h <= mHeight) ? h : mHeight;
return 0; return 0;
} }
#endif
static void i915_flush(int map, int render) static void i915_flush(int map, int render)
{ {
...@@ -117,7 +118,7 @@ static void i915_mc_static_indirect_state_buffer(XvMCContext *context, ...@@ -117,7 +118,7 @@ static void i915_mc_static_indirect_state_buffer(XvMCContext *context,
struct i915_3dstate_dest_buffer_variables_mpeg *dest_buffer_variables_mpeg; struct i915_3dstate_dest_buffer_variables_mpeg *dest_buffer_variables_mpeg;
i915XvMCSurface *pI915Surface = (i915XvMCSurface *)surface->privData; i915XvMCSurface *pI915Surface = (i915XvMCSurface *)surface->privData;
i915XvMCContext *pI915XvMC = (i915XvMCContext *)context->privData; i915XvMCContext *pI915XvMC = (i915XvMCContext *)context->privData;
unsigned int w = surface->width, h = surface->height; unsigned int w = surface->width;
/* 3DSTATE_BUFFER_INFO */ /* 3DSTATE_BUFFER_INFO */
/* DEST Y */ /* DEST Y */
...@@ -459,7 +460,7 @@ static void i915_mc_mpeg_macroblock_ipicture(XvMCContext *context, XvMCMacroBloc ...@@ -459,7 +460,7 @@ static void i915_mc_mpeg_macroblock_ipicture(XvMCContext *context, XvMCMacroBloc
intelBatchbufferData(&macroblock_ipicture, sizeof(macroblock_ipicture), 0); intelBatchbufferData(&macroblock_ipicture, sizeof(macroblock_ipicture), 0);
} }
#if 0
static void i915_mc_mpeg_macroblock_0mv(XvMCContext *context, XvMCMacroBlock *mb) static void i915_mc_mpeg_macroblock_0mv(XvMCContext *context, XvMCMacroBlock *mb)
{ {
struct i915_3dmpeg_macroblock_0mv macroblock_0mv; struct i915_3dmpeg_macroblock_0mv macroblock_0mv;
...@@ -487,6 +488,7 @@ static void i915_mc_mpeg_macroblock_0mv(XvMCContext *context, XvMCMacroBlock *mb ...@@ -487,6 +488,7 @@ static void i915_mc_mpeg_macroblock_0mv(XvMCContext *context, XvMCMacroBlock *mb
intelBatchbufferData(&macroblock_0mv, sizeof(macroblock_0mv), 0); intelBatchbufferData(&macroblock_0mv, sizeof(macroblock_0mv), 0);
} }
#endif
static void i915_mc_mpeg_macroblock_1fbmv(XvMCContext *context, XvMCMacroBlock *mb) static void i915_mc_mpeg_macroblock_1fbmv(XvMCContext *context, XvMCMacroBlock *mb)
{ {
...@@ -529,7 +531,6 @@ static void i915_mc_mpeg_macroblock_1fbmv(XvMCContext *context, XvMCMacroBlock * ...@@ -529,7 +531,6 @@ static void i915_mc_mpeg_macroblock_1fbmv(XvMCContext *context, XvMCMacroBlock *
static void i915_mc_mpeg_macroblock_2fbmv(XvMCContext *context, XvMCMacroBlock *mb, unsigned int ps) static void i915_mc_mpeg_macroblock_2fbmv(XvMCContext *context, XvMCMacroBlock *mb, unsigned int ps)
{ {
struct i915_3dmpeg_macroblock_2fbmv macroblock_2fbmv; struct i915_3dmpeg_macroblock_2fbmv macroblock_2fbmv;
i915XvMCContext *pI915XvMC = (i915XvMCContext *)context->privData;
/* Motion Vectors */ /* Motion Vectors */
su_t fmv; su_t fmv;
...@@ -979,6 +980,7 @@ static void i915_mc_one_time_state_initialization(XvMCContext *context) ...@@ -979,6 +980,7 @@ static void i915_mc_one_time_state_initialization(XvMCContext *context)
free(base); free(base);
} }
#if 0
static void i915_mc_invalidate_subcontext_buffers(XvMCContext *context, unsigned int mask) static void i915_mc_invalidate_subcontext_buffers(XvMCContext *context, unsigned int mask)
{ {
struct i915_3dstate_load_indirect *load_indirect = NULL; struct i915_3dstate_load_indirect *load_indirect = NULL;
...@@ -1086,6 +1088,7 @@ static void i915_mc_invalidate_subcontext_buffers(XvMCContext *context, unsigned ...@@ -1086,6 +1088,7 @@ static void i915_mc_invalidate_subcontext_buffers(XvMCContext *context, unsigned
intelBatchbufferData(base, size, 0); intelBatchbufferData(base, size, 0);
free(base); free(base);
} }
#endif
static int i915_xvmc_map_buffers(i915XvMCContext *pI915XvMC) static int i915_xvmc_map_buffers(i915XvMCContext *pI915XvMC)
{ {
...@@ -1167,6 +1170,7 @@ static void i915_xvmc_unmap_buffers(i915XvMCContext *pI915XvMC) ...@@ -1167,6 +1170,7 @@ static void i915_xvmc_unmap_buffers(i915XvMCContext *pI915XvMC)
} }
} }
#if 0
/* /*
* Video post processing * Video post processing
*/ */
...@@ -1243,7 +1247,9 @@ static void i915_yuv2rgb_map_state_buffer(XvMCSurface *target_surface) ...@@ -1243,7 +1247,9 @@ static void i915_yuv2rgb_map_state_buffer(XvMCSurface *target_surface)
tm->tm2.cube_face = 0; tm->tm2.cube_face = 0;
tm->tm2.pitch = (privTarget->uvStride >> 2) - 1; /* in DWords - 1 */ tm->tm2.pitch = (privTarget->uvStride >> 2) - 1; /* in DWords - 1 */
} }
#endif
#if 0
static void i915_yuv2rgb_sampler_state_buffer(XvMCSurface *surface) static void i915_yuv2rgb_sampler_state_buffer(XvMCSurface *surface)
{ {
struct i915_3dstate_sampler_state *sampler_state; struct i915_3dstate_sampler_state *sampler_state;
...@@ -1340,7 +1346,9 @@ static void i915_yuv2rgb_sampler_state_buffer(XvMCSurface *surface) ...@@ -1340,7 +1346,9 @@ static void i915_yuv2rgb_sampler_state_buffer(XvMCSurface *surface)
ts->ts1.east_deinterlacer = 0; ts->ts1.east_deinterlacer = 0;
ts->ts2.default_color = 0; ts->ts2.default_color = 0;
} }
#endif
#if 0
static void i915_yuv2rgb_static_indirect_state_buffer(XvMCSurface *surface, static void i915_yuv2rgb_static_indirect_state_buffer(XvMCSurface *surface,
unsigned int dstaddr, unsigned int dstaddr,
int dstpitch) int dstpitch)
...@@ -1374,7 +1382,9 @@ static void i915_yuv2rgb_static_indirect_state_buffer(XvMCSurface *surface, ...@@ -1374,7 +1382,9 @@ static void i915_yuv2rgb_static_indirect_state_buffer(XvMCSurface *surface,
dest_buffer_variables->dw1.dest_h_bias = 8; dest_buffer_variables->dw1.dest_h_bias = 8;
dest_buffer_variables->dw1.color_fmt = COLORBUFFER_A8R8G8B8; /* FIXME */ dest_buffer_variables->dw1.color_fmt = COLORBUFFER_A8R8G8B8; /* FIXME */
} }
#endif
#if 0
static void i915_yuv2rgb_pixel_shader_program_buffer(XvMCSurface *surface) static void i915_yuv2rgb_pixel_shader_program_buffer(XvMCSurface *surface)
{ {
struct i915_3dstate_pixel_shader_program *pixel_shader_program; struct i915_3dstate_pixel_shader_program *pixel_shader_program;
...@@ -1424,7 +1434,9 @@ static void i915_yuv2rgb_pixel_shader_program_buffer(XvMCSurface *surface) ...@@ -1424,7 +1434,9 @@ static void i915_yuv2rgb_pixel_shader_program_buffer(XvMCSurface *surface)
src1 = UREG(REG_TYPE_S, 2); /* SAMPLER */ src1 = UREG(REG_TYPE_S, 2); /* SAMPLER */
i915_inst_texld(inst, T0_TEXLD, dest, src0, src1); i915_inst_texld(inst, T0_TEXLD, dest, src0, src1);
} }
#endif
#if 0
static void i915_yuv2rgb_proc(XvMCSurface *surface) static void i915_yuv2rgb_proc(XvMCSurface *surface)
{ {
i915XvMCSurface *privSurface = (i915XvMCSurface *)surface->privData; i915XvMCSurface *privSurface = (i915XvMCSurface *)surface->privData;
...@@ -1581,6 +1593,7 @@ static void i915_yuv2rgb_proc(XvMCSurface *surface) ...@@ -1581,6 +1593,7 @@ static void i915_yuv2rgb_proc(XvMCSurface *surface)
intelBatchbufferData(base, size, 0); intelBatchbufferData(base, size, 0);
free(base); free(base);
} }
#endif
/* /*
* Function: i915_release_resource * Function: i915_release_resource
...@@ -1588,7 +1601,6 @@ static void i915_yuv2rgb_proc(XvMCSurface *surface) ...@@ -1588,7 +1601,6 @@ static void i915_yuv2rgb_proc(XvMCSurface *surface)
static void i915_release_resource(Display *display, XvMCContext *context) static void i915_release_resource(Display *display, XvMCContext *context)
{ {
i915XvMCContext *pI915XvMC; i915XvMCContext *pI915XvMC;
int screen = DefaultScreen(display);
if (!(pI915XvMC = context->privData)) if (!(pI915XvMC = context->privData))
return; return;
...@@ -1608,13 +1620,7 @@ static Status i915_xvmc_mc_create_context(Display *display, XvMCContext *context ...@@ -1608,13 +1620,7 @@ static Status i915_xvmc_mc_create_context(Display *display, XvMCContext *context
{ {
i915XvMCContext *pI915XvMC = NULL; i915XvMCContext *pI915XvMC = NULL;
I915XvMCCreateContextRec *tmpComm = NULL; I915XvMCCreateContextRec *tmpComm = NULL;
Status ret;
drm_sarea_t *pSAREA; drm_sarea_t *pSAREA;
char *curBusID;
uint magic;
int major, minor;
int isCapable;
int screen = DefaultScreen(display);
XVMC_DBG("%s\n", __FUNCTION__); XVMC_DBG("%s\n", __FUNCTION__);
...@@ -1718,7 +1724,6 @@ static Status i915_xvmc_mc_create_surface(Display *display, ...@@ -1718,7 +1724,6 @@ static Status i915_xvmc_mc_create_surface(Display *display,
XvMCContext *context, XvMCSurface *surface, int priv_count, XvMCContext *context, XvMCSurface *surface, int priv_count,
CARD32 *priv_data) CARD32 *priv_data)
{ {
Status ret;
i915XvMCContext *pI915XvMC; i915XvMCContext *pI915XvMC;
i915XvMCSurface *pI915Surface; i915XvMCSurface *pI915Surface;
I915XvMCCreateSurfaceRec *tmpComm = NULL; I915XvMCCreateSurfaceRec *tmpComm = NULL;
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
#define MI_BATCH_BUFFER_END (0xA << 23) #define MI_BATCH_BUFFER_END (0xA << 23)
int intelEmitIrqLocked(void) static int intelEmitIrqLocked(void)
{ {
drmI830IrqEmit ie; drmI830IrqEmit ie;
int ret, seq; int ret, seq;
...@@ -65,7 +65,7 @@ int intelEmitIrqLocked(void) ...@@ -65,7 +65,7 @@ int intelEmitIrqLocked(void)
return seq; return seq;
} }
void intelWaitIrq(int seq) static void intelWaitIrq(int seq)
{ {
int ret; int ret;
drmI830IrqWait iw; drmI830IrqWait iw;
...@@ -118,6 +118,7 @@ Bool intelInitBatchBuffer(void) ...@@ -118,6 +118,7 @@ Bool intelInitBatchBuffer(void)
xvmc_driver->alloc.active_buf = 0; xvmc_driver->alloc.active_buf = 0;
assert(xvmc_driver->alloc.ptr); assert(xvmc_driver->alloc.ptr);
return True;
} }
void intelFiniBatchBuffer(void) void intelFiniBatchBuffer(void)
...@@ -129,7 +130,7 @@ void intelFiniBatchBuffer(void) ...@@ -129,7 +130,7 @@ void intelFiniBatchBuffer(void)
intelDestroyBatchBuffer(); intelDestroyBatchBuffer();
} }
void intelBatchbufferRequireSpace(unsigned int sz) static void intelBatchbufferRequireSpace(unsigned int sz)
{ {
if (xvmc_driver->batch.space < sz) if (xvmc_driver->batch.space < sz)
intelFlushBatch(TRUE); intelFlushBatch(TRUE);
...@@ -152,7 +153,7 @@ void intelBatchbufferData(const void *data, unsigned bytes, unsigned flags) ...@@ -152,7 +153,7 @@ void intelBatchbufferData(const void *data, unsigned bytes, unsigned flags)
#define FLUSH_RENDER_CACHE (0 << 2) #define FLUSH_RENDER_CACHE (0 << 2)
#define FLUSH_WRITE_DIRTY_STATE (1 << 4) #define FLUSH_WRITE_DIRTY_STATE (1 << 4)
void intelRefillBatchLocked(Bool allow_unlock ) static void intelRefillBatchLocked(Bool allow_unlock)
{ {
unsigned half = xvmc_driver->alloc.size >> 1; unsigned half = xvmc_driver->alloc.size >> 1;
unsigned buf = (xvmc_driver->alloc.active_buf ^= 1); unsigned buf = (xvmc_driver->alloc.active_buf ^= 1);
...@@ -175,9 +176,9 @@ void intelRefillBatchLocked(Bool allow_unlock ) ...@@ -175,9 +176,9 @@ void intelRefillBatchLocked(Bool allow_unlock )
} }
void intelFlushBatchLocked(Bool ignore_cliprects, static void intelFlushBatchLocked(Bool ignore_cliprects,
Bool refill, Bool refill,
Bool allow_unlock) Bool allow_unlock)
{ {
drmI830BatchBuffer batch; drmI830BatchBuffer batch;
......
...@@ -250,7 +250,7 @@ Status XvMCCreateContext(Display *display, XvPortID port, ...@@ -250,7 +250,7 @@ Status XvMCCreateContext(Display *display, XvPortID port,
XVMC_ERR("Unable to create XvMC Context."); XVMC_ERR("Unable to create XvMC Context.");
return ret; return ret;
} }
XVMC_DBG("new context %d created\n", context->context_id); XVMC_DBG("new context %d created\n", (int)context->context_id);
comm = (struct _intel_xvmc_common *)priv_data; comm = (struct _intel_xvmc_common *)priv_data;
...@@ -341,7 +341,7 @@ Status XvMCCreateContext(Display *display, XvPortID port, ...@@ -341,7 +341,7 @@ Status XvMCCreateContext(Display *display, XvPortID port,
context->context_id, context->context_id,
&intel_ctx->hw_context)) { &intel_ctx->hw_context)) {
XVMC_ERR("Could not create DRI context for xvmc ctx %d.", XVMC_ERR("Could not create DRI context for xvmc ctx %d.",
context->context_id); (int)context->context_id);
XFree(priv_data); XFree(priv_data);
context->privData = NULL; context->privData = NULL;
drmUnmap(xvmc_driver->sarea_address, xvmc_driver->sarea_size); drmUnmap(xvmc_driver->sarea_address, xvmc_driver->sarea_size);
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#ifndef INTEL_XVMC_H #ifndef INTEL_XVMC_H
#define INTEL_XVMC_H #define INTEL_XVMC_H
#include <pthread.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
......
...@@ -88,9 +88,8 @@ XEXT_GENERATE_FIND_DISPLAY(find_display, xf86dri_info, ...@@ -88,9 +88,8 @@ XEXT_GENERATE_FIND_DISPLAY(find_display, xf86dri_info,
#else #else
#define TRACE(msg, arg...) #define TRACE(msg, arg...)
#endif #endif
Bool uniDRIQueryExtension(dpy, event_basep, error_basep) Bool
Display *dpy; uniDRIQueryExtension(Display *dpy, int *event_basep, int *error_basep)
int *event_basep, *error_basep;
{ {
XExtDisplayInfo *info = find_display(dpy); XExtDisplayInfo *info = find_display(dpy);
...@@ -107,11 +106,8 @@ XEXT_GENERATE_FIND_DISPLAY(find_display, xf86dri_info, ...@@ -107,11 +106,8 @@ XEXT_GENERATE_FIND_DISPLAY(find_display, xf86dri_info,
} }
Bool Bool
uniDRIQueryVersion(dpy, majorVersion, minorVersion, patchVersion) uniDRIQueryVersion(Display *dpy, int *majorVersion, int *minorVersion,
Display *dpy; int *patchVersion)
int *majorVersion;
int *minorVersion;
int *patchVersion;
{ {
XExtDisplayInfo *info = find_display(dpy); XExtDisplayInfo *info = find_display(dpy);
xXF86DRIQueryVersionReply rep; xXF86DRIQueryVersionReply rep;
...@@ -141,10 +137,7 @@ uniDRIQueryVersion(dpy, majorVersion, minorVersion, patchVersion) ...@@ -141,10 +137,7 @@ uniDRIQueryVersion(dpy, majorVersion, minorVersion, patchVersion)
} }
Bool Bool
uniDRIQueryDirectRenderingCapable(dpy, screen, isCapable) uniDRIQueryDirectRenderingCapable(Display *dpy, int screen, Bool *isCapable)
Display *dpy;
int screen;
Bool *isCapable;
{ {
XExtDisplayInfo *info = find_display(dpy); XExtDisplayInfo *info = find_display(dpy);
xXF86DRIQueryDirectRenderingCapableReply rep; xXF86DRIQueryDirectRenderingCapableReply rep;
...@@ -173,11 +166,8 @@ uniDRIQueryDirectRenderingCapable(dpy, screen, isCapable) ...@@ -173,11 +166,8 @@ uniDRIQueryDirectRenderingCapable(dpy, screen, isCapable)
} }
Bool Bool
uniDRIOpenConnection(dpy, screen, hSAREA, busIdString) uniDRIOpenConnection(Display *dpy, int screen,
Display *dpy; drm_handle_t *hSAREA, char **busIdString)
int screen;
drm_handle_t *hSAREA;
char **busIdString;
{ {
XExtDisplayInfo *info = find_display(dpy); XExtDisplayInfo *info = find_display(dpy);
xXF86DRIOpenConnectionReply rep; xXF86DRIOpenConnectionReply rep;
...@@ -224,10 +214,7 @@ uniDRIOpenConnection(dpy, screen, hSAREA, busIdString) ...@@ -224,10 +214,7 @@ uniDRIOpenConnection(dpy, screen, hSAREA, busIdString)
} }
Bool Bool
uniDRIAuthConnection(dpy, screen, magic) uniDRIAuthConnection(Display *dpy, int screen, drm_magic_t magic)
Display *dpy;
int screen;
drm_magic_t magic;
{ {
XExtDisplayInfo *info = find_display(dpy); XExtDisplayInfo *info = find_display(dpy);
xXF86DRIAuthConnectionReq *req; xXF86DRIAuthConnectionReq *req;
...@@ -256,9 +243,7 @@ uniDRIAuthConnection(dpy, screen, magic) ...@@ -256,9 +243,7 @@ uniDRIAuthConnection(dpy, screen, magic)
} }
Bool Bool
uniDRICloseConnection(dpy, screen) uniDRICloseConnection(Display *dpy, int screen)
Display *dpy;
int screen;
{ {
XExtDisplayInfo *info = find_display(dpy); XExtDisplayInfo *info = find_display(dpy);
xXF86DRICloseConnectionReq *req; xXF86DRICloseConnectionReq *req;
...@@ -279,14 +264,9 @@ uniDRICloseConnection(dpy, screen) ...@@ -279,14 +264,9 @@ uniDRICloseConnection(dpy, screen)
} }
Bool Bool
uniDRIGetClientDriverName(dpy, screen, ddxDriverMajorVersion, uniDRIGetClientDriverName(Display *dpy, int screen, int *ddxDriverMajorVersion,
ddxDriverMinorVersion, ddxDriverPatchVersion, clientDriverName) int *ddxDriverMinorVersion, int *ddxDriverPatchVersion,
Display *dpy; char **clientDriverName)
int screen;
int *ddxDriverMajorVersion;
int *ddxDriverMinorVersion;
int *ddxDriverPatchVersion;
char **clientDriverName;
{ {
XExtDisplayInfo *info = find_display(dpy); XExtDisplayInfo *info = find_display(dpy);
xXF86DRIGetClientDriverNameReply rep; xXF86DRIGetClientDriverNameReply rep;
...@@ -331,12 +311,8 @@ uniDRIGetClientDriverName(dpy, screen, ddxDriverMajorVersion, ...@@ -331,12 +311,8 @@ uniDRIGetClientDriverName(dpy, screen, ddxDriverMajorVersion,
} }
Bool Bool
uniDRICreateContextWithConfig(dpy, screen, configID, context, hHWContext) uniDRICreateContextWithConfig(Display *dpy, int screen, int configID,
Display *dpy; XID context, drm_context_t *hHWContext)
int screen;
int configID;
XID context;
drm_context_t *hHWContext;
{ {
XExtDisplayInfo *info = find_display(dpy); XExtDisplayInfo *info = find_display(dpy);
xXF86DRICreateContextReply rep; xXF86DRICreateContextReply rep;
...@@ -366,12 +342,8 @@ uniDRICreateContextWithConfig(dpy, screen, configID, context, hHWContext) ...@@ -366,12 +342,8 @@ uniDRICreateContextWithConfig(dpy, screen, configID, context, hHWContext)
} }
Bool Bool
uniDRICreateContext(dpy, screen, visual, context, hHWContext) uniDRICreateContext(Display *dpy, int screen, Visual *visual,
Display *dpy; XID context, drm_context_t *hHWContext)
int screen;
Visual *visual;
XID context;
drm_context_t *hHWContext;
{ {
return uniDRICreateContextWithConfig(dpy, screen, return uniDRICreateContextWithConfig(dpy, screen,
visual->visualid, context, hHWContext); visual->visualid, context, hHWContext);
...@@ -539,16 +511,9 @@ uniDRIGetDrawableInfo(Display * dpy, int screen, Drawable drawable, ...@@ -539,16 +511,9 @@ uniDRIGetDrawableInfo(Display * dpy, int screen, Drawable drawable,
} }
Bool Bool
uniDRIGetDeviceInfo(dpy, screen, hFrameBuffer, uniDRIGetDeviceInfo(Display *dpy, int screen, drm_handle_t *hFrameBuffer,
fbOrigin, fbSize, fbStride, devPrivateSize, pDevPrivate) int *fbOrigin, int *fbSize, int *fbStride,
Display *dpy; int *devPrivateSize, void **pDevPrivate)
int screen;
drm_handle_t *hFrameBuffer;
int *fbOrigin;
int *fbSize;
int *fbStride;
int *devPrivateSize;
void **pDevPrivate;