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
c99cbb5f
Commit
c99cbb5f
authored
Mar 07, 2011
by
Xiang, Haihao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
i965_drv_video: map/unmap a tiled GEM BO
Signed-off-by:
Xiang, Haihao
<
haihao.xiang@intel.com
>
parent
3739a5e1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
6 deletions
+40
-6
i965_drv_video/i965_drv_video.c
i965_drv_video/i965_drv_video.c
+40
-6
No files found.
i965_drv_video/i965_drv_video.c
View file @
c99cbb5f
...
@@ -950,7 +950,15 @@ i965_MapBuffer(VADriverContextP ctx,
...
@@ -950,7 +950,15 @@ i965_MapBuffer(VADriverContextP ctx,
assert
(
!
(
obj_buffer
->
buffer_store
->
bo
&&
obj_buffer
->
buffer_store
->
buffer
));
assert
(
!
(
obj_buffer
->
buffer_store
->
bo
&&
obj_buffer
->
buffer_store
->
buffer
));
if
(
NULL
!=
obj_buffer
->
buffer_store
->
bo
)
{
if
(
NULL
!=
obj_buffer
->
buffer_store
->
bo
)
{
unsigned
int
tiling
,
swizzle
;
dri_bo_get_tiling
(
obj_buffer
->
buffer_store
->
bo
,
&
tiling
,
&
swizzle
);
if
(
tiling
!=
I915_TILING_NONE
)
drm_intel_gem_bo_map_gtt
(
obj_buffer
->
buffer_store
->
bo
);
else
dri_bo_map
(
obj_buffer
->
buffer_store
->
bo
,
1
);
dri_bo_map
(
obj_buffer
->
buffer_store
->
bo
,
1
);
assert
(
obj_buffer
->
buffer_store
->
bo
->
virtual
);
assert
(
obj_buffer
->
buffer_store
->
bo
->
virtual
);
*
pbuf
=
obj_buffer
->
buffer_store
->
bo
->
virtual
;
*
pbuf
=
obj_buffer
->
buffer_store
->
bo
->
virtual
;
vaStatus
=
VA_STATUS_SUCCESS
;
vaStatus
=
VA_STATUS_SUCCESS
;
...
@@ -974,7 +982,15 @@ i965_UnmapBuffer(VADriverContextP ctx, VABufferID buf_id)
...
@@ -974,7 +982,15 @@ i965_UnmapBuffer(VADriverContextP ctx, VABufferID buf_id)
assert
(
!
(
obj_buffer
->
buffer_store
->
bo
&&
obj_buffer
->
buffer_store
->
buffer
));
assert
(
!
(
obj_buffer
->
buffer_store
->
bo
&&
obj_buffer
->
buffer_store
->
buffer
));
if
(
NULL
!=
obj_buffer
->
buffer_store
->
bo
)
{
if
(
NULL
!=
obj_buffer
->
buffer_store
->
bo
)
{
unsigned
int
tiling
,
swizzle
;
dri_bo_get_tiling
(
obj_buffer
->
buffer_store
->
bo
,
&
tiling
,
&
swizzle
);
if
(
tiling
!=
I915_TILING_NONE
)
drm_intel_gem_bo_unmap_gtt
(
obj_buffer
->
buffer_store
->
bo
);
else
dri_bo_unmap
(
obj_buffer
->
buffer_store
->
bo
);
dri_bo_unmap
(
obj_buffer
->
buffer_store
->
bo
);
vaStatus
=
VA_STATUS_SUCCESS
;
vaStatus
=
VA_STATUS_SUCCESS
;
}
else
if
(
NULL
!=
obj_buffer
->
buffer_store
->
buffer
)
{
}
else
if
(
NULL
!=
obj_buffer
->
buffer_store
->
buffer
)
{
/* Do nothing */
/* Do nothing */
...
@@ -1552,10 +1568,16 @@ get_image_i420(struct object_image *obj_image, uint8_t *image_data,
...
@@ -1552,10 +1568,16 @@ get_image_i420(struct object_image *obj_image, uint8_t *image_data,
const
int
Y
=
0
;
const
int
Y
=
0
;
const
int
U
=
obj_image
->
image
.
format
.
fourcc
==
VA_FOURCC_YV12
?
2
:
1
;
const
int
U
=
obj_image
->
image
.
format
.
fourcc
==
VA_FOURCC_YV12
?
2
:
1
;
const
int
V
=
obj_image
->
image
.
format
.
fourcc
==
VA_FOURCC_YV12
?
1
:
2
;
const
int
V
=
obj_image
->
image
.
format
.
fourcc
==
VA_FOURCC_YV12
?
1
:
2
;
unsigned
int
tiling
,
swizzle
;
if
(
!
obj_surface
->
bo
)
if
(
!
obj_surface
->
bo
)
return
;
return
;
dri_bo_get_tiling
(
obj_surface
->
bo
,
&
tiling
,
&
swizzle
);
if
(
tiling
!=
I915_TILING_NONE
)
drm_intel_gem_bo_map_gtt
(
obj_surface
->
bo
);
else
dri_bo_map
(
obj_surface
->
bo
,
0
);
dri_bo_map
(
obj_surface
->
bo
,
0
);
if
(
!
obj_surface
->
bo
->
virtual
)
if
(
!
obj_surface
->
bo
->
virtual
)
...
@@ -1591,6 +1613,9 @@ get_image_i420(struct object_image *obj_image, uint8_t *image_data,
...
@@ -1591,6 +1613,9 @@ get_image_i420(struct object_image *obj_image, uint8_t *image_data,
src
[
2
],
obj_surface
->
width
/
2
,
src
[
2
],
obj_surface
->
width
/
2
,
rect
->
width
/
2
,
rect
->
height
/
2
);
rect
->
width
/
2
,
rect
->
height
/
2
);
if
(
tiling
!=
I915_TILING_NONE
)
drm_intel_gem_bo_unmap_gtt
(
obj_surface
->
bo
);
else
dri_bo_unmap
(
obj_surface
->
bo
);
dri_bo_unmap
(
obj_surface
->
bo
);
}
}
...
@@ -1600,10 +1625,16 @@ get_image_nv12(struct object_image *obj_image, uint8_t *image_data,
...
@@ -1600,10 +1625,16 @@ get_image_nv12(struct object_image *obj_image, uint8_t *image_data,
const
VARectangle
*
rect
)
const
VARectangle
*
rect
)
{
{
uint8_t
*
dst
[
2
],
*
src
[
2
];
uint8_t
*
dst
[
2
],
*
src
[
2
];
unsigned
int
tiling
,
swizzle
;
if
(
!
obj_surface
->
bo
)
if
(
!
obj_surface
->
bo
)
return
;
return
;
dri_bo_get_tiling
(
obj_surface
->
bo
,
&
tiling
,
&
swizzle
);
if
(
tiling
!=
I915_TILING_NONE
)
drm_intel_gem_bo_map_gtt
(
obj_surface
->
bo
);
else
dri_bo_map
(
obj_surface
->
bo
,
0
);
dri_bo_map
(
obj_surface
->
bo
,
0
);
if
(
!
obj_surface
->
bo
->
virtual
)
if
(
!
obj_surface
->
bo
->
virtual
)
...
@@ -1629,6 +1660,9 @@ get_image_nv12(struct object_image *obj_image, uint8_t *image_data,
...
@@ -1629,6 +1660,9 @@ get_image_nv12(struct object_image *obj_image, uint8_t *image_data,
src
[
1
],
obj_surface
->
width
,
src
[
1
],
obj_surface
->
width
,
rect
->
width
,
rect
->
height
/
2
);
rect
->
width
,
rect
->
height
/
2
);
if
(
tiling
!=
I915_TILING_NONE
)
drm_intel_gem_bo_unmap_gtt
(
obj_surface
->
bo
);
else
dri_bo_unmap
(
obj_surface
->
bo
);
dri_bo_unmap
(
obj_surface
->
bo
);
}
}
...
...
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