diff options
author | Zhenyu Wang <zhenyu.z.wang@intel.com> | 2007-08-08 09:22:42 +0800 |
---|---|---|
committer | Zhenyu Wang <zhenyu.z.wang@intel.com> | 2007-08-08 09:22:42 +0800 |
commit | 76c084d41999f13497b80d4ac6799cb974adaa03 (patch) | |
tree | 5c06019e14763fdcbbbd01e0cd1bbbda255af200 /src | |
parent | cfc614b1f9143ed1407733aaa81c4a980c613a63 (diff) |
explicit say "unsigned int"
Diffstat (limited to 'src')
-rw-r--r-- | src/i915_hwmc.c | 4 | ||||
-rw-r--r-- | src/i915_hwmc.h | 21 | ||||
-rw-r--r-- | src/xvmc/I915XvMC.c | 84 | ||||
-rw-r--r-- | src/xvmc/I915XvMC.h | 56 |
4 files changed, 82 insertions, 83 deletions
diff --git a/src/i915_hwmc.c b/src/i915_hwmc.c index 79fe2849..8ff18641 100644 --- a/src/i915_hwmc.c +++ b/src/i915_hwmc.c @@ -657,8 +657,8 @@ static int I915XvMCCreateSubpicture (ScrnInfoPtr pScrn, XvMCSubpicturePtr pSubp, I915XvMCSurfacePriv *sfpriv = NULL; I915XvMCCreateSurfaceRec *surfaceRec = NULL; XvMCContextPtr ctx = NULL; - unsigned srfno; - unsigned bufsize; + unsigned int srfno; + unsigned int bufsize; *priv = NULL; *num_priv = 0; diff --git a/src/i915_hwmc.h b/src/i915_hwmc.h index 61c7c4bc..597d30ce 100644 --- a/src/i915_hwmc.h +++ b/src/i915_hwmc.h @@ -47,12 +47,11 @@ typedef struct { - unsigned command; - unsigned ctxNo; - unsigned srfNo; - unsigned subPicNo; + unsigned int command; + unsigned int ctxNo; + unsigned int srfNo; + unsigned int subPicNo; int real_id; - unsigned pad; } I915XvMCCommandBuffer; struct hwmc_buffer @@ -65,7 +64,7 @@ struct hwmc_buffer typedef struct { - unsigned ctxno; /* XvMC private context reference number */ + unsigned int ctxno; /* XvMC private context reference number */ struct hwmc_buffer sis; struct hwmc_buffer ssb; struct hwmc_buffer msb; @@ -73,16 +72,16 @@ typedef struct struct hwmc_buffer psc; struct hwmc_buffer corrdata;/* Correction Data Buffer */ struct hwmc_buffer batchbuffer; - unsigned sarea_size; - unsigned sarea_priv_offset; - unsigned screen; - unsigned depth; + unsigned int sarea_size; + unsigned int sarea_priv_offset; + unsigned int screen; + unsigned int depth; int deviceID; } I915XvMCCreateContextRec; typedef struct { - unsigned srfno; + unsigned int srfno; struct hwmc_buffer srf; } I915XvMCCreateSurfaceRec; diff --git a/src/xvmc/I915XvMC.c b/src/xvmc/I915XvMC.c index 7040f6af..22718deb 100644 --- a/src/xvmc/I915XvMC.c +++ b/src/xvmc/I915XvMC.c @@ -66,7 +66,7 @@ SIZE_Y420(surface->width, surface->height)) /* Lookup tables to speed common calculations */ -_STATIC_ unsigned mb_bytes[] = { +_STATIC_ unsigned int mb_bytes[] = { 000, 128, 128, 256, 128, 256, 256, 384, // 0 128, 256, 256, 384, 256, 384, 384, 512, // 1 128, 256, 256, 384, 256, 384, 384, 512, // 10 @@ -86,13 +86,13 @@ _STATIC_ char I915KernelDriverName[] = "i915"; _STATIC_ int error_base; _STATIC_ int event_base; -_STATIC_ int findOverlap(unsigned width, unsigned height, +_STATIC_ int findOverlap(unsigned int width, unsigned int height, short *dstX, short *dstY, short *srcX, short *srcY, unsigned short *areaW, unsigned short *areaH) { int w, h; - unsigned mWidth, mHeight; + unsigned int mWidth, mHeight; w = *areaW; h = *areaH; @@ -128,7 +128,7 @@ _STATIC_ __inline__ void renderError(void) return; } -_STATIC_ void I915XvMCContendedLock(i915XvMCContext *pI915XvMC, unsigned flags) +_STATIC_ void I915XvMCContendedLock(i915XvMCContext *pI915XvMC, drmLockFlags flags) { drmGetLock(pI915XvMC->fd, pI915XvMC->hHWContext, flags); } @@ -202,16 +202,16 @@ _STATIC_ void i915_flush(i915XvMCContext *pI915XvMC, int map, int render) /* for MC picture rendering */ _STATIC_ void i915_mc_static_indirect_state_buffer(XvMCContext *context, XvMCSurface *surface, - unsigned picture_structure, - unsigned flags, - unsigned picture_coding_type) + unsigned int picture_structure, + unsigned int flags, + unsigned int picture_coding_type) { struct i915_3dstate_buffer_info *buffer_info; struct i915_3dstate_dest_buffer_variables *dest_buffer_variables; struct i915_3dstate_dest_buffer_variables_mpeg *dest_buffer_variables_mpeg; i915XvMCSurface *pI915Surface = (i915XvMCSurface *)surface->privData; i915XvMCContext *pI915XvMC = (i915XvMCContext *)context->privData; - unsigned w = surface->width, h = surface->height; + unsigned int w = surface->width, h = surface->height; /* 3DSTATE_BUFFER_INFO */ /* DEST Y */ @@ -334,7 +334,7 @@ _STATIC_ void i915_mc_map_state_buffer(XvMCContext *context, struct i915_3dstate_map_state *map_state; struct texture_map *tm; i915XvMCContext *pI915XvMC = (i915XvMCContext *)context->privData; - unsigned w = context->width, h = context->height; + unsigned int w = context->width, h = context->height; /* 3DSATE_MAP_STATE: Y */ map_state = (struct i915_3dstate_map_state *)pI915XvMC->msb.map; @@ -479,7 +479,7 @@ _STATIC_ void i915_mc_load_sis_msb_buffers(XvMCContext *context) msb_state *msb = NULL; i915XvMCContext *pI915XvMC = (i915XvMCContext *)context->privData; void *base = NULL; - unsigned size; + unsigned int size; int mem_select = 1; /* 3DSTATE_LOAD_INDIRECT */ @@ -624,7 +624,7 @@ _STATIC_ void i915_mc_mpeg_macroblock_1fbmv(XvMCContext *context, XvMCMacroBlock intelBatchbufferData(pI915XvMC, ¯oblock_1fbmv, sizeof(macroblock_1fbmv), 0); } -_STATIC_ void i915_mc_mpeg_macroblock_2fbmv(XvMCContext *context, XvMCMacroBlock *mb, unsigned ps) +_STATIC_ void i915_mc_mpeg_macroblock_2fbmv(XvMCContext *context, XvMCMacroBlock *mb, unsigned int ps) { struct i915_3dmpeg_macroblock_2fbmv macroblock_2fbmv; i915XvMCContext *pI915XvMC = (i915XvMCContext *)context->privData; @@ -761,12 +761,12 @@ _STATIC_ void i915_mc_sampler_state_buffer(XvMCContext *context) ts->ts2.default_color = 0; } -_STATIC_ void i915_inst_arith(unsigned *inst, - unsigned op, - unsigned dest, - unsigned mask, - unsigned saturate, - unsigned src0, unsigned src1, unsigned src2) +_STATIC_ void i915_inst_arith(unsigned int *inst, + unsigned int op, + unsigned int dest, + unsigned int mask, + unsigned int saturate, + unsigned int src0, unsigned int src1, unsigned int src2) { dest = UREG(GET_UREG_TYPE(dest), GET_UREG_NR(dest)); *inst = (op | A0_DEST(dest) | mask | saturate | A0_SRC0(src0)); @@ -776,12 +776,12 @@ _STATIC_ void i915_inst_arith(unsigned *inst, *inst = (A2_SRC1(src1) | A2_SRC2(src2)); } -_STATIC_ void i915_inst_decl(unsigned *inst, - unsigned type, - unsigned nr, - unsigned d0_flags) +_STATIC_ void i915_inst_decl(unsigned int *inst, + unsigned int type, + unsigned int nr, + unsigned int d0_flags) { - unsigned reg = UREG(type, nr); + unsigned int reg = UREG(type, nr); *inst = (D0_DCL | D0_DEST(reg) | d0_flags); inst++; @@ -790,11 +790,11 @@ _STATIC_ void i915_inst_decl(unsigned *inst, *inst = D2_MBZ; } -_STATIC_ void i915_inst_texld(unsigned *inst, - unsigned op, - unsigned dest, - unsigned coord, - unsigned sampler) +_STATIC_ void i915_inst_texld(unsigned int *inst, + unsigned int op, + unsigned int dest, + unsigned int coord, + unsigned int sampler) { dest = UREG(GET_UREG_TYPE(dest), GET_UREG_NR(dest)); *inst = (op | T0_DEST(dest) | T0_SAMPLER(sampler)); @@ -808,8 +808,8 @@ _STATIC_ void i915_mc_pixel_shader_program_buffer(XvMCContext *context) { struct i915_3dstate_pixel_shader_program *pixel_shader_program; i915XvMCContext *pI915XvMC = (i915XvMCContext *)context->privData; - unsigned *inst; - unsigned dest, src0, src1, src2; + unsigned int *inst; + unsigned int dest, src0, src1, src2; /* Shader 0 */ pixel_shader_program = (struct i915_3dstate_pixel_shader_program *)pI915XvMC->psp.map; @@ -819,7 +819,7 @@ _STATIC_ void i915_mc_pixel_shader_program_buffer(XvMCContext *context) pixel_shader_program->dw0.retain = 1; pixel_shader_program->dw0.length = 2; /* mov oC, c0.0000 */ - inst = (unsigned *)(++pixel_shader_program); + inst = (unsigned int*)(++pixel_shader_program); dest = UREG(REG_TYPE_OC, 0); src0 = UREG(REG_TYPE_CONST, 0); src1 = 0; @@ -836,7 +836,7 @@ _STATIC_ void i915_mc_pixel_shader_program_buffer(XvMCContext *context) pixel_shader_program->dw0.retain = 1; pixel_shader_program->dw0.length = 14; /* dcl t0.xy */ - inst = (unsigned *)(++pixel_shader_program); + inst = (unsigned int*)(++pixel_shader_program); i915_inst_decl(inst, REG_TYPE_T, T_TEX0, D0_CHANNEL_XY); /* dcl t1.xy */ inst += 3; @@ -867,7 +867,7 @@ _STATIC_ void i915_mc_pixel_shader_program_buffer(XvMCContext *context) pixel_shader_program->dw0.retain = 1; pixel_shader_program->dw0.length = 14; /* dcl t2.xy */ - inst = (unsigned *)(++pixel_shader_program); + inst = (unsigned int*)(++pixel_shader_program); i915_inst_decl(inst, REG_TYPE_T, T_TEX2, D0_CHANNEL_XY); /* dcl t3.xy */ inst += 3; @@ -898,7 +898,7 @@ _STATIC_ void i915_mc_pixel_shader_program_buffer(XvMCContext *context) pixel_shader_program->dw0.retain = 1; pixel_shader_program->dw0.length = 29; /* dcl t0.xy */ - inst = (unsigned *)(++pixel_shader_program); + inst = (unsigned int*)(++pixel_shader_program); i915_inst_decl(inst, REG_TYPE_T, T_TEX0, D0_CHANNEL_XY); /* dcl t1.xy */ inst += 3; @@ -976,7 +976,7 @@ _STATIC_ void i915_mc_one_time_state_initialization(XvMCContext *context) psp_state *psp = NULL; psc_state *psc = NULL; i915XvMCContext *pI915XvMC = (i915XvMCContext *)context->privData; - unsigned size; + unsigned int size; void *base = NULL; int mem_select = 1; @@ -1077,7 +1077,7 @@ _STATIC_ void i915_mc_one_time_state_initialization(XvMCContext *context) free(base); } -_STATIC_ void i915_mc_invalidate_subcontext_buffers(XvMCContext *context, unsigned mask) +_STATIC_ void i915_mc_invalidate_subcontext_buffers(XvMCContext *context, unsigned int mask) { struct i915_3dstate_load_indirect *load_indirect = NULL; sis_state *sis = NULL; @@ -1087,7 +1087,7 @@ _STATIC_ void i915_mc_invalidate_subcontext_buffers(XvMCContext *context, unsign psp_state *psp = NULL; psc_state *psc = NULL; i915XvMCContext *pI915XvMC = (i915XvMCContext *)context->privData; - unsigned size; + unsigned int size; void *base = NULL, *ptr = NULL; size = sizeof(*load_indirect); @@ -1286,7 +1286,7 @@ _STATIC_ void i915_yuv2rgb_map_state_buffer(XvMCSurface *target_surface) struct texture_map *tm; i915XvMCSurface *privTarget = NULL; i915XvMCContext *pI915XvMC = NULL; - unsigned w = target_surface->width, h = target_surface->height; + unsigned int w = target_surface->width, h = target_surface->height; privTarget = (i915XvMCSurface *)target_surface->privData; pI915XvMC = (i915XvMCContext *)privTarget->privContext; @@ -1452,7 +1452,7 @@ _STATIC_ void i915_yuv2rgb_sampler_state_buffer(XvMCSurface *surface) } _STATIC_ void i915_yuv2rgb_static_indirect_state_buffer(XvMCSurface *surface, - unsigned dstaddr, + unsigned int dstaddr, int dstpitch) { struct i915_3dstate_buffer_info *buffer_info; @@ -1490,8 +1490,8 @@ _STATIC_ void i915_yuv2rgb_pixel_shader_program_buffer(XvMCSurface *surface) struct i915_3dstate_pixel_shader_program *pixel_shader_program; i915XvMCSurface *privSurface = (i915XvMCSurface *)surface->privData; i915XvMCContext *pI915XvMC = (i915XvMCContext *)privSurface->privContext; - unsigned *inst; - unsigned dest, src0, src1; + unsigned int *inst; + unsigned int dest, src0, src1; /* Shader 0 */ pixel_shader_program = (struct i915_3dstate_pixel_shader_program *)pI915XvMC->psp.map; @@ -1501,7 +1501,7 @@ _STATIC_ void i915_yuv2rgb_pixel_shader_program_buffer(XvMCSurface *surface) pixel_shader_program->dw0.retain = 0; pixel_shader_program->dw0.length = 23; /* dcl t0.xy */ - inst = (unsigned *)(++pixel_shader_program); + inst = (unsigned int*)(++pixel_shader_program); i915_inst_decl(inst, REG_TYPE_T, T_TEX0, D0_CHANNEL_XY); /* dcl t1.xy */ inst += 3; @@ -1554,7 +1554,7 @@ _STATIC_ void i915_yuv2rgb_proc(XvMCSurface *surface) psp_state *psp = NULL; struct i915_3dprimitive *_3dprimitive = NULL; struct vertex_data *vd = NULL; - unsigned size; + unsigned int size; void *base = NULL; /* 3DSTATE_LOAD_STATE_IMMEDIATE_1 */ diff --git a/src/xvmc/I915XvMC.h b/src/xvmc/I915XvMC.h index 3a83edca..78aea7d2 100644 --- a/src/xvmc/I915XvMC.h +++ b/src/xvmc/I915XvMC.h @@ -66,13 +66,13 @@ typedef struct _i915XvMCDrmMap { // pointer in the XvMCContext structure. ***************************************************************************/ typedef struct _i915XvMCContext { - unsigned ctxno; + unsigned int ctxno; int fd; /* File descriptor for /dev/dri */ - unsigned last_render; - unsigned last_flip; - unsigned dual_prime; /* Flag to identify when dual prime is in use. */ - unsigned yStride; - unsigned uvStride; + unsigned int last_render; + unsigned int last_flip; + unsigned int dual_prime; /* Flag to identify when dual prime is in use. */ + unsigned int yStride; + unsigned int uvStride; unsigned short ref; pthread_mutex_t ctxmutex; char busIdString[21]; /* PCI:0:1:0 or PCI:0:2:0 */ @@ -84,10 +84,10 @@ typedef struct _i915XvMCContext { drm_context_t hHWContext; /* drmcontext; */ drm_handle_t hsarea; /* Handle to drm shared memory area */ drmAddress sarea_address; /* Virtual address of shared memory area */ - unsigned sarea_size; /* Size of drm shared memory area */ - unsigned sarea_priv_offset; /* Offset in sarea to private part */ - unsigned screen; - unsigned depth; + unsigned int sarea_size; /* Size of drm shared memory area */ + unsigned int sarea_priv_offset; /* Offset in sarea to private part */ + unsigned int screen; + unsigned int depth; XvPortID port; /* Xv Port ID when displaying */ int haveXv; /* Have I initialized the Xv * connection for this surface? */ @@ -112,19 +112,19 @@ typedef struct _i915XvMCContext { sigset_t sa_mask; struct { - unsigned start_offset; - unsigned size; - unsigned space; + unsigned int start_offset; + unsigned int size; + unsigned int space; unsigned char *ptr; } batch; struct { void *ptr; - unsigned size; - unsigned offset; - unsigned active_buf; - unsigned irq_emitted; + unsigned int size; + unsigned int offset; + unsigned int active_buf; + unsigned int irq_emitted; } alloc; } i915XvMCContext; @@ -134,10 +134,10 @@ typedef struct _i915XvMCContext { // structure. ***************************************************************************/ typedef struct _i915XvMCSubpicture { - unsigned srfNo; - unsigned last_render; - unsigned last_flip; - unsigned pitch; + unsigned int srfNo; + unsigned int last_render; + unsigned int last_flip; + unsigned int pitch; unsigned char palette[3][16]; i915XvMCDrmMap srf; i915XvMCContext *privContext; @@ -150,13 +150,13 @@ typedef struct _i915XvMCSubpicture { ***************************************************************************/ #define I830_MAX_BUFS 2 /*Number of YUV buffers per surface */ typedef struct _i915XvMCSurface { - unsigned srfNo; /* XvMC private surface numbers */ - unsigned last_render; - unsigned last_flip; - unsigned yStride; /* Stride of YUV420 Y component. */ - unsigned uvStride; - unsigned width; /* Dimensions */ - unsigned height; + unsigned int srfNo; /* XvMC private surface numbers */ + unsigned int last_render; + unsigned int last_flip; + unsigned int yStride; /* Stride of YUV420 Y component. */ + unsigned int uvStride; + unsigned int width; /* Dimensions */ + unsigned int height; i915XvMCDrmMap srf; i915XvMCContext *privContext; i915XvMCSubpicture *privSubPic; /* Subpicture to be blended when |