diff options
Diffstat (limited to 'src/xvmc/radeon_xvmc.c')
-rw-r--r-- | src/xvmc/radeon_xvmc.c | 479 |
1 files changed, 442 insertions, 37 deletions
diff --git a/src/xvmc/radeon_xvmc.c b/src/xvmc/radeon_xvmc.c index 452cce1..cac6a35 100644 --- a/src/xvmc/radeon_xvmc.c +++ b/src/xvmc/radeon_xvmc.c @@ -25,64 +25,469 @@ */ #include "radeon_xvmc.h" -#include "radeon_hwmc.h" +#include "r500_hwmc.h" -static Status radeon_xvmc_create_context(Display *display, XvMCContext *context, - int priv_count, CARD32 *priv_data) +/* +* Function: XvMCCreateContext +* Description: Create a XvMC context for the given surface parameters. +* Arguments: +* display - Connection to the X server. +* port - XvPortID to use as avertised by the X connection. +* surface_type_id - Unique identifier for the Surface type. +* width - Width of the surfaces. +* height - Height of the surfaces. +* flags - one or more of the following +* XVMC_DIRECT - A direct rendered context is requested. +* +* Notes: surface_type_id and width/height parameters must match those +* returned by XvMCListSurfaceTypes. +* Returns: Status +*/ +_X_EXPORT Status XvMCCreateContext(Display *display, XvPortID port, + int surface_type_id, int width, int height, + int flags, XvMCContext *context) +{ +} + +/* + * Function: XvMCDestroyContext + * Description: Destorys the specified context. + * + * Arguments: + * display - Specifies the connection to the server. + * context - The context to be destroyed. + * + */ +_X_EXPORT Status XvMCDestroyContext(Display *display, XvMCContext *context) +{ +} + +/* + * Function: XvMCCreateSurface + */ +_X_EXPORT Status XvMCCreateSurface(Display *display, XvMCContext *context, XvMCSurface *surface) +{ +} + +/* + * Function: XvMCDestroySurface + */ +_X_EXPORT Status XvMCDestroySurface(Display *display, XvMCSurface *surface) +{ +} + +/* + * Function: XvMCCreateBlocks + */ +_X_EXPORT Status XvMCCreateBlocks(Display *display, XvMCContext *context, + unsigned int num_blocks, + XvMCBlockArray *block) +{ +} + +/* + * Function: XvMCDestroyBlocks + */ +_X_EXPORT Status XvMCDestroyBlocks(Display *display, XvMCBlockArray *block) +{ +} + +/* + * Function: XvMCCreateMacroBlocks + */ +_X_EXPORT Status XvMCCreateMacroBlocks(Display *display, XvMCContext *context, + unsigned int num_blocks, + XvMCMacroBlockArray *blocks) +{ +} + +/* + * Function: XvMCDestroyMacroBlocks + */ +_X_EXPORT Status XvMCDestroyMacroBlocks(Display *display, XvMCMacroBlockArray *block) +{ +} + +/* + * Function: XvMCRenderSurface + * + * Description: This function does the actual HWMC. Given a list of + * macroblock structures it dispatched the hardware commands to execute + * them. + */ +_X_EXPORT Status XvMCRenderSurface(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) +{ +} + +/* + * Function: XvMCPutSurface + * + * Description: + * Arguments: + * display: Connection to X server + * surface: Surface to be displayed + * draw: X Drawable on which to display the surface + * srcx: X coordinate of the top left corner of the region to be + * displayed within the surface. + * srcy: Y coordinate of the top left corner of the region to be + * displayed within the surface. + * srcw: Width of the region to be displayed. + * srch: Height of the region to be displayed. + * destx: X cordinate of the top left corner of the destination region + * in the drawable coordinates. + * desty: Y cordinate of the top left corner of the destination region + * in the drawable coordinates. + * destw: Width of the destination region. + * desth: Height of the destination region. + * flags: One or more of the following. + * XVMC_TOP_FIELD - Display only the Top field of the surface. + * XVMC_BOTTOM_FIELD - Display only the Bottom Field of the surface. + * XVMC_FRAME_PICTURE - Display both fields or frame. + */ +_X_EXPORT Status XvMCPutSurface(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) +{ +} + +/* + * Function: XvMCSyncSurface + * Arguments: + * display - Connection to the X server + * surface - The surface to synchronize + */ +_X_EXPORT Status XvMCSyncSurface(Display *display, XvMCSurface *surface) +{ +} + +/* + * Function: XvMCFlushSurface + * Description: + * This function commits pending rendering requests to ensure that they + * wll be completed in a finite amount of time. + * Arguments: + * display - Connection to X server + * surface - Surface to flush + * Returns: Status + */ +_X_EXPORT Status XvMCFlushSurface(Display * display, XvMCSurface *surface) +{ +} + +/* + * Function: XvMCGetSurfaceStatus + * Description: + * Arguments: + * display: connection to X server + * surface: The surface to query + * stat: One of the Following + * XVMC_RENDERING - The last XvMCRenderSurface command has not + * completed. + * XVMC_DISPLAYING - The surface is currently being displayed or a + * display is pending. + */ +_X_EXPORT Status XvMCGetSurfaceStatus(Display *display, XvMCSurface *surface, int *stat) +{ +} + +/* + * Function: XvMCHideSurface + * Description: Stops the display of a surface. + * Arguments: + * display - Connection to the X server. + * surface - surface to be hidden. + * + * Returns: Status + */ +_X_EXPORT Status XvMCHideSurface(Display *display, XvMCSurface *surface) { } -static int radeon_xvmc_destroy_context(Display *display, XvMCContext *context) +/* + * Function: XvMCCreateSubpicture + * Description: This creates a subpicture by filling out the XvMCSubpicture + * structure passed to it and returning Success. + * Arguments: + * display - Connection to the X server. + * context - The context to create the subpicture for. + * subpicture - Pre-allocated XvMCSubpicture structure to be filled in. + * width - of subpicture + * height - of subpicture + * xvimage_id - The id describing the XvImage format. + * + * Returns: Status + */ +_X_EXPORT Status XvMCCreateSubpicture(Display *display, XvMCContext *context, + XvMCSubpicture *subpicture, + unsigned short width, unsigned short height, + int xvimage_id) { } -static Status radeon_xvmc_create_surface(Display *display, XvMCContext *context, - XvMCSurface *surface, int priv_count, - CARD32 *priv_data) +/* + * Function: XvMCClearSubpicture + * Description: Clear the area of the given subpicture to "color". + * structure passed to it and returning Success. + * Arguments: + * display - Connection to the X server. + * subpicture - Subpicture to clear. + * x, y, width, height - rectangle in the subpicture to clear. + * color - The data to file the rectangle with. + * + * Returns: Status + */ +_X_EXPORT Status XvMCClearSubpicture(Display *display, XvMCSubpicture *subpicture, + short x, short y, + unsigned short width, unsigned short height, + unsigned int color) { } -static int radeon_xvmc_destroy_surface(Display *display, XvMCSurface *surface) +/* + * Function: XvMCCompositeSubpicture + * Description: Composite the XvImae on the subpicture. This composit uses + * non-premultiplied alpha. Destination alpha is utilized + * except for with indexed subpictures. Indexed subpictures + * use a simple "replace". + * Arguments: + * display - Connection to the X server. + * subpicture - Subpicture to clear. + * image - the XvImage to be used as the source of the composite. + * srcx, srcy, width, height - The rectangle from the image to be used. + * dstx, dsty - location in the subpicture to composite the source. + * + * Returns: Status + */ +_X_EXPORT Status XvMCCompositeSubpicture(Display *display, XvMCSubpicture *subpicture, + XvImage *image, + short srcx, short srcy, + unsigned short width, unsigned short height, + short dstx, short dsty) { } -static int radeon_xvmc_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) +/* + * Function: XvMCDestroySubpicture + * Description: Destroys the specified subpicture. + * Arguments: + * display - Connection to the X server. + * subpicture - Subpicture to be destroyed. + * + * Returns: Status + */ +_X_EXPORT Status XvMCDestroySubpicture(Display *display, XvMCSubpicture *subpicture) { + return BadValue; } -static int radeon_xvmc_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, struct intel_xvmc_command *data) +/* + * Function: XvMCSetSubpicturePalette + * Description: Set the subpictures palette + * Arguments: + * display - Connection to the X server. + * subpicture - Subpiture to set palette for. + * palette - A pointer to an array holding the palette data. The array + * is num_palette_entries * entry_bytes in size. + * Returns: Status + */ +_X_EXPORT Status XvMCSetSubpicturePalette(Display *display, XvMCSubpicture *subpicture, + unsigned char *palette) { + return BadValue; } -static int radeon_xvmc_get_surface_status(Display *display, - XvMCSurface *surface, int *stat) +/* + * Function: XvMCBlendSubpicture + * Description: + * The behavior of this function is different depending on whether + * or not the XVMC_BACKEND_SUBPICTURE flag is set in the XvMCSurfaceInfo. + * i915 only support frontend behavior. + * + * XVMC_BACKEND_SUBPICTURE not set ("frontend" behavior): + * + * XvMCBlendSubpicture is a no-op in this case. + * + * Arguments: + * display - Connection to the X server. + * subpicture - The subpicture to be blended into the video. + * target_surface - The surface to be displayed with the blended subpic. + * source_surface - Source surface prior to blending. + * subx, suby, subw, subh - The rectangle from the subpicture to use. + * surfx, surfy, surfw, surfh - The rectangle in the surface to blend + * blend the subpicture rectangle into. Scaling can ocure if + * XVMC_SUBPICTURE_INDEPENDENT_SCALING is set. + * + * Returns: Status + */ +_X_EXPORT Status XvMCBlendSubpicture(Display *display, XvMCSurface *target_surface, + XvMCSubpicture *subpicture, + short subx, short suby, + unsigned short subw, unsigned short subh, + short surfx, short surfy, + unsigned short surfw, unsigned short surfh) { + return BadValue; } -struct _radeon_xvmc_driver_rec radeon_xvmc_driver = +/* + * Function: XvMCBlendSubpicture2 + * Description: + * The behavior of this function is different depending on whether + * or not the XVMC_BACKEND_SUBPICTURE flag is set in the XvMCSurfaceInfo. + * i915 only supports frontend blending. + * + * XVMC_BACKEND_SUBPICTURE not set ("frontend" behavior): + * + * XvMCBlendSubpicture2 blends the source_surface and subpicture and + * puts it in the target_surface. This does not effect the status of + * the source surface but will cause the target_surface to query + * XVMC_RENDERING until the blend is completed. + * + * Arguments: + * display - Connection to the X server. + * subpicture - The subpicture to be blended into the video. + * target_surface - The surface to be displayed with the blended subpic. + * source_surface - Source surface prior to blending. + * subx, suby, subw, subh - The rectangle from the subpicture to use. + * surfx, surfy, surfw, surfh - The rectangle in the surface to blend + * blend the subpicture rectangle into. Scaling can ocure if + * XVMC_SUBPICTURE_INDEPENDENT_SCALING is set. + * + * Returns: Status + */ +_X_EXPORT Status XvMCBlendSubpicture2(Display *display, + XvMCSurface *source_surface, + XvMCSurface *target_surface, + XvMCSubpicture *subpicture, + short subx, short suby, + unsigned short subw, unsigned short subh, + short surfx, short surfy, + unsigned short surfw, unsigned short surfh) +{ + return BadValue; +} + +/* + * Function: XvMCSyncSubpicture + * Description: This function blocks until all composite/clear requests on + * the subpicture have been complete. + * Arguments: + * display - Connection to the X server. + * subpicture - The subpicture to synchronize + * + * Returns: Status + */ +_X_EXPORT Status XvMCSyncSubpicture(Display *display, XvMCSubpicture *subpicture) { - .type = XVMC_RADEON_MPEG2_MC, - .num_ctx = 0, - .create_context = radeon_xvmc_create_context, - .destroy_context = radeon_xvmc_destroy_context, - .create_surface = radeon_xvmc_create_surface, - .destroy_surface = radeon_xvmc_destroy_surface, - .render_surface = radeon_xvmc_render_surface, - .put_surface = radeon_xvmc_put_surface, - .get_surface_status = radeon_xvmc_get_surface_status, -}; + return BadValue; +} + +/* + * Function: XvMCFlushSubpicture + * Description: This function commits pending composite/clear requests to + * ensure that they will be completed in a finite amount of + * time. + * Arguments: + * display - Connection to the X server. + * subpicture - The subpicture whos compsiting should be flushed + * + * Returns: Status + */ +_X_EXPORT Status XvMCFlushSubpicture(Display *display, XvMCSubpicture *subpicture) +{ + return BadValue; +} + +/* + * Function: XvMCGetSubpictureStatus + * Description: This function gets the current status of a subpicture + * + * Arguments: + * display - Connection to the X server. + * subpicture - The subpicture whos status is being queried + * stat - The status of the subpicture. It can be any of the following + * OR'd together: + * XVMC_RENDERING - Last composite or clear request not completed + * XVMC_DISPLAYING - Suppicture currently being displayed. + * + * Returns: Status + */ +_X_EXPORT Status XvMCGetSubpictureStatus(Display *display, XvMCSubpicture *subpicture, + int *stat) +{ + return BadValue; +} + +/* + * Function: XvMCQueryAttributes + * Description: An array of XvAttributes of size "number" is returned by + * this function. If there are no attributes, NULL is returned and number + * is set to 0. The array may be freed with xfree(). + * + * Arguments: + * display - Connection to the X server. + * context - The context whos attributes we are querying. + * number - The returned number of recognized atoms + * + * Returns: + * An array of XvAttributes. + */ +_X_EXPORT XvAttribute *XvMCQueryAttributes(Display *display, XvMCContext *context, + int *number) +{ + /* now XvMC has no extra attribs than Xv */ + *number = 0; + return NULL; +} + +/* + * Function: XvMCSetAttribute + * Description: This function sets a context-specific attribute. + * + * Arguments: + * display - Connection to the X server. + * context - The context whos attributes we are querying. + * attribute - The X atom of the attribute to be changed. + * value - The new value for the attribute. + * + * Returns: + * Status + */ +_X_EXPORT Status XvMCSetAttribute(Display *display, XvMCContext *context, + Atom attribute, int value) +{ + return Success; +} + +/* + * Function: XvMCGetAttribute + * Description: This function queries a context-specific attribute and + * returns the value. + * + * Arguments: + * display - Connection to the X server. + * context - The context whos attributes we are querying. + * attribute - The X atom of the attribute to be queried + * value - The returned attribute value + * + * Returns: + * Status + */ +_X_EXPORT Status XvMCGetAttribute(Display *display, XvMCContext *context, + Atom attribute, int *value) +{ + return Success; +} |