Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libva
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
libva
Commits
1587cb78
Commit
1587cb78
authored
May 13, 2011
by
Xiang, Haihao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
i965_drv_vidoe: thread safety for rendering
parent
db1a88d1
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
8 deletions
+81
-8
i965_drv_video/Makefile.am
i965_drv_video/Makefile.am
+4
-2
i965_drv_video/i965_drv_video.c
i965_drv_video/i965_drv_video.c
+7
-0
i965_drv_video/i965_drv_video.h
i965_drv_video/i965_drv_video.h
+2
-1
i965_drv_video/i965_mutext.h
i965_drv_video/i965_mutext.h
+52
-0
i965_drv_video/intel_compiler.h
i965_drv_video/intel_compiler.h
+15
-0
i965_drv_video/intel_driver.h
i965_drv_video/intel_driver.h
+1
-5
No files found.
i965_drv_video/Makefile.am
View file @
1587cb78
...
...
@@ -22,7 +22,7 @@
SUBDIRS
=
shaders
AM_CFLAGS
=
-Wall
-I
$(top_srcdir)
-I
$(top_srcdir)
/va
-I
$(top_srcdir)
/va/x11 @DRM_CFLAGS@
AM_CFLAGS
=
-Wall
-I
$(top_srcdir)
-I
$(top_srcdir)
/va
-I
$(top_srcdir)
/va/x11
-DPTHREADS
@DRM_CFLAGS@
i965_drv_video_la_LTLIBRARIES
=
i965_drv_video.la
i965_drv_video_ladir
=
@LIBVA_DRIVERS_PATH@
...
...
@@ -69,4 +69,6 @@ noinst_HEADERS = \
gen6_mfd.h
\
i965_encoder.h
\
gen6_vme.h
\
gen6_mfc.h
gen6_mfc.h
\
intel_compiler.h
\
i965_mutext.h
i965_drv_video/i965_drv_video.c
View file @
1587cb78
...
...
@@ -1649,6 +1649,7 @@ i965_Init(VADriverContextP ctx)
if
(
i965_render_init
(
ctx
)
==
False
)
return
VA_STATUS_ERROR_UNKNOWN
;
_i965InitMutex
(
&
i965
->
render_mutex
);
i965
->
batch
=
intel_batchbuffer_new
(
&
i965
->
intel
,
I915_EXEC_RENDER
);
return
VA_STATUS_SUCCESS
;
...
...
@@ -2228,6 +2229,8 @@ i965_PutSurface(VADriverContextP ctx,
if
(
!
obj_surface
||
!
obj_surface
->
bo
)
return
VA_STATUS_SUCCESS
;
_i965LockMutex
(
&
i965
->
render_mutex
);
dri_drawable
=
dri_get_drawable
(
ctx
,
(
Drawable
)
draw
);
assert
(
dri_drawable
);
...
...
@@ -2295,6 +2298,8 @@ i965_PutSurface(VADriverContextP ctx,
obj_surface
->
free_private_data
(
&
obj_surface
->
private_data
);
}
_i965UnlockMutex
(
&
i965
->
render_mutex
);
return
VA_STATUS_SUCCESS
;
}
...
...
@@ -2306,6 +2311,8 @@ i965_Terminate(VADriverContextP ctx)
if
(
i965
->
batch
)
intel_batchbuffer_free
(
i965
->
batch
);
_i965DestroyMutex
(
&
i965
->
render_mutex
);
if
(
i965_render_terminate
(
ctx
)
==
False
)
return
VA_STATUS_ERROR_UNKNOWN
;
...
...
i965_drv_video/i965_drv_video.h
View file @
1587cb78
...
...
@@ -33,8 +33,8 @@
#include <va/va.h>
#include <va/va_backend.h>
#include "i965_mutext.h"
#include "object_heap.h"
#include "intel_driver.h"
#define I965_MAX_PROFILES 11
...
...
@@ -217,6 +217,7 @@ struct i965_driver_data
struct
object_heap
subpic_heap
;
struct
hw_codec_info
*
codec_info
;
_I965Mutex
render_mutex
;
struct
intel_batchbuffer
*
batch
;
struct
i965_render_state
render_state
;
void
*
pp_context
;
...
...
i965_drv_video/i965_mutext.h
0 → 100644
View file @
1587cb78
#ifndef _I965_MUTEX_H_
#define _I965_MUTEX_H_
#include "intel_compiler.h"
#if defined PTHREADS
#include <pthread.h>
typedef
pthread_mutex_t
_I965Mutex
;
static
INLINE
void
_i965InitMutex
(
_I965Mutex
*
m
)
{
pthread_mutex_init
(
m
,
NULL
);
}
static
INLINE
void
_i965DestroyMutex
(
_I965Mutex
*
m
)
{
pthread_mutex_destroy
(
m
);
}
static
INLINE
void
_i965LockMutex
(
_I965Mutex
*
m
)
{
pthread_mutex_lock
(
m
);
}
static
INLINE
void
_i965UnlockMutex
(
_I965Mutex
*
m
)
{
pthread_mutex_unlock
(
m
);
}
#define _I965_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
#define _I965_DECLARE_MUTEX(m) \
_I965Mutex m = _I965_MUTEX_INITIALIZER
#else
typedef
int
_I965Mutex
;
static
INLINE
void
_i965InitMutex
(
_I965Mutex
*
m
)
{
(
void
)
m
;
}
static
INLINE
void
_i965DestroyMutex
(
_I965Mutex
*
m
)
{
(
void
)
m
;
}
static
INLINE
void
_i965LockMutex
(
_I965Mutex
*
m
)
{
(
void
)
m
;
}
static
INLINE
void
_i965UnlockMutex
(
_I965Mutex
*
m
)
{
(
void
)
m
;
}
#define _I965_MUTEX_INITIALIZER 0
#define _I965_DECLARE_MUTEX(m) \
_I965Mutex m = _I965_MUTEX_INITIALIZER
#endif
#endif
/* _I965_MUTEX_H_ */
i965_drv_video/intel_compiler.h
0 → 100644
View file @
1587cb78
#ifndef _INTEL_COMPILER_H_
#define _INTEL_COMPILER_H_
/**
* Function inlining
*/
#if defined(__GNUC__)
# define INLINE __inline__
#elif (__STDC_VERSION__ >= 199901L)
/* C99 */
# define INLINE inline
#else
# define INLINE
#endif
#endif
/* _INTEL_COMPILER_H_ */
i965_drv_video/intel_driver.h
View file @
1587cb78
...
...
@@ -11,11 +11,7 @@
#include <va/va_backend.h>
#if defined(__GNUC__)
#define INLINE __inline__
#else
#define INLINE
#endif
#include "intel_compiler.h"
#define BATCH_SIZE 0x80000
#define BATCH_RESERVED 0x10
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment