Commit fffeffb8 authored by Austin Yuan's avatar Austin Yuan

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: default avatarZhaohan Ren <zhaohan.ren@intel.com>
Signed-off-by: default avatarAustin Yuan <shengquan.yuan@gmail.com>
parent e0e4c6b8
......@@ -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 */
......
# 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
# =====================================================
......
# 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.
# 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:
#
# 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.
# 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)
......
......@@ -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);
......
......@@ -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
......
......@@ -138,13 +138,14 @@ 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);
if (dri_state->fd >= 0);
close(dri_state->fd);
}
......
......@@ -57,6 +57,20 @@ do_drawable_hash(VADriverContextP ctx, XID drawable)
return dri_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)
{
......@@ -72,6 +86,8 @@ free_drawable_hashtable(VADriverContextP ctx)
dri_drawable = prev->next;
dri_state->destroyDrawable(ctx, prev);
}
dri_state->drawable_hash[i] = NULL;
}
}
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment