summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAustin Yuan <shengquan.yuan@intel.com>2009-11-20 16:10:30 +0800
committerAustin Yuan <shengquan.yuan@intel.com>2009-11-20 16:10:30 +0800
commit6ab152fe5d3a62df89f9b29e65d6dcf17c2b4841 (patch)
treec92102021d65e2d1bd51a054365afde5f58486cb /src
parent58f8cc670913b3338181136b5f7a865e0895cc04 (diff)
Sync with master
Signed-off-by: Austin Yuan <shengquan.yuan@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/va.c2
-rwxr-xr-xsrc/va.h4
-rw-r--r--src/x11/dri1_util.c1
-rw-r--r--src/x11/va_x11.c76
4 files changed, 19 insertions, 64 deletions
diff --git a/src/va.c b/src/va.c
index 2eaa966..6bc9c06 100644
--- a/src/va.c
+++ b/src/va.c
@@ -313,6 +313,8 @@ const char *vaErrorStr(VAStatus error_status)
return "resolution not supported";
case VA_STATUS_ERROR_UNIMPLEMENTED:
return "the requested function is not implemented";
+ case VA_STATUS_ERROR_SURFACE_IN_DISPLAYING:
+ return "surface is in displaying (may by overlay)" ;
case VA_STATUS_ERROR_UNKNOWN:
return "unknown libva error";
}
diff --git a/src/va.h b/src/va.h
index d3f901b..525e192 100755
--- a/src/va.h
+++ b/src/va.h
@@ -127,7 +127,8 @@ typedef int VAStatus; /* Return status type from functions */
#define VA_STATUS_ERROR_FLAG_NOT_SUPPORTED 0x00000011
#define VA_STATUS_ERROR_INVALID_PARAMETER 0x00000012
#define VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED 0x00000013
-#define VA_STATUS_ERROR_UNIMPLEMENTED 0x00000014
+#define VA_STATUS_ERROR_UNIMPLEMENTED 0x00000014
+#define VA_STATUS_ERROR_SURFACE_IN_DISPLAYING 0x00000015
#define VA_STATUS_ERROR_UNKNOWN 0xFFFFFFFF
/*
@@ -569,6 +570,7 @@ typedef struct _VASliceParameterBufferMPEG2
unsigned int slice_data_offset;/* the offset to the first byte of slice data */
unsigned int slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
unsigned int macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
+ unsigned int slice_horizontal_position;
unsigned int slice_vertical_position;
int quantiser_scale_code;
int intra_slice_flag;
diff --git a/src/x11/dri1_util.c b/src/x11/dri1_util.c
index b3db5b4..3e67e2a 100644
--- a/src/x11/dri1_util.c
+++ b/src/x11/dri1_util.c
@@ -107,7 +107,6 @@ isDRI1Connected(VADriverContextP ctx, char **driver_name)
dri_state->fd = drmOpenOnce(NULL, BusID, &newlyopened);
XFree(BusID);
- assert(dri_state->fd >= 0);
if (dri_state->fd < 0)
goto err_out1;
diff --git a/src/x11/va_x11.c b/src/x11/va_x11.c
index 9de904e..5908fbe 100644
--- a/src/x11/va_x11.c
+++ b/src/x11/va_x11.c
@@ -42,26 +42,6 @@
static VADisplayContextP pDisplayContexts = NULL;
-static void va_errorMessage(const char *msg, ...)
-{
- va_list args;
-
- fprintf(stderr, "libva error: ");
- va_start(args, msg);
- vfprintf(stderr, msg, args);
- va_end(args);
-}
-
-static void va_infoMessage(const char *msg, ...)
-{
- va_list args;
-
- fprintf(stderr, "libva: ");
- va_start(args, msg);
- vfprintf(stderr, msg, args);
- va_end(args);
-}
-
static int va_DisplayContextIsValid (
VADisplayContextP pDisplayContext
)
@@ -132,49 +112,21 @@ static VAStatus va_NVCTRL_GetDriverName (
)
{
VADriverContextP ctx = pDisplayContext->pDriverContext;
- VAStatus vaStatus = VA_STATUS_ERROR_UNKNOWN;
- int direct_capable;
- int driver_major;
- int driver_minor;
- int driver_patch;
- Bool result = True;
- char *nvidia_driver_name = NULL;
+ int direct_capable, driver_major, driver_minor, driver_patch;
+ Bool result;
- if (result)
- {
- result = VA_NVCTRLQueryDirectRenderingCapable(ctx->x11_dpy, ctx->x11_screen, &direct_capable);
- if (!result)
- {
- va_errorMessage("VA_NVCTRLQueryDirectRenderingCapable failed\n");
- }
- }
- if (result)
- {
- result = direct_capable;
- if (!result)
- {
- va_errorMessage("VA_NVCTRLQueryDirectRenderingCapable returned false\n");
- }
- }
- if (result)
- {
- result = VA_NVCTRLGetClientDriverName(ctx->x11_dpy, ctx->x11_screen, &driver_major, &driver_minor,
- &driver_patch, &nvidia_driver_name);
- if (!result)
- {
- va_errorMessage("VA_NVCTRLGetClientDriverName returned false\n");
- }
- }
- if (result)
- {
- vaStatus = VA_STATUS_SUCCESS;
- va_infoMessage("va_NVCTRL_GetDriverName: %d.%d.%d %s (screen %d)\n",
- driver_major, driver_minor, driver_patch,
- nvidia_driver_name, ctx->x11_screen);
- if (driver_name)
- *driver_name = nvidia_driver_name;
- }
- return vaStatus;
+ result = VA_NVCTRLQueryDirectRenderingCapable(ctx->x11_dpy, ctx->x11_screen,
+ &direct_capable);
+ if (!result || !direct_capable)
+ return VA_STATUS_ERROR_UNKNOWN;
+
+ result = VA_NVCTRLGetClientDriverName(ctx->x11_dpy, ctx->x11_screen,
+ &driver_major, &driver_minor,
+ &driver_patch, driver_name);
+ if (!result)
+ return VA_STATUS_ERROR_UNKNOWN;
+
+ return VA_STATUS_SUCCESS;
}
static VAStatus va_DisplayContextGetDriverName (