Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xvba-video
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
xvba-video
Commits
776cc2d7
Commit
776cc2d7
authored
Jun 30, 2012
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vaMapBuffer/vaUnMapBuffer: implemented refcounting on mapping/unmapping
Refcount mapping and unmapping of VABuffers.
parent
d51c4dcc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
0 deletions
+10
-0
src/xvba_buffer.c
src/xvba_buffer.c
+6
-0
src/xvba_buffer.h
src/xvba_buffer.h
+1
-0
src/xvba_image.c
src/xvba_image.c
+3
-0
No files found.
src/xvba_buffer.c
View file @
776cc2d7
...
@@ -209,6 +209,7 @@ create_va_buffer(
...
@@ -209,6 +209,7 @@ create_va_buffer(
obj_buffer
->
buffer_size
=
size
*
num_elements
;
obj_buffer
->
buffer_size
=
size
*
num_elements
;
obj_buffer
->
buffer_data
=
malloc
(
obj_buffer
->
buffer_size
);
obj_buffer
->
buffer_data
=
malloc
(
obj_buffer
->
buffer_size
);
obj_buffer
->
mtime
=
0
;
obj_buffer
->
mtime
=
0
;
obj_buffer
->
map_refcnt
=
0
;
if
(
!
obj_buffer
->
buffer_data
)
{
if
(
!
obj_buffer
->
buffer_data
)
{
destroy_va_buffer
(
driver_data
,
obj_buffer
);
destroy_va_buffer
(
driver_data
,
obj_buffer
);
...
@@ -227,6 +228,8 @@ destroy_va_buffer(
...
@@ -227,6 +228,8 @@ destroy_va_buffer(
if
(
!
obj_buffer
)
if
(
!
obj_buffer
)
return
;
return
;
ASSERT
(
obj_buffer
->
map_refcnt
==
0
);
if
(
obj_buffer
->
buffer_data
)
{
if
(
obj_buffer
->
buffer_data
)
{
free
(
obj_buffer
->
buffer_data
);
free
(
obj_buffer
->
buffer_data
);
obj_buffer
->
buffer_data
=
NULL
;
obj_buffer
->
buffer_data
=
NULL
;
...
@@ -900,6 +903,7 @@ xvba_MapBuffer(
...
@@ -900,6 +903,7 @@ xvba_MapBuffer(
return
VA_STATUS_ERROR_UNKNOWN
;
return
VA_STATUS_ERROR_UNKNOWN
;
++
obj_buffer
->
mtime
;
++
obj_buffer
->
mtime
;
++
obj_buffer
->
map_refcnt
;
return
VA_STATUS_SUCCESS
;
return
VA_STATUS_SUCCESS
;
}
}
...
@@ -917,6 +921,8 @@ xvba_UnmapBuffer(
...
@@ -917,6 +921,8 @@ xvba_UnmapBuffer(
return
VA_STATUS_ERROR_INVALID_BUFFER
;
return
VA_STATUS_ERROR_INVALID_BUFFER
;
++
obj_buffer
->
mtime
;
++
obj_buffer
->
mtime
;
--
obj_buffer
->
map_refcnt
;
ASSERT
(
obj_buffer
->
map_refcnt
>=
0
);
return
VA_STATUS_SUCCESS
;
return
VA_STATUS_SUCCESS
;
}
}
...
...
src/xvba_buffer.h
View file @
776cc2d7
...
@@ -33,6 +33,7 @@ struct object_buffer {
...
@@ -33,6 +33,7 @@ struct object_buffer {
unsigned
int
max_num_elements
;
unsigned
int
max_num_elements
;
unsigned
int
num_elements
;
unsigned
int
num_elements
;
uint64_t
mtime
;
uint64_t
mtime
;
int32_t
map_refcnt
;
};
};
// Create VA buffer object
// Create VA buffer object
...
...
src/xvba_image.c
View file @
776cc2d7
...
@@ -446,6 +446,9 @@ commit_hw_image(
...
@@ -446,6 +446,9 @@ commit_hw_image(
NOTE: this assumes the user really unmaps the buffer when he is
NOTE: this assumes the user really unmaps the buffer when he is
done with it, as it is actually required */
done with it, as it is actually required */
ASSERT
(
obj_buffer
->
map_refcnt
==
0
);
if
(
obj_image
->
hw
.
mtime
<
obj_buffer
->
mtime
)
{
if
(
obj_image
->
hw
.
mtime
<
obj_buffer
->
mtime
)
{
#if USE_GLX
#if USE_GLX
if
(
flags
&
HWIMAGE_TYPE_GLX
)
{
if
(
flags
&
HWIMAGE_TYPE_GLX
)
{
...
...
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