summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Yuan <shengquan.yuan@gmail.com>2011-05-30 19:02:25 -0700
committerAustin Yuan <shengquan.yuan@gmail.com>2011-05-30 19:02:25 -0700
commitfffeffb8a78fffbb6a7ddf587554f7d2d76aa692 (patch)
tree3decb407ed5b9c7296f3b9715d0aac15487fac48
parente0e4c6b8931cc3c658330d65257e5f766c1c376c (diff)
libva: several changes
1) add free_drawable 2) clean the license of Android.mk 3) define VA_ROTATION_270 to 3 instead of 4 Signed-off-by: Zhaohan Ren <zhaohan.ren@intel.com> Signed-off-by: Austin Yuan <shengquan.yuan@gmail.com>
-rw-r--r--dummy_drv_video/dummy_drv_video.c1
-rwxr-xr-xva/Android.mk22
-rw-r--r--va/android/Makefile.am38
-rw-r--r--va/android/va_android.cpp3
-rw-r--r--va/va.h2
-rw-r--r--va/x11/dri2_util.c7
-rw-r--r--va/x11/va_dricommon.c16
-rw-r--r--va/x11/va_dricommon.h1
8 files changed, 67 insertions, 23 deletions
diff --git a/dummy_drv_video/dummy_drv_video.c b/dummy_drv_video/dummy_drv_video.c
index f06cc0a..310fb20 100644
--- a/dummy_drv_video/dummy_drv_video.c
+++ b/dummy_drv_video/dummy_drv_video.c
@@ -1114,7 +1114,6 @@ VAStatus dummy_SetDisplayAttributes (
VAStatus dummy_BufferInfo(
VADriverContextP ctx,
- VAContextID context, /* in */
VABufferID buf_id, /* in */
VABufferType *type, /* out */
unsigned int *size, /* out */
diff --git a/va/Android.mk b/va/Android.mk
index a5ff8d2..0f73a3e 100755
--- a/va/Android.mk
+++ b/va/Android.mk
@@ -1,3 +1,25 @@
+# Copyright (c) 2007 Intel Corporation. All Rights Reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sub license, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice (including the
+# next paragraph) shall be included in all copies or substantial portions
+# of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+# IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
# For libva
# =====================================================
diff --git a/va/android/Makefile.am b/va/android/Makefile.am
index f7ca6f1..8e532ac 100644
--- a/va/android/Makefile.am
+++ b/va/android/Makefile.am
@@ -1,22 +1,24 @@
-# INTEL CONFIDENTIAL
-# Copyright 2007 Intel Corporation. All Rights Reserved.
+# Copyright (c) 2007 Intel Corporation. All Rights Reserved.
#
-# The source code contained or described herein and all documents related to
-# the source code ("Material") are owned by Intel Corporation or its suppliers
-# or licensors. Title to the Material remains with Intel Corporation or its
-# suppliers and licensors. The Material may contain trade secrets and
-# proprietary and confidential information of Intel Corporation and its
-# suppliers and licensors, and is protected by worldwide copyright and trade
-# secret laws and treaty provisions. No part of the Material may be used,
-# copied, reproduced, modified, published, uploaded, posted, transmitted,
-# distributed, or disclosed in any way without Intel's prior express written
-# permission.
-#
-# No license under any patent, copyright, trade secret or other intellectual
-# property right is granted to or conferred upon you by disclosure or delivery
-# of the Materials, either expressly, by implication, inducement, estoppel or
-# otherwise. Any license under such intellectual property rights must be
-# express and approved by Intel in writing.
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sub license, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice (including the
+# next paragraph) shall be included in all copies or substantial portions
+# of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+# IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
AM_CFLAGS = -DLINUX -I$(top_srcdir)/va -I$(top_srcdir)/va/x11 $(DRM_CFLAGS)
diff --git a/va/android/va_android.cpp b/va/android/va_android.cpp
index c0c2ded..190d444 100644
--- a/va/android/va_android.cpp
+++ b/va/android/va_android.cpp
@@ -321,6 +321,9 @@ VAStatus vaPutSurface (
if (fool_postp)
return VA_STATUS_SUCCESS;
+ if (draw == NULL)
+ return VA_STATUS_ERROR_UNKNOWN;
+
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
diff --git a/va/va.h b/va/va.h
index a194896..facae17 100644
--- a/va/va.h
+++ b/va/va.h
@@ -1845,7 +1845,7 @@ typedef enum
#define VA_ROTATION_NONE 0x00000000
#define VA_ROTATION_90 0x00000001
#define VA_ROTATION_180 0x00000002
-#define VA_ROTATION_270 0x00000004
+#define VA_ROTATION_270 0x00000003
/* attribute value for VADisplayAttribOutOfLoopDeblock */
#define VA_OOL_DEBLOCKING_FALSE 0x00000000
diff --git a/va/x11/dri2_util.c b/va/x11/dri2_util.c
index 0309c0f..298cd31 100644
--- a/va/x11/dri2_util.c
+++ b/va/x11/dri2_util.c
@@ -138,14 +138,15 @@ dri2GetRenderingBuffer(VADriverContextP ctx, struct dri_drawable *dri_drawable)
return &dri2_drawable->buffers[dri2_drawable->front_index];
}
-static void
+void
dri2Close(VADriverContextP ctx)
{
struct dri_state *dri_state = (struct dri_state *)ctx->dri_state;
free_drawable_hashtable(ctx);
- assert(dri_state->fd >= 0);
- close(dri_state->fd);
+
+ if (dri_state->fd >= 0);
+ close(dri_state->fd);
}
Bool
diff --git a/va/x11/va_dricommon.c b/va/x11/va_dricommon.c
index 71f9705..bd30aab 100644
--- a/va/x11/va_dricommon.c
+++ b/va/x11/va_dricommon.c
@@ -58,6 +58,20 @@ do_drawable_hash(VADriverContextP ctx, XID drawable)
}
void
+free_drawable(VADriverContextP ctx, struct dri_drawable* dri_drawable)
+{
+ struct dri_state *dri_state = (struct dri_state *)ctx->dri_state;
+ int i = 0;
+
+ while (i++ < DRAWABLE_HASH_SZ) {
+ if (dri_drawable == dri_state->drawable_hash[i]) {
+ dri_state->destroyDrawable(ctx, dri_drawable);
+ dri_state->drawable_hash[i] = NULL;
+ }
+ }
+}
+
+void
free_drawable_hashtable(VADriverContextP ctx)
{
struct dri_state *dri_state = (struct dri_state *)ctx->dri_state;
@@ -72,6 +86,8 @@ free_drawable_hashtable(VADriverContextP ctx)
dri_drawable = prev->next;
dri_state->destroyDrawable(ctx, prev);
}
+
+ dri_state->drawable_hash[i] = NULL;
}
}
diff --git a/va/x11/va_dricommon.h b/va/x11/va_dricommon.h
index 0f8a1db..357cc8e 100644
--- a/va/x11/va_dricommon.h
+++ b/va/x11/va_dricommon.h
@@ -70,6 +70,7 @@ struct dri_state
Bool isDRI2Connected(VADriverContextP ctx, char **driver_name);
Bool isDRI1Connected(VADriverContextP ctx, char **driver_name);
+void free_drawable(VADriverContextP ctx, struct dri_drawable* dri_drawable);
void free_drawable_hashtable(VADriverContextP ctx);
struct dri_drawable *dri_get_drawable(VADriverContextP ctx, XID drawable);
void dri_swap_buffer(VADriverContextP ctx, struct dri_drawable *dri_drawable);