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
12f5b095
Commit
12f5b095
authored
Jul 12, 2011
by
Xiang, Haihao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
i965_drv_video: update post processing interface
Signed-off-by:
Xiang, Haihao
<
haihao.xiang@intel.com
>
parent
f152e212
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
282 additions
and
263 deletions
+282
-263
i965_drv_video/i965_drv_video.c
i965_drv_video/i965_drv_video.c
+0
-3
i965_drv_video/i965_drv_video.h
i965_drv_video/i965_drv_video.h
+0
-5
i965_drv_video/i965_post_processing.c
i965_drv_video/i965_post_processing.c
+246
-230
i965_drv_video/i965_post_processing.h
i965_drv_video/i965_post_processing.h
+14
-6
i965_drv_video/i965_render.c
i965_drv_video/i965_render.c
+22
-19
No files found.
i965_drv_video/i965_drv_video.c
View file @
12f5b095
...
@@ -435,8 +435,6 @@ i965_destroy_surface(struct object_heap *heap, struct object_base *obj)
...
@@ -435,8 +435,6 @@ i965_destroy_surface(struct object_heap *heap, struct object_base *obj)
dri_bo_unreference
(
obj_surface
->
bo
);
dri_bo_unreference
(
obj_surface
->
bo
);
obj_surface
->
bo
=
NULL
;
obj_surface
->
bo
=
NULL
;
dri_bo_unreference
(
obj_surface
->
pp_out_bo
);
obj_surface
->
pp_out_bo
=
NULL
;
if
(
obj_surface
->
free_private_data
!=
NULL
)
{
if
(
obj_surface
->
free_private_data
!=
NULL
)
{
obj_surface
->
free_private_data
(
&
obj_surface
->
private_data
);
obj_surface
->
free_private_data
(
&
obj_surface
->
private_data
);
...
@@ -491,7 +489,6 @@ i965_CreateSurfaces(VADriverContextP ctx,
...
@@ -491,7 +489,6 @@ i965_CreateSurfaces(VADriverContextP ctx,
obj_surface
->
flags
=
SURFACE_REFERENCED
;
obj_surface
->
flags
=
SURFACE_REFERENCED
;
obj_surface
->
fourcc
=
0
;
obj_surface
->
fourcc
=
0
;
obj_surface
->
bo
=
NULL
;
obj_surface
->
bo
=
NULL
;
obj_surface
->
pp_out_bo
=
NULL
;
obj_surface
->
locked_image_id
=
VA_INVALID_ID
;
obj_surface
->
locked_image_id
=
VA_INVALID_ID
;
obj_surface
->
private_data
=
NULL
;
obj_surface
->
private_data
=
NULL
;
obj_surface
->
free_private_data
=
NULL
;
obj_surface
->
free_private_data
=
NULL
;
...
...
i965_drv_video/i965_drv_video.h
View file @
12f5b095
...
@@ -156,11 +156,6 @@ struct object_surface
...
@@ -156,11 +156,6 @@ struct object_surface
int
flags
;
int
flags
;
unsigned
int
fourcc
;
unsigned
int
fourcc
;
dri_bo
*
bo
;
dri_bo
*
bo
;
int
pp_out_width
;
int
pp_out_height
;
int
orig_pp_out_width
;
int
orig_pp_out_height
;
dri_bo
*
pp_out_bo
;
VAImageID
locked_image_id
;
VAImageID
locked_image_id
;
void
(
*
free_private_data
)(
void
**
data
);
void
(
*
free_private_data
)(
void
**
data
);
void
*
private_data
;
void
*
private_data
;
...
...
i965_drv_video/i965_post_processing.c
View file @
12f5b095
...
@@ -65,21 +65,21 @@ static const uint32_t pp_nv12_dndi_gen5[][4] = {
...
@@ -65,21 +65,21 @@ static const uint32_t pp_nv12_dndi_gen5[][4] = {
#include "shaders/post_processing/nv12_dndi_nv12.g4b.gen5"
#include "shaders/post_processing/nv12_dndi_nv12.g4b.gen5"
};
};
static
void
pp_null_initialize
(
VADriverContextP
ctx
,
VASurfaceID
surface
,
int
input
,
static
void
pp_null_initialize
(
VADriverContextP
ctx
,
unsigned
short
srcw
,
unsigned
short
srch
,
VASurfaceID
in_surface_id
,
VASurfaceID
out_surface_id
,
unsigned
short
destw
,
unsigned
short
desth
);
const
VARectangle
*
src_rect
,
const
VARectangle
*
dst_rect
);
static
void
pp_nv12_avs_initialize
(
VADriverContextP
ctx
,
VASurfaceID
surface
,
int
input
,
static
void
pp_nv12_avs_initialize
(
VADriverContextP
ctx
,
unsigned
short
srcw
,
unsigned
short
srch
,
VASurfaceID
in_surface_id
,
VASurfaceID
out_surface_id
,
unsigned
short
destw
,
unsigned
short
desth
);
const
VARectangle
*
src_rect
,
const
VARectangle
*
dst_rect
);
static
void
pp_nv12_scaling_initialize
(
VADriverContextP
ctx
,
VASurfaceID
surface
,
int
input
,
static
void
pp_nv12_scaling_initialize
(
VADriverContextP
ctx
,
unsigned
short
srcw
,
unsigned
short
srch
,
VASurfaceID
in_surface_id
,
VASurfaceID
out_surface_id
,
unsigned
short
destw
,
unsigned
short
desth
);
const
VARectangle
*
src_rect
,
const
VARectangle
*
dst_rect
);
static
void
pp_nv12_load_save_initialize
(
VADriverContextP
ctx
,
VASurfaceID
surface
,
int
input
,
static
void
pp_nv12_load_save_initialize
(
VADriverContextP
ctx
,
unsigned
short
srcw
,
unsigned
short
srch
,
VASurfaceID
in_surface_id
,
VASurfaceID
out_surface_id
,
unsigned
short
destw
,
unsigned
short
desth
);
const
VARectangle
*
src_rect
,
const
VARectangle
*
dst_rect
);
static
void
pp_nv12_dndi_initialize
(
VADriverContextP
ctx
,
VASurfaceID
surface
,
int
input
,
static
void
pp_nv12_dndi_initialize
(
VADriverContextP
ctx
,
unsigned
short
srcw
,
unsigned
short
srch
,
VASurfaceID
in_surface_id
,
VASurfaceID
out_surface_id
,
unsigned
short
destw
,
unsigned
short
desth
);
const
VARectangle
*
src_rect
,
const
VARectangle
*
dst_rect
);
static
struct
pp_module
pp_modules_gen5
[]
=
{
static
struct
pp_module
pp_modules_gen5
[]
=
{
{
{
...
@@ -553,24 +553,12 @@ pp_null_set_block_parameter(struct i965_post_processing_context *pp_context, int
...
@@ -553,24 +553,12 @@ pp_null_set_block_parameter(struct i965_post_processing_context *pp_context, int
}
}
static
void
static
void
pp_null_initialize
(
VADriverContextP
ctx
,
VASurfaceID
surface
,
int
input
,
pp_null_initialize
(
VADriverContextP
ctx
,
unsigned
short
srcw
,
unsigned
short
srch
,
VASurfaceID
in_surface_id
,
VASurfaceID
out_surface_id
,
unsigned
short
destw
,
unsigned
short
desth
)
const
VARectangle
*
src_rect
,
const
VARectangle
*
dst_rect
)
{
{
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
i965_post_processing_context
*
pp_context
=
i965
->
pp_context
;
struct
i965_post_processing_context
*
pp_context
=
i965
->
pp_context
;
struct
object_surface
*
obj_surface
;
/* surface */
obj_surface
=
SURFACE
(
surface
);
dri_bo_unreference
(
obj_surface
->
pp_out_bo
);
obj_surface
->
pp_out_bo
=
obj_surface
->
bo
;
dri_bo_reference
(
obj_surface
->
pp_out_bo
);
assert
(
obj_surface
->
pp_out_bo
);
obj_surface
->
pp_out_width
=
obj_surface
->
width
;
obj_surface
->
pp_out_height
=
obj_surface
->
height
;
obj_surface
->
orig_pp_out_width
=
obj_surface
->
orig_width
;
obj_surface
->
orig_pp_out_height
=
obj_surface
->
orig_height
;
/* private function & data */
/* private function & data */
pp_context
->
pp_x_steps
=
pp_null_x_steps
;
pp_context
->
pp_x_steps
=
pp_null_x_steps
;
...
@@ -604,9 +592,9 @@ pp_load_save_set_block_parameter(struct i965_post_processing_context *pp_context
...
@@ -604,9 +592,9 @@ pp_load_save_set_block_parameter(struct i965_post_processing_context *pp_context
}
}
static
void
static
void
pp_nv12_load_save_initialize
(
VADriverContextP
ctx
,
VASurfaceID
surface
,
int
input
,
pp_nv12_load_save_initialize
(
VADriverContextP
ctx
,
unsigned
short
srcw
,
unsigned
short
srch
,
VASurfaceID
in_surface_id
,
VASurfaceID
out_surface_id
,
unsigned
short
destw
,
unsigned
short
desth
)
const
VARectangle
*
src_rect
,
const
VARectangle
*
dst_rect
)
{
{
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
i965_post_processing_context
*
pp_context
=
i965
->
pp_context
;
struct
i965_post_processing_context
*
pp_context
=
i965
->
pp_context
;
...
@@ -618,27 +606,15 @@ pp_nv12_load_save_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
...
@@ -618,27 +606,15 @@ pp_nv12_load_save_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
int
orig_w
,
orig_h
;
int
orig_w
,
orig_h
;
unsigned
int
tiling
,
swizzle
;
unsigned
int
tiling
,
swizzle
;
/* surface */
/* s
ource s
urface */
obj_surface
=
SURFACE
(
surface
);
obj_surface
=
SURFACE
(
in_surface_id
);
orig_w
=
obj_surface
->
orig_width
;
orig_w
=
obj_surface
->
orig_width
;
orig_h
=
obj_surface
->
orig_height
;
orig_h
=
obj_surface
->
orig_height
;
w
=
obj_surface
->
width
;
w
=
obj_surface
->
width
;
h
=
obj_surface
->
height
;
h
=
obj_surface
->
height
;
dri_bo_unreference
(
obj_surface
->
pp_out_bo
);
obj_surface
->
pp_out_bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
"intermediate surface"
,
SIZE_YUV420
(
w
,
h
),
4096
);
assert
(
obj_surface
->
pp_out_bo
);
obj_surface
->
pp_out_width
=
obj_surface
->
width
;
obj_surface
->
pp_out_height
=
obj_surface
->
height
;
obj_surface
->
orig_pp_out_width
=
obj_surface
->
orig_width
;
obj_surface
->
orig_pp_out_height
=
obj_surface
->
orig_height
;
/* source Y surface index 1 */
dri_bo_get_tiling
(
obj_surface
->
bo
,
&
tiling
,
&
swizzle
);
dri_bo_get_tiling
(
obj_surface
->
bo
,
&
tiling
,
&
swizzle
);
/* source Y surface index 1 */
index
=
1
;
index
=
1
;
pp_context
->
surfaces
[
index
].
s_bo
=
obj_surface
->
bo
;
pp_context
->
surfaces
[
index
].
s_bo
=
obj_surface
->
bo
;
dri_bo_reference
(
pp_context
->
surfaces
[
index
].
s_bo
);
dri_bo_reference
(
pp_context
->
surfaces
[
index
].
s_bo
);
...
@@ -696,9 +672,17 @@ pp_nv12_load_save_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
...
@@ -696,9 +672,17 @@ pp_nv12_load_save_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
pp_context
->
surfaces
[
index
].
s_bo
);
pp_context
->
surfaces
[
index
].
s_bo
);
dri_bo_unmap
(
bo
);
dri_bo_unmap
(
bo
);
/* destination surface */
obj_surface
=
SURFACE
(
out_surface_id
);
orig_w
=
obj_surface
->
orig_width
;
orig_h
=
obj_surface
->
orig_height
;
w
=
obj_surface
->
width
;
h
=
obj_surface
->
height
;
dri_bo_get_tiling
(
obj_surface
->
bo
,
&
tiling
,
&
swizzle
);
/* destination Y surface index 7 */
/* destination Y surface index 7 */
index
=
7
;
index
=
7
;
pp_context
->
surfaces
[
index
].
s_bo
=
obj_surface
->
pp_out_
bo
;
pp_context
->
surfaces
[
index
].
s_bo
=
obj_surface
->
bo
;
dri_bo_reference
(
pp_context
->
surfaces
[
index
].
s_bo
);
dri_bo_reference
(
pp_context
->
surfaces
[
index
].
s_bo
);
bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
"surface state"
,
"surface state"
,
...
@@ -716,6 +700,7 @@ pp_nv12_load_save_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
...
@@ -716,6 +700,7 @@ pp_nv12_load_save_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
ss
->
ss2
.
width
=
orig_w
/
4
-
1
;
ss
->
ss2
.
width
=
orig_w
/
4
-
1
;
ss
->
ss2
.
height
=
orig_h
-
1
;
ss
->
ss2
.
height
=
orig_h
-
1
;
ss
->
ss3
.
pitch
=
w
-
1
;
ss
->
ss3
.
pitch
=
w
-
1
;
pp_set_surface_tiling
(
ss
,
tiling
);
dri_bo_emit_reloc
(
bo
,
dri_bo_emit_reloc
(
bo
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
...
@@ -726,7 +711,7 @@ pp_nv12_load_save_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
...
@@ -726,7 +711,7 @@ pp_nv12_load_save_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
/* destination UV surface index 8 */
/* destination UV surface index 8 */
index
=
8
;
index
=
8
;
pp_context
->
surfaces
[
index
].
s_bo
=
obj_surface
->
pp_out_
bo
;
pp_context
->
surfaces
[
index
].
s_bo
=
obj_surface
->
bo
;
dri_bo_reference
(
pp_context
->
surfaces
[
index
].
s_bo
);
dri_bo_reference
(
pp_context
->
surfaces
[
index
].
s_bo
);
bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
"surface state"
,
"surface state"
,
...
@@ -744,6 +729,7 @@ pp_nv12_load_save_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
...
@@ -744,6 +729,7 @@ pp_nv12_load_save_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
ss
->
ss2
.
width
=
orig_w
/
4
-
1
;
ss
->
ss2
.
width
=
orig_w
/
4
-
1
;
ss
->
ss2
.
height
=
orig_h
/
2
-
1
;
ss
->
ss2
.
height
=
orig_h
/
2
-
1
;
ss
->
ss3
.
pitch
=
w
-
1
;
ss
->
ss3
.
pitch
=
w
-
1
;
pp_set_surface_tiling
(
ss
,
tiling
);
dri_bo_emit_reloc
(
bo
,
dri_bo_emit_reloc
(
bo
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
...
@@ -780,21 +766,22 @@ pp_scaling_y_steps(void *private_context)
...
@@ -780,21 +766,22 @@ pp_scaling_y_steps(void *private_context)
static
int
static
int
pp_scaling_set_block_parameter
(
struct
i965_post_processing_context
*
pp_context
,
int
x
,
int
y
)
pp_scaling_set_block_parameter
(
struct
i965_post_processing_context
*
pp_context
,
int
x
,
int
y
)
{
{
struct
pp_scaling_context
*
pp_scaling_context
=
(
struct
pp_scaling_context
*
)
&
pp_context
->
private_context
;
float
src_x_steping
=
pp_inline_parameter
.
grf5
.
normalized_video_x_scaling_step
;
float
src_x_steping
=
pp_inline_parameter
.
grf5
.
normalized_video_x_scaling_step
;
float
src_y_steping
=
pp_static_parameter
.
grf1
.
r1_6
.
normalized_video_y_scaling_step
;
float
src_y_steping
=
pp_static_parameter
.
grf1
.
r1_6
.
normalized_video_y_scaling_step
;
pp_inline_parameter
.
grf5
.
r5_1
.
source_surface_block_normalized_horizontal_origin
=
src_x_steping
*
x
*
16
;
pp_inline_parameter
.
grf5
.
r5_1
.
source_surface_block_normalized_horizontal_origin
=
src_x_steping
*
x
*
16
+
pp_scaling_context
->
src_normalized_x
;
pp_inline_parameter
.
grf5
.
source_surface_block_normalized_vertical_origin
=
src_y_steping
*
y
*
8
;
pp_inline_parameter
.
grf5
.
source_surface_block_normalized_vertical_origin
=
src_y_steping
*
y
*
8
+
pp_scaling_context
->
src_normalized_y
;
pp_inline_parameter
.
grf5
.
destination_block_horizontal_origin
=
x
*
16
;
pp_inline_parameter
.
grf5
.
destination_block_horizontal_origin
=
x
*
16
+
pp_scaling_context
->
dest_x
;
pp_inline_parameter
.
grf5
.
destination_block_vertical_origin
=
y
*
8
;
pp_inline_parameter
.
grf5
.
destination_block_vertical_origin
=
y
*
8
+
pp_scaling_context
->
dest_y
;
return
0
;
return
0
;
}
}
static
void
static
void
pp_nv12_scaling_initialize
(
VADriverContextP
ctx
,
VASurfaceID
surface
,
int
input
,
pp_nv12_scaling_initialize
(
VADriverContextP
ctx
,
unsigned
short
srcw
,
unsigned
short
srch
,
VASurfaceID
in_surface_id
,
VASurfaceID
out_surface_id
,
unsigned
short
destw
,
unsigned
short
desth
)
const
VARectangle
*
src_rect
,
const
VARectangle
*
dst_rect
)
{
{
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
i965_post_processing_context
*
pp_context
=
i965
->
pp_context
;
struct
i965_post_processing_context
*
pp_context
=
i965
->
pp_context
;
...
@@ -804,37 +791,19 @@ pp_nv12_scaling_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
...
@@ -804,37 +791,19 @@ pp_nv12_scaling_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
struct
i965_surface_state
*
ss
;
struct
i965_surface_state
*
ss
;
dri_bo
*
bo
;
dri_bo
*
bo
;
int
index
;
int
index
;
int
w
,
h
;
int
in_w
,
in_h
,
in_wpitch
,
in_hpitch
;
int
orig_w
,
orig_h
;
int
out_w
,
out_h
,
out_wpitch
,
out_hpitch
;
int
pp_out_w
,
pp_out_h
;
int
orig_pp_out_w
,
orig_pp_out_h
;
unsigned
int
tiling
,
swizzle
;
unsigned
int
tiling
,
swizzle
;
/* surface */
/* source surface */
obj_surface
=
SURFACE
(
surface
);
obj_surface
=
SURFACE
(
in_surface_id
);
orig_w
=
obj_surface
->
orig_width
;
in_w
=
obj_surface
->
orig_width
;
orig_h
=
obj_surface
->
orig_height
;
in_h
=
obj_surface
->
orig_height
;
w
=
obj_surface
->
width
;
in_wpitch
=
obj_surface
->
width
;
h
=
obj_surface
->
height
;
in_hpitch
=
obj_surface
->
height
;
orig_pp_out_w
=
destw
;
orig_pp_out_h
=
desth
;
pp_out_w
=
ALIGN
(
orig_pp_out_w
,
16
);
pp_out_h
=
ALIGN
(
orig_pp_out_h
,
16
);
dri_bo_unreference
(
obj_surface
->
pp_out_bo
);
obj_surface
->
pp_out_bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
"intermediate surface"
,
SIZE_YUV420
(
pp_out_w
,
pp_out_h
),
4096
);
assert
(
obj_surface
->
pp_out_bo
);
obj_surface
->
orig_pp_out_width
=
orig_pp_out_w
;
obj_surface
->
orig_pp_out_height
=
orig_pp_out_h
;
obj_surface
->
pp_out_width
=
pp_out_w
;
obj_surface
->
pp_out_height
=
pp_out_h
;
/* source Y surface index 1 */
dri_bo_get_tiling
(
obj_surface
->
bo
,
&
tiling
,
&
swizzle
);
dri_bo_get_tiling
(
obj_surface
->
bo
,
&
tiling
,
&
swizzle
);
/* source Y surface index 1 */
index
=
1
;
index
=
1
;
pp_context
->
surfaces
[
index
].
s_bo
=
obj_surface
->
bo
;
pp_context
->
surfaces
[
index
].
s_bo
=
obj_surface
->
bo
;
dri_bo_reference
(
pp_context
->
surfaces
[
index
].
s_bo
);
dri_bo_reference
(
pp_context
->
surfaces
[
index
].
s_bo
);
...
@@ -851,9 +820,9 @@ pp_nv12_scaling_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
...
@@ -851,9 +820,9 @@ pp_nv12_scaling_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
ss
->
ss0
.
surface_type
=
I965_SURFACE_2D
;
ss
->
ss0
.
surface_type
=
I965_SURFACE_2D
;
ss
->
ss0
.
surface_format
=
I965_SURFACEFORMAT_R8_UNORM
;
ss
->
ss0
.
surface_format
=
I965_SURFACEFORMAT_R8_UNORM
;
ss
->
ss1
.
base_addr
=
pp_context
->
surfaces
[
index
].
s_bo
->
offset
;
ss
->
ss1
.
base_addr
=
pp_context
->
surfaces
[
index
].
s_bo
->
offset
;
ss
->
ss2
.
width
=
orig
_w
-
1
;
ss
->
ss2
.
width
=
in
_w
-
1
;
ss
->
ss2
.
height
=
orig
_h
-
1
;
ss
->
ss2
.
height
=
in
_h
-
1
;
ss
->
ss3
.
pitch
=
w
-
1
;
ss
->
ss3
.
pitch
=
in_wpitch
-
1
;
pp_set_surface_tiling
(
ss
,
tiling
);
pp_set_surface_tiling
(
ss
,
tiling
);
dri_bo_emit_reloc
(
bo
,
dri_bo_emit_reloc
(
bo
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
...
@@ -879,22 +848,30 @@ pp_nv12_scaling_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
...
@@ -879,22 +848,30 @@ pp_nv12_scaling_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
memset
(
ss
,
0
,
sizeof
(
*
ss
));
memset
(
ss
,
0
,
sizeof
(
*
ss
));
ss
->
ss0
.
surface_type
=
I965_SURFACE_2D
;
ss
->
ss0
.
surface_type
=
I965_SURFACE_2D
;
ss
->
ss0
.
surface_format
=
I965_SURFACEFORMAT_R8G8_UNORM
;
ss
->
ss0
.
surface_format
=
I965_SURFACEFORMAT_R8G8_UNORM
;
ss
->
ss1
.
base_addr
=
pp_context
->
surfaces
[
index
].
s_bo
->
offset
+
w
*
h
;
ss
->
ss1
.
base_addr
=
pp_context
->
surfaces
[
index
].
s_bo
->
offset
+
in_wpitch
*
in_hpitc
h
;
ss
->
ss2
.
width
=
orig
_w
/
2
-
1
;
ss
->
ss2
.
width
=
in
_w
/
2
-
1
;
ss
->
ss2
.
height
=
orig
_h
/
2
-
1
;
ss
->
ss2
.
height
=
in
_h
/
2
-
1
;
ss
->
ss3
.
pitch
=
w
-
1
;
ss
->
ss3
.
pitch
=
in_wpitch
-
1
;
pp_set_surface_tiling
(
ss
,
tiling
);
pp_set_surface_tiling
(
ss
,
tiling
);
dri_bo_emit_reloc
(
bo
,
dri_bo_emit_reloc
(
bo
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
0
,
0
,
w
*
h
,
in_wpitch
*
in_hpitc
h
,
offsetof
(
struct
i965_surface_state
,
ss1
),
offsetof
(
struct
i965_surface_state
,
ss1
),
pp_context
->
surfaces
[
index
].
s_bo
);
pp_context
->
surfaces
[
index
].
s_bo
);
dri_bo_unmap
(
bo
);
dri_bo_unmap
(
bo
);
/* destination surface */
obj_surface
=
SURFACE
(
out_surface_id
);
out_w
=
obj_surface
->
orig_width
;
out_h
=
obj_surface
->
orig_height
;
out_wpitch
=
obj_surface
->
width
;
out_hpitch
=
obj_surface
->
height
;
dri_bo_get_tiling
(
obj_surface
->
bo
,
&
tiling
,
&
swizzle
);
/* destination Y surface index 7 */
/* destination Y surface index 7 */
index
=
7
;
index
=
7
;
pp_context
->
surfaces
[
index
].
s_bo
=
obj_surface
->
pp_out_
bo
;
pp_context
->
surfaces
[
index
].
s_bo
=
obj_surface
->
bo
;
dri_bo_reference
(
pp_context
->
surfaces
[
index
].
s_bo
);
dri_bo_reference
(
pp_context
->
surfaces
[
index
].
s_bo
);
bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
"surface state"
,
"surface state"
,
...
@@ -909,9 +886,10 @@ pp_nv12_scaling_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
...
@@ -909,9 +886,10 @@ pp_nv12_scaling_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
ss
->
ss0
.
surface_type
=
I965_SURFACE_2D
;
ss
->
ss0
.
surface_type
=
I965_SURFACE_2D
;
ss
->
ss0
.
surface_format
=
I965_SURFACEFORMAT_R8_UNORM
;
ss
->
ss0
.
surface_format
=
I965_SURFACEFORMAT_R8_UNORM
;
ss
->
ss1
.
base_addr
=
pp_context
->
surfaces
[
index
].
s_bo
->
offset
;
ss
->
ss1
.
base_addr
=
pp_context
->
surfaces
[
index
].
s_bo
->
offset
;
ss
->
ss2
.
width
=
pp_out_w
/
4
-
1
;
ss
->
ss2
.
width
=
out_w
/
4
-
1
;
ss
->
ss2
.
height
=
pp_out_h
-
1
;
ss
->
ss2
.
height
=
out_h
-
1
;
ss
->
ss3
.
pitch
=
pp_out_w
-
1
;
ss
->
ss3
.
pitch
=
out_wpitch
-
1
;
pp_set_surface_tiling
(
ss
,
tiling
);
dri_bo_emit_reloc
(
bo
,
dri_bo_emit_reloc
(
bo
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
...
@@ -922,7 +900,7 @@ pp_nv12_scaling_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
...
@@ -922,7 +900,7 @@ pp_nv12_scaling_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
/* destination UV surface index 8 */
/* destination UV surface index 8 */
index
=
8
;
index
=
8
;
pp_context
->
surfaces
[
index
].
s_bo
=
obj_surface
->
pp_out_
bo
;
pp_context
->
surfaces
[
index
].
s_bo
=
obj_surface
->
bo
;
dri_bo_reference
(
pp_context
->
surfaces
[
index
].
s_bo
);
dri_bo_reference
(
pp_context
->
surfaces
[
index
].
s_bo
);
bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
"surface state"
,
"surface state"
,
...
@@ -936,14 +914,15 @@ pp_nv12_scaling_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
...
@@ -936,14 +914,15 @@ pp_nv12_scaling_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
memset
(
ss
,
0
,
sizeof
(
*
ss
));
memset
(
ss
,
0
,
sizeof
(
*
ss
));
ss
->
ss0
.
surface_type
=
I965_SURFACE_2D
;
ss
->
ss0
.
surface_type
=
I965_SURFACE_2D
;
ss
->
ss0
.
surface_format
=
I965_SURFACEFORMAT_R8G8_UNORM
;
ss
->
ss0
.
surface_format
=
I965_SURFACEFORMAT_R8G8_UNORM
;
ss
->
ss1
.
base_addr
=
pp_context
->
surfaces
[
index
].
s_bo
->
offset
+
pp_out_w
*
pp_out_h
;
ss
->
ss1
.
base_addr
=
pp_context
->
surfaces
[
index
].
s_bo
->
offset
+
out_wpitch
*
out_hpitch
;
ss
->
ss2
.
width
=
pp_out_w
/
4
-
1
;
ss
->
ss2
.
width
=
out_w
/
4
-
1
;
ss
->
ss2
.
height
=
pp_out_h
/
2
-
1
;
ss
->
ss2
.
height
=
out_h
/
2
-
1
;
ss
->
ss3
.
pitch
=
pp_out_w
-
1
;
ss
->
ss3
.
pitch
=
out_wpitch
-
1
;
pp_set_surface_tiling
(
ss
,
tiling
);
dri_bo_emit_reloc
(
bo
,
dri_bo_emit_reloc
(
bo
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
pp_out_w
*
pp_out_
h
,
out_wpitch
*
out_hpitc
h
,
offsetof
(
struct
i965_surface_state
,
ss1
),
offsetof
(
struct
i965_surface_state
,
ss1
),
pp_context
->
surfaces
[
index
].
s_bo
);
pp_context
->
surfaces
[
index
].
s_bo
);
dri_bo_unmap
(
bo
);
dri_bo_unmap
(
bo
);
...
@@ -974,13 +953,18 @@ pp_nv12_scaling_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
...
@@ -974,13 +953,18 @@ pp_nv12_scaling_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
pp_context
->
pp_y_steps
=
pp_scaling_y_steps
;
pp_context
->
pp_y_steps
=
pp_scaling_y_steps
;
pp_context
->
pp_set_block_parameter
=
pp_scaling_set_block_parameter
;
pp_context
->
pp_set_block_parameter
=
pp_scaling_set_block_parameter
;
pp_scaling_context
->
dest_w
=
pp_out_w
;
pp_scaling_context
->
dest_x
=
dst_rect
->
x
;
pp_scaling_context
->
dest_h
=
pp_out_h
;
pp_scaling_context
->
dest_y
=
dst_rect
->
y
;
pp_scaling_context
->
dest_w
=
ALIGN
(
dst_rect
->
width
,
16
);
pp_scaling_context
->
dest_h
=
ALIGN
(
dst_rect
->
height
,
16
);
pp_scaling_context
->
src_normalized_x
=
(
float
)
src_rect
->
x
/
in_w
/
out_w
;
pp_scaling_context
->
src_normalized_y
=
(
float
)
src_rect
->
y
/
in_h
/
out_h
;
pp_static_parameter
.
grf1
.
r1_6
.
normalized_video_y_scaling_step
=
(
float
)
1
.
0
/
pp_out_h
;
pp_static_parameter
.
grf1
.
r1_6
.
normalized_video_y_scaling_step
=
(
float
)
src_rect
->
height
/
in_h
/
out_h
;
pp_inline_parameter
.
grf5
.
normalized_video_x_scaling_step
=
(
float
)
1
.
0
/
pp_out_w
;
pp_inline_parameter
.
grf5
.
block_count_x
=
pp_out_w
/
16
;
/* 1 x N */
pp_inline_parameter
.
grf5
.
normalized_video_x_scaling_step
=
(
float
)
src_rect
->
width
/
in_w
/
out_w
;
pp_inline_parameter
.
grf5
.
number_blocks
=
pp_out_w
/
16
;
pp_inline_parameter
.
grf5
.
block_count_x
=
pp_scaling_context
->
dest_w
/
16
;
/* 1 x N */
pp_inline_parameter
.
grf5
.
number_blocks
=
pp_scaling_context
->
dest_w
/
16
;
pp_inline_parameter
.
grf5
.
block_vertical_mask
=
0xff
;
pp_inline_parameter
.
grf5
.
block_vertical_mask
=
0xff
;
pp_inline_parameter
.
grf5
.
block_horizontal_mask
=
0xffff
;
pp_inline_parameter
.
grf5
.
block_horizontal_mask
=
0xffff
;
}
}
...
@@ -1011,7 +995,8 @@ pp_avs_set_block_parameter(struct i965_post_processing_context *pp_context, int
...
@@ -1011,7 +995,8 @@ pp_avs_set_block_parameter(struct i965_post_processing_context *pp_context, int
pp_inline_parameter
.
grf6
.
video_step_delta
=
0
;
pp_inline_parameter
.
grf6
.
video_step_delta
=
0
;
if
(
x
==
0
)
{
if
(
x
==
0
)
{
pp_inline_parameter
.
grf5
.
r5_1
.
source_surface_block_normalized_horizontal_origin
=
(
float
)(
tmp_w
-
pp_avs_context
->
dest_w
)
/
tmp_w
/
2
;
pp_inline_parameter
.
grf5
.
r5_1
.
source_surface_block_normalized_horizontal_origin
=
(
float
)(
tmp_w
-
pp_avs_context
->
dest_w
)
/
tmp_w
/
2
+
pp_avs_context
->
src_normalized_x
;
}
else
{
}
else
{
src_x_steping
=
pp_inline_parameter
.
grf5
.
normalized_video_x_scaling_step
;
src_x_steping
=
pp_inline_parameter
.
grf5
.
normalized_video_x_scaling_step
;
video_step_delta
=
pp_inline_parameter
.
grf6
.
video_step_delta
;
video_step_delta
=
pp_inline_parameter
.
grf6
.
video_step_delta
;
...
@@ -1035,7 +1020,7 @@ pp_avs_set_block_parameter(struct i965_post_processing_context *pp_context, int
...
@@ -1035,7 +1020,7 @@ pp_avs_set_block_parameter(struct i965_post_processing_context *pp_context, int
if
(
x
==
0
)
{
if
(
x
==
0
)
{
pp_inline_parameter
.
grf5
.
normalized_video_x_scaling_step
=
1
.
0
/
pp_avs_context
->
dest_w
;
pp_inline_parameter
.
grf5
.
normalized_video_x_scaling_step
=
1
.
0
/
pp_avs_context
->
dest_w
;
pp_inline_parameter
.
grf5
.
r5_1
.
source_surface_block_normalized_horizontal_origin
=
0
.
0
;
pp_inline_parameter
.
grf5
.
r5_1
.
source_surface_block_normalized_horizontal_origin
=
pp_avs_context
->
src_normalized_x
;
}
else
{
}
else
{
src_x_steping
=
pp_inline_parameter
.
grf5
.
normalized_video_x_scaling_step
;
src_x_steping
=
pp_inline_parameter
.
grf5
.
normalized_video_x_scaling_step
;
video_step_delta
=
pp_inline_parameter
.
grf6
.
video_step_delta
;
video_step_delta
=
pp_inline_parameter
.
grf6
.
video_step_delta
;
...
@@ -1051,7 +1036,7 @@ pp_avs_set_block_parameter(struct i965_post_processing_context *pp_context, int
...
@@ -1051,7 +1036,7 @@ pp_avs_set_block_parameter(struct i965_post_processing_context *pp_context, int
pp_inline_parameter
.
grf6
.
video_step_delta
=
b
;
pp_inline_parameter
.
grf6
.
video_step_delta
=
b
;
if
(
x
==
0
)
{
if
(
x
==
0
)
{
pp_inline_parameter
.
grf5
.
r5_1
.
source_surface_block_normalized_horizontal_origin
=
0
.
0
;
pp_inline_parameter
.
grf5
.
r5_1
.
source_surface_block_normalized_horizontal_origin
=
pp_avs_context
->
src_normalized_x
;
pp_inline_parameter
.
grf5
.
normalized_video_x_scaling_step
=
a
;
pp_inline_parameter
.
grf5
.
normalized_video_x_scaling_step
=
a
;
}
else
{
}
else
{
src_x_steping
=
pp_inline_parameter
.
grf5
.
normalized_video_x_scaling_step
;
src_x_steping
=
pp_inline_parameter
.
grf5
.
normalized_video_x_scaling_step
;
...
@@ -1087,17 +1072,17 @@ pp_avs_set_block_parameter(struct i965_post_processing_context *pp_context, int
...
@@ -1087,17 +1072,17 @@ pp_avs_set_block_parameter(struct i965_post_processing_context *pp_context, int
}
}
src_y_steping
=
pp_static_parameter
.
grf1
.
r1_6
.
normalized_video_y_scaling_step
;
src_y_steping
=
pp_static_parameter
.
grf1
.
r1_6
.
normalized_video_y_scaling_step
;
pp_inline_parameter
.
grf5
.
source_surface_block_normalized_vertical_origin
=
src_y_steping
*
y
*
8
;
pp_inline_parameter
.
grf5
.
source_surface_block_normalized_vertical_origin
=
src_y_steping
*
y
*
8
+
pp_avs_context
->
src_normalized_y
;
pp_inline_parameter
.
grf5
.
destination_block_horizontal_origin
=
x
*
16
;
pp_inline_parameter
.
grf5
.
destination_block_horizontal_origin
=
x
*
16
+
pp_avs_context
->
dest_x
;
pp_inline_parameter
.
grf5
.
destination_block_vertical_origin
=
y
*
8
;
pp_inline_parameter
.
grf5
.
destination_block_vertical_origin
=
y
*
8
+
pp_avs_context
->
dest_y
;
return
0
;
return
0
;
}
}
static
void
static
void
pp_nv12_avs_initialize
(
VADriverContextP
ctx
,
VASurfaceID
surface
,
int
input
,
pp_nv12_avs_initialize
(
VADriverContextP
ctx
,
unsigned
short
srcw
,
unsigned
short
srch
,
VASurfaceID
in_surface_id
,
VASurfaceID
out_surface_id
,
unsigned
short
destw
,
unsigned
short
desth
)
const
VARectangle
*
src_rect
,
const
VARectangle
*
dst_rect
)
{
{
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
i965_post_processing_context
*
pp_context
=
i965
->
pp_context
;
struct
i965_post_processing_context
*
pp_context
=
i965
->
pp_context
;
...
@@ -1107,37 +1092,23 @@ pp_nv12_avs_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
...
@@ -1107,37 +1092,23 @@ pp_nv12_avs_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
struct
i965_sampler_8x8
*
sampler_8x8
;
struct
i965_sampler_8x8
*
sampler_8x8
;
struct
i965_sampler_8x8_state
*
sampler_8x8_state
;
struct
i965_sampler_8x8_state
*
sampler_8x8_state
;
struct
i965_surface_state2
*
ss_8x8
;
struct
i965_surface_state2
*
ss_8x8
;
dri_bo
*
bo
,
*
src_bo
;
dri_bo
*
bo
;
int
index
;
int
index
;
int
w
,
h
;
int
in_w
,
in_h
,
in_wpitch
,
in_hpitch
;
int
orig_w
,
orig_h
;
int
out_w
,
out_h
,
out_wpitch
,
out_hpitch
;
int
pp_out_w
,
pp_out_h
;
int
orig_pp_out_w
,
orig_pp_out_h
;
unsigned
int
tiling
,
swizzle
;
unsigned
int
tiling
,
swizzle
;
/* surface */
/* surface */
obj_surface
=
SURFACE
(
surface
);
obj_surface
=
SURFACE
(
in_surface_id
);
in_w
=
obj_surface
->
orig_width
;
if
(
input
==
1
)
{
in_h
=
obj_surface
->
orig_height
;
orig_w
=
obj_surface
->
orig_pp_out_width
;
in_wpitch
=
obj_surface
->
width
;
orig_h
=
obj_surface
->
orig_pp_out_height
;
in_hpitch
=
obj_surface
->
height
;
w
=
obj_surface
->
pp_out_width
;
dri_bo_get_tiling
(
obj_surface
->
bo
,
&
tiling
,
&
swizzle
);
h
=
obj_surface
->
pp_out_height
;
src_bo
=
obj_surface
->
pp_out_bo
;
}
else
{
orig_w
=
obj_surface
->
orig_width
;
orig_h
=
obj_surface
->
orig_height
;
w
=
obj_surface
->
width
;
h
=
obj_surface
->
height
;
src_bo
=
obj_surface
->
bo
;
}
assert
(
src_bo
);
dri_bo_get_tiling
(
src_bo
,
&
tiling
,
&
swizzle
);
/* source Y surface index 1 */
/* source Y surface index 1 */
index
=
1
;
index
=
1
;
pp_context
->
surfaces
[
index
].
s_bo
=
src_
bo
;
pp_context
->
surfaces
[
index
].
s_bo
=
obj_surface
->
bo
;
dri_bo_reference
(
pp_context
->
surfaces
[
index
].
s_bo
);
dri_bo_reference
(
pp_context
->
surfaces
[
index
].
s_bo
);
bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
"Y surface state for sample_8x8"
,
"Y surface state for sample_8x8"
,
...
@@ -1151,10 +1122,10 @@ pp_nv12_avs_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
...
@@ -1151,10 +1122,10 @@ pp_nv12_avs_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
memset
(
ss_8x8
,
0
,
sizeof
(
*
ss_8x8
));
memset
(
ss_8x8
,
0
,
sizeof
(
*
ss_8x8
));
ss_8x8
->
ss0
.
surface_base_address
=
pp_context
->
surfaces
[
index
].
s_bo
->
offset
;
ss_8x8
->
ss0
.
surface_base_address
=
pp_context
->
surfaces
[
index
].
s_bo
->
offset
;
ss_8x8
->
ss1
.
cbcr_pixel_offset_v_direction
=
0
;
ss_8x8
->
ss1
.
cbcr_pixel_offset_v_direction
=
0
;
ss_8x8
->
ss1
.
width
=
orig
_w
-
1
;
ss_8x8
->
ss1
.
width
=
in
_w
-
1
;
ss_8x8
->
ss1
.
height
=
orig
_h
-
1
;
ss_8x8
->
ss1
.
height
=
in
_h
-
1
;
ss_8x8
->
ss2
.
half_pitch_for_chroma
=
0
;
ss_8x8
->
ss2
.
half_pitch_for_chroma
=
0
;
ss_8x8
->
ss2
.
pitch
=
w
-
1
;
ss_8x8
->
ss2
.
pitch
=
in_wpitch
-
1
;
ss_8x8
->
ss2
.
interleave_chroma
=
0
;
ss_8x8
->
ss2
.
interleave_chroma
=
0
;
ss_8x8
->
ss2
.
surface_format
=
SURFACE_FORMAT_Y8_UNORM
;
ss_8x8
->
ss2
.
surface_format
=
SURFACE_FORMAT_Y8_UNORM
;
ss_8x8
->
ss3
.
x_offset_for_cb
=
0
;
ss_8x8
->
ss3
.
x_offset_for_cb
=
0
;
...
@@ -1170,7 +1141,7 @@ pp_nv12_avs_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
...
@@ -1170,7 +1141,7 @@ pp_nv12_avs_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
/* source UV surface index 2 */
/* source UV surface index 2 */
index
=
2
;
index
=
2
;
pp_context
->
surfaces
[
index
].
s_bo
=
src_
bo
;
pp_context
->
surfaces
[
index
].
s_bo
=
obj_surface
->
bo
;
dri_bo_reference
(
pp_context
->
surfaces
[
index
].
s_bo
);
dri_bo_reference
(
pp_context
->
surfaces
[
index
].
s_bo
);
bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
"UV surface state for sample_8x8"
,
"UV surface state for sample_8x8"
,
...
@@ -1182,12 +1153,12 @@ pp_nv12_avs_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
...
@@ -1182,12 +1153,12 @@ pp_nv12_avs_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
assert
(
bo
->
virtual
);
assert
(
bo
->
virtual
);
ss_8x8
=
bo
->
virtual
;
ss_8x8
=
bo
->
virtual
;
memset
(
ss_8x8
,
0
,
sizeof
(
*
ss_8x8
));
memset
(
ss_8x8
,
0
,
sizeof
(
*
ss_8x8
));
ss_8x8
->
ss0
.
surface_base_address
=
pp_context
->
surfaces
[
index
].
s_bo
->
offset
+
w
*
h
;
ss_8x8
->
ss0
.
surface_base_address
=
pp_context
->
surfaces
[
index
].
s_bo
->
offset
+
in_wpitch
*
in_hpitc
h
;
ss_8x8
->
ss1
.
cbcr_pixel_offset_v_direction
=
0
;
ss_8x8
->
ss1
.
cbcr_pixel_offset_v_direction
=
0
;
ss_8x8
->
ss1
.
width
=
orig
_w
-
1
;
ss_8x8
->
ss1
.
width
=
in
_w
-
1
;
ss_8x8
->
ss1
.
height
=
orig
_h
-
1
;
ss_8x8
->
ss1
.
height
=
in
_h
-
1
;
ss_8x8
->
ss2
.
half_pitch_for_chroma
=
0
;
ss_8x8
->
ss2
.
half_pitch_for_chroma
=
0
;
ss_8x8
->
ss2
.
pitch
=
w
-
1
;
ss_8x8
->
ss2
.
pitch
=
in_wpitch
-
1
;
ss_8x8
->
ss2
.
interleave_chroma
=
1
;
ss_8x8
->
ss2
.
interleave_chroma
=
1
;
ss_8x8
->
ss2
.
surface_format
=
SURFACE_FORMAT_PLANAR_420_8
;
ss_8x8
->
ss2
.
surface_format
=
SURFACE_FORMAT_PLANAR_420_8
;
ss_8x8
->
ss3
.
x_offset_for_cb
=
0
;
ss_8x8
->
ss3
.
x_offset_for_cb
=
0
;
...
@@ -1196,29 +1167,23 @@ pp_nv12_avs_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
...
@@ -1196,29 +1167,23 @@ pp_nv12_avs_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
dri_bo_emit_reloc
(
bo
,
dri_bo_emit_reloc
(
bo
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
0
,
0
,
w
*
h
,
in_wpitch
*
in_hpitc
h
,
offsetof
(
struct
i965_surface_state2
,
ss0
),
offsetof
(
struct
i965_surface_state2
,
ss0
),
pp_context
->
surfaces
[
index
].
s_bo
);
pp_context
->
surfaces
[
index
].
s_bo
);
dri_bo_unmap
(
bo
);
dri_bo_unmap
(
bo
);
orig_pp_out_w
=
destw
;
/* destination surface */
orig_pp_out_h
=
desth
;
obj_surface
=
SURFACE
(
out_surface_id
);
pp_out_w
=
ALIGN
(
orig_pp_out_w
,
16
);
out_w
=
obj_surface
->
orig_width
;
pp_out_h
=
ALIGN
(
orig_pp_out_h
,
16
);
out_h
=
obj_surface
->
orig_height
;
dri_bo_unreference
(
obj_surface
->
pp_out_bo
);
out_wpitch
=
obj_surface
->
width
;
obj_surface
->
pp_out_bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
out_hpitch
=
obj_surface
->
height
;
"intermediate surface"
,
assert
(
out_w
<=
out_wpitch
&&
out_h
<=
out_hpitch
);
SIZE_YUV420
(
pp_out_w
,
pp_out_h
),
dri_bo_get_tiling
(
obj_surface
->
bo
,
&
tiling
,
&
swizzle
);
4096
);
assert
(
obj_surface
->
pp_out_bo
);
obj_surface
->
orig_pp_out_width
=
orig_pp_out_w
;
obj_surface
->
orig_pp_out_height
=
orig_pp_out_h
;
obj_surface
->
pp_out_width
=
pp_out_w
;
obj_surface
->
pp_out_height
=
pp_out_h
;
/* destination Y surface index 7 */
/* destination Y surface index 7 */
index
=
7
;
index
=
7
;
pp_context
->
surfaces
[
index
].
s_bo
=
obj_surface
->
pp_out_
bo
;
pp_context
->
surfaces
[
index
].
s_bo
=
obj_surface
->
bo
;
dri_bo_reference
(
pp_context
->
surfaces
[
index
].
s_bo
);
dri_bo_reference
(
pp_context
->
surfaces
[
index
].
s_bo
);
bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
"surface state"
,
"surface state"
,
...
@@ -1233,9 +1198,10 @@ pp_nv12_avs_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
...
@@ -1233,9 +1198,10 @@ pp_nv12_avs_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
ss
->
ss0
.
surface_type
=
I965_SURFACE_2D
;
ss
->
ss0
.
surface_type
=
I965_SURFACE_2D
;
ss
->
ss0
.
surface_format
=
I965_SURFACEFORMAT_R8_UNORM
;
ss
->
ss0
.
surface_format
=
I965_SURFACEFORMAT_R8_UNORM
;
ss
->
ss1
.
base_addr
=
pp_context
->
surfaces
[
index
].
s_bo
->
offset
;
ss
->
ss1
.
base_addr
=
pp_context
->
surfaces
[
index
].
s_bo
->
offset
;
ss
->
ss2
.
width
=
pp_out_w
/
4
-
1
;
ss
->
ss2
.
width
=
out_w
/
4
-
1
;
ss
->
ss2
.
height
=
pp_out_h
-
1
;
ss
->
ss2
.
height
=
out_h
-
1
;
ss
->
ss3
.
pitch
=
pp_out_w
-
1
;
ss
->
ss3
.
pitch
=
out_wpitch
-
1
;
pp_set_surface_tiling
(
ss
,
tiling
);
dri_bo_emit_reloc
(
bo
,
dri_bo_emit_reloc
(
bo
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
...
@@ -1246,7 +1212,7 @@ pp_nv12_avs_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
...
@@ -1246,7 +1212,7 @@ pp_nv12_avs_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
/* destination UV surface index 8 */
/* destination UV surface index 8 */
index
=
8
;
index
=
8
;
pp_context
->
surfaces
[
index
].
s_bo
=
obj_surface
->
pp_out_
bo
;
pp_context
->
surfaces
[
index
].
s_bo
=
obj_surface
->
bo
;
dri_bo_reference
(
pp_context
->
surfaces
[
index
].
s_bo
);
dri_bo_reference
(
pp_context
->
surfaces
[
index
].
s_bo
);
bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
"surface state"
,
"surface state"
,
...
@@ -1260,14 +1226,15 @@ pp_nv12_avs_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
...
@@ -1260,14 +1226,15 @@ pp_nv12_avs_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
memset
(
ss
,
0
,
sizeof
(
*
ss
));
memset
(
ss
,
0
,
sizeof
(
*
ss
));
ss
->
ss0
.
surface_type
=
I965_SURFACE_2D
;
ss
->
ss0
.
surface_type
=
I965_SURFACE_2D
;
ss
->
ss0
.
surface_format
=
I965_SURFACEFORMAT_R8G8_UNORM
;
ss
->
ss0
.
surface_format
=
I965_SURFACEFORMAT_R8G8_UNORM
;
ss
->
ss1
.
base_addr
=
pp_context
->
surfaces
[
index
].
s_bo
->
offset
+
pp_out_w
*
pp_out_h
;
ss
->
ss1
.
base_addr
=
pp_context
->
surfaces
[
index
].
s_bo
->
offset
+
out_wpitch
*
out_hpitch
;
ss
->
ss2
.
width
=
pp_out_w
/
4
-
1
;
ss
->
ss2
.
width
=
out_w
/
4
-
1
;
ss
->
ss2
.
height
=
pp_out_h
/
2
-
1
;
ss
->
ss2
.
height
=
out_h
/
2
-
1
;
ss
->
ss3
.
pitch
=
pp_out_w
-
1
;
ss
->
ss3
.
pitch
=
out_wpitch
-
1
;
pp_set_surface_tiling
(
ss
,
tiling
);
dri_bo_emit_reloc
(
bo
,
dri_bo_emit_reloc
(
bo
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
pp_out_w
*
pp_out_
h
,
out_wpitch
*
out_hpitc
h
,
offsetof
(
struct
i965_surface_state
,
ss1
),
offsetof
(
struct
i965_surface_state
,
ss1
),
pp_context
->
surfaces
[
index
].
s_bo
);
pp_context
->
surfaces
[
index
].
s_bo
);
dri_bo_unmap
(
bo
);
dri_bo_unmap
(
bo
);
...
@@ -1436,16 +1403,21 @@ pp_nv12_avs_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
...
@@ -1436,16 +1403,21 @@ pp_nv12_avs_initialize(VADriverContextP ctx, VASurfaceID surface, int input,
pp_context
->
pp_y_steps
=
pp_avs_y_steps
;
pp_context
->
pp_y_steps
=
pp_avs_y_steps
;
pp_context
->
pp_set_block_parameter
=
pp_avs_set_block_parameter
;
pp_context
->
pp_set_block_parameter
=
pp_avs_set_block_parameter
;
pp_avs_context
->
dest_w
=
pp_out_w
;
pp_avs_context
->
dest_x
=
dst_rect
->
x
;
pp_avs_context
->
dest_h
=
pp_out_h
;
pp_avs_context
->
dest_y
=
dst_rect
->
y
;
pp_avs_context
->
src_w
=
w
;
pp_avs_context
->
dest_w
=
ALIGN
(
dst_rect
->
width
,
16
);
pp_avs_context
->
src_h
=
h
;
pp_avs_context
->
dest_h
=
ALIGN
(
dst_rect
->
height
,
16
);
pp_avs_context
->
src_normalized_x
=
(
float
)
src_rect
->
x
/
in_w
/
out_w
;
pp_avs_context
->
src_normalized_y
=
(
float
)
src_rect
->
y
/
in_h
/
out_h
;
pp_avs_context
->
src_w
=
src_rect
->
width
;
pp_avs_context
->
src_h
=
src_rect
->
height
;
pp_static_parameter
.
grf4
.
r4_2
.
avs
.
nlas
=
1
;
pp_static_parameter
.
grf4
.
r4_2
.
avs
.
nlas
=
1
;
pp_static_parameter
.
grf1
.
r1_6
.
normalized_video_y_scaling_step
=
(
float
)
1
.
0
/
pp_out_h
;
pp_static_parameter
.
grf1
.
r1_6
.
normalized_video_y_scaling_step
=
(
float
)
src_rect
->
height
/
in_h
/
out_h
;
pp_inline_parameter
.
grf5
.
normalized_video_x_scaling_step
=
(
float
)
1
.
0
/
pp_out_w
;
pp_inline_parameter
.
grf5
.
normalized_video_x_scaling_step
=
(
float
)
src_rect
->
width
/
in_w
/
out_w
;
pp_inline_parameter
.
grf5
.
block_count_x
=
1
;
/* M x 1 */
pp_inline_parameter
.
grf5
.
block_count_x
=
1
;
/* M x 1 */
pp_inline_parameter
.
grf5
.
number_blocks
=
pp_
ou
t_h
/
8
;
pp_inline_parameter
.
grf5
.
number_blocks
=
pp_
avs_context
->
des
t_h
/
8
;
pp_inline_parameter
.
grf5
.
block_vertical_mask
=
0xff
;
pp_inline_parameter
.
grf5
.
block_vertical_mask
=
0xff
;
pp_inline_parameter
.
grf5
.
block_horizontal_mask
=
0xffff
;
pp_inline_parameter
.
grf5
.
block_horizontal_mask
=
0xffff
;
pp_inline_parameter
.
grf6
.
video_step_delta
=
0
.
0
;
pp_inline_parameter
.
grf6
.
video_step_delta
=
0
.
0
;
...
@@ -1475,9 +1447,9 @@ pp_dndi_set_block_parameter(struct i965_post_processing_context *pp_context, int
...
@@ -1475,9 +1447,9 @@ pp_dndi_set_block_parameter(struct i965_post_processing_context *pp_context, int
}
}
static
static
void
pp_nv12_dndi_initialize
(
VADriverContextP
ctx
,
VASurfaceID
surface
,
int
input
,
void
pp_nv12_dndi_initialize
(
VADriverContextP
ctx
,
unsigned
short
srcw
,
unsigned
short
srch
,
VASurfaceID
in_surface_id
,
VASurfaceID
out_surface_id
,
unsigned
short
destw
,
unsigned
short
desth
)
const
VARectangle
*
src_rect
,
const
VARectangle
*
dst_rect
)
{
{
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
i965_post_processing_context
*
pp_context
=
i965
->
pp_context
;
struct
i965_post_processing_context
*
pp_context
=
i965
->
pp_context
;
...
@@ -1493,11 +1465,12 @@ void pp_nv12_dndi_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
...
@@ -1493,11 +1465,12 @@ void pp_nv12_dndi_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
unsigned
int
tiling
,
swizzle
;
unsigned
int
tiling
,
swizzle
;
/* surface */
/* surface */
obj_surface
=
SURFACE
(
surface
);
obj_surface
=
SURFACE
(
in_surface_id
);
orig_w
=
obj_surface
->
orig_width
;
orig_w
=
obj_surface
->
orig_width
;
orig_h
=
obj_surface
->
orig_height
;
orig_h
=
obj_surface
->
orig_height
;
w
=
obj_surface
->
width
;
w
=
obj_surface
->
width
;
h
=
obj_surface
->
height
;
h
=
obj_surface
->
height
;
dri_bo_get_tiling
(
obj_surface
->
bo
,
&
tiling
,
&
swizzle
);
if
(
pp_context
->
stmm
.
bo
==
NULL
)
{
if
(
pp_context
->
stmm
.
bo
==
NULL
)
{
pp_context
->
stmm
.
bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
pp_context
->
stmm
.
bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
...
@@ -1507,18 +1480,6 @@ void pp_nv12_dndi_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
...
@@ -1507,18 +1480,6 @@ void pp_nv12_dndi_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
assert
(
pp_context
->
stmm
.
bo
);
assert
(
pp_context
->
stmm
.
bo
);
}
}
dri_bo_unreference
(
obj_surface
->
pp_out_bo
);
obj_surface
->
pp_out_bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
"intermediate surface"
,
SIZE_YUV420
(
w
,
h
),
4096
);
assert
(
obj_surface
->
pp_out_bo
);
obj_surface
->
orig_pp_out_width
=
orig_w
;
obj_surface
->
orig_pp_out_height
=
orig_h
;
obj_surface
->
pp_out_width
=
w
;
obj_surface
->
pp_out_height
=
h
;
dri_bo_get_tiling
(
obj_surface
->
bo
,
&
tiling
,
&
swizzle
);
/* source UV surface index 2 */
/* source UV surface index 2 */
index
=
2
;
index
=
2
;
pp_context
->
surfaces
[
index
].
s_bo
=
obj_surface
->
bo
;
pp_context
->
surfaces
[
index
].
s_bo
=
obj_surface
->
bo
;
...
@@ -1612,9 +1573,17 @@ void pp_nv12_dndi_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
...
@@ -1612,9 +1573,17 @@ void pp_nv12_dndi_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
pp_context
->
surfaces
[
index
].
s_bo
);
pp_context
->
surfaces
[
index
].
s_bo
);
dri_bo_unmap
(
bo
);
dri_bo_unmap
(
bo
);
/* destination surface */
obj_surface
=
SURFACE
(
out_surface_id
);
orig_w
=
obj_surface
->
orig_width
;
orig_h
=
obj_surface
->
orig_height
;
w
=
obj_surface
->
width
;
h
=
obj_surface
->
height
;
dri_bo_get_tiling
(
obj_surface
->
bo
,
&
tiling
,
&
swizzle
);
/* destination Y surface index 7 */
/* destination Y surface index 7 */
index
=
7
;
index
=
7
;
pp_context
->
surfaces
[
index
].
s_bo
=
obj_surface
->
pp_out_
bo
;
pp_context
->
surfaces
[
index
].
s_bo
=
obj_surface
->
bo
;
dri_bo_reference
(
pp_context
->
surfaces
[
index
].
s_bo
);
dri_bo_reference
(
pp_context
->
surfaces
[
index
].
s_bo
);
bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
"surface state"
,
"surface state"
,
...
@@ -1629,9 +1598,10 @@ void pp_nv12_dndi_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
...
@@ -1629,9 +1598,10 @@ void pp_nv12_dndi_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
ss
->
ss0
.
surface_type
=
I965_SURFACE_2D
;
ss
->
ss0
.
surface_type
=
I965_SURFACE_2D
;
ss
->
ss0
.
surface_format
=
I965_SURFACEFORMAT_R8_UNORM
;
ss
->
ss0
.
surface_format
=
I965_SURFACEFORMAT_R8_UNORM
;
ss
->
ss1
.
base_addr
=
pp_context
->
surfaces
[
index
].
s_bo
->
offset
;
ss
->
ss1
.
base_addr
=
pp_context
->
surfaces
[
index
].
s_bo
->
offset
;
ss
->
ss2
.
width
=
w
/
4
-
1
;
ss
->
ss2
.
width
=
orig_
w
/
4
-
1
;
ss
->
ss2
.
height
=
h
-
1
;
ss
->
ss2
.
height
=
orig_
h
-
1
;
ss
->
ss3
.
pitch
=
w
-
1
;
ss
->
ss3
.
pitch
=
w
-
1
;
pp_set_surface_tiling
(
ss
,
tiling
);
dri_bo_emit_reloc
(
bo
,
dri_bo_emit_reloc
(
bo
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
...
@@ -1642,7 +1612,7 @@ void pp_nv12_dndi_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
...
@@ -1642,7 +1612,7 @@ void pp_nv12_dndi_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
/* destination UV surface index 8 */
/* destination UV surface index 8 */
index
=
8
;
index
=
8
;
pp_context
->
surfaces
[
index
].
s_bo
=
obj_surface
->
pp_out_
bo
;
pp_context
->
surfaces
[
index
].
s_bo
=
obj_surface
->
bo
;
dri_bo_reference
(
pp_context
->
surfaces
[
index
].
s_bo
);
dri_bo_reference
(
pp_context
->
surfaces
[
index
].
s_bo
);
bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
"surface state"
,
"surface state"
,
...
@@ -1657,9 +1627,10 @@ void pp_nv12_dndi_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
...
@@ -1657,9 +1627,10 @@ void pp_nv12_dndi_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
ss
->
ss0
.
surface_type
=
I965_SURFACE_2D
;
ss
->
ss0
.
surface_type
=
I965_SURFACE_2D
;
ss
->
ss0
.
surface_format
=
I965_SURFACEFORMAT_R8G8_UNORM
;
ss
->
ss0
.
surface_format
=
I965_SURFACEFORMAT_R8G8_UNORM
;
ss
->
ss1
.
base_addr
=
pp_context
->
surfaces
[
index
].
s_bo
->
offset
+
w
*
h
;
ss
->
ss1
.
base_addr
=
pp_context
->
surfaces
[
index
].
s_bo
->
offset
+
w
*
h
;
ss
->
ss2
.
width
=
w
/
4
-
1
;
ss
->
ss2
.
width
=
orig_
w
/
4
-
1
;
ss
->
ss2
.
height
=
h
/
2
-
1
;
ss
->
ss2
.
height
=
orig_
h
/
2
-
1
;
ss
->
ss3
.
pitch
=
w
-
1
;
ss
->
ss3
.
pitch
=
w
-
1
;
pp_set_surface_tiling
(
ss
,
tiling
);
dri_bo_emit_reloc
(
bo
,
dri_bo_emit_reloc
(
bo
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
I915_GEM_DOMAIN_RENDER
,
...
@@ -1750,8 +1721,8 @@ void pp_nv12_dndi_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
...
@@ -1750,8 +1721,8 @@ void pp_nv12_dndi_initialize(VADriverContextP ctx, VASurfaceID surface, int inpu
static
void
static
void
ironlake_pp_initialize
(
ironlake_pp_initialize
(
VADriverContextP
ctx
,
VADriverContextP
ctx
,
VASurfaceID
surface
,
VASurfaceID
in_surface_id
,
int
input
,
VASurfaceID
out_surface_id
,
const
VARectangle
*
src_rect
,
const
VARectangle
*
src_rect
,
const
VARectangle
*
dst_rect
,
const
VARectangle
*
dst_rect
,
int
pp_index
int
pp_index
...
@@ -1838,22 +1809,21 @@ ironlake_pp_initialize(
...
@@ -1838,22 +1809,21 @@ ironlake_pp_initialize(
pp_module
=
&
pp_context
->
pp_modules
[
pp_index
];
pp_module
=
&
pp_context
->
pp_modules
[
pp_index
];
if
(
pp_module
->
initialize
)
if
(
pp_module
->
initialize
)
pp_module
->
initialize
(
ctx
,
surface
,
input
,
pp_module
->
initialize
(
ctx
,
in_surface_id
,
out_surface_id
,
src_rect
->
width
,
src_rect
->
height
,
src_rect
,
dst_rect
);
dst_rect
->
width
,
dst_rect
->
height
);
}
}
static
void
static
void
ironlake_post_processing
(
ironlake_post_processing
(
VADriverContextP
ctx
,
VADriverContextP
ctx
,
VASurfaceID
surface
,
VASurfaceID
in_surface_id
,
int
input
,
VASurfaceID
out_surface_id
,
const
VARectangle
*
src_rect
,
const
VARectangle
*
src_rect
,
const
VARectangle
*
dst_rect
,
const
VARectangle
*
dst_rect
,
int
pp_index
int
pp_index
)
)
{
{
ironlake_pp_initialize
(
ctx
,
surface
,
input
,
src_rect
,
dst_rect
,
pp_index
);
ironlake_pp_initialize
(
ctx
,
in_surface_id
,
out_surface_id
,
src_rect
,
dst_rect
,
pp_index
);
ironlake_pp_states_setup
(
ctx
);
ironlake_pp_states_setup
(
ctx
);
ironlake_pp_pipeline_setup
(
ctx
);
ironlake_pp_pipeline_setup
(
ctx
);
}
}
...
@@ -1861,8 +1831,8 @@ ironlake_post_processing(
...
@@ -1861,8 +1831,8 @@ ironlake_post_processing(
static
void
static
void
gen6_pp_initialize
(
gen6_pp_initialize
(
VADriverContextP
ctx
,
VADriverContextP
ctx
,
VASurfaceID
surface
,
VASurfaceID
in_surface_id
,
int
input
,
VASurfaceID
out_surface_id
,
const
VARectangle
*
src_rect
,
const
VARectangle
*
src_rect
,
const
VARectangle
*
dst_rect
,
const
VARectangle
*
dst_rect
,
int
pp_index
int
pp_index
...
@@ -1949,9 +1919,8 @@ gen6_pp_initialize(
...
@@ -1949,9 +1919,8 @@ gen6_pp_initialize(
pp_module
=
&
pp_context
->
pp_modules
[
pp_index
];
pp_module
=
&
pp_context
->
pp_modules
[
pp_index
];
if
(
pp_module
->
initialize
)
if
(
pp_module
->
initialize
)
pp_module
->
initialize
(
ctx
,
surface
,
input
,
pp_module
->
initialize
(
ctx
,
in_surface_id
,
out_surface_id
,
src_rect
->
width
,
src_rect
->
height
,
src_rect
,
dst_rect
);
dst_rect
->
width
,
dst_rect
->
height
);
}
}
static
void
static
void
...
@@ -2197,14 +2166,14 @@ gen6_pp_pipeline_setup(VADriverContextP ctx)
...
@@ -2197,14 +2166,14 @@ gen6_pp_pipeline_setup(VADriverContextP ctx)
static
void
static
void
gen6_post_processing
(
gen6_post_processing
(
VADriverContextP
ctx
,
VADriverContextP
ctx
,
VASurfaceID
surface
,
VASurfaceID
in_surface_id
,
int
input
,
VASurfaceID
out_surface_id
,
const
VARectangle
*
src_rect
,
const
VARectangle
*
src_rect
,
const
VARectangle
*
dst_rect
,
const
VARectangle
*
dst_rect
,
int
pp_index
int
pp_index
)
)
{
{
gen6_pp_initialize
(
ctx
,
surface
,
input
,
src_rect
,
dst_rect
,
pp_index
);
gen6_pp_initialize
(
ctx
,
in_surface_id
,
out_surface_id
,
src_rect
,
dst_rect
,
pp_index
);
gen6_pp_states_setup
(
ctx
);
gen6_pp_states_setup
(
ctx
);
gen6_pp_pipeline_setup
(
ctx
);
gen6_pp_pipeline_setup
(
ctx
);
}
}
...
@@ -2212,8 +2181,8 @@ gen6_post_processing(
...
@@ -2212,8 +2181,8 @@ gen6_post_processing(
static
void
static
void
i965_post_processing_internal
(
i965_post_processing_internal
(
VADriverContextP
ctx
,
VADriverContextP
ctx
,
VASurfaceID
surface
,
VASurfaceID
in_surface_id
,
int
input
,
VASurfaceID
out_surface_id
,
const
VARectangle
*
src_rect
,
const
VARectangle
*
src_rect
,
const
VARectangle
*
dst_rect
,
const
VARectangle
*
dst_rect
,
int
pp_index
int
pp_index
...
@@ -2223,42 +2192,89 @@ i965_post_processing_internal(
...
@@ -2223,42 +2192,89 @@ i965_post_processing_internal(
if
(
IS_GEN6
(
i965
->
intel
.
device_id
)
||
if
(
IS_GEN6
(
i965
->
intel
.
device_id
)
||
IS_GEN7
(
i965
->
intel
.
device_id
))
IS_GEN7
(
i965
->
intel
.
device_id
))
gen6_post_processing
(
ctx
,
surface
,
input
,
src_rect
,
dst_rect
,
pp_index
);
gen6_post_processing
(
ctx
,
in_surface_id
,
out_surface_id
,
src_rect
,
dst_rect
,
pp_index
);
else
else
ironlake_post_processing
(
ctx
,
surface
,
input
,
src_rect
,
dst_rect
,
ironlake_post_processing
(
ctx
,
in_surface_id
,
out_surface_id
,
src_rect
,
dst_rect
,
pp_index
);
pp_index
);
}
}
void
VAStatus
i965_DestroySurfaces
(
VADriverContextP
ctx
,
VASurfaceID
*
surface_list
,
int
num_surfaces
);
VAStatus
i965_CreateSurfaces
(
VADriverContextP
ctx
,
int
width
,
int
height
,
int
format
,
int
num_surfaces
,
VASurfaceID
*
surfaces
);
VASurfaceID
i965_post_processing
(
i965_post_processing
(
VADriverContextP
ctx
,
VADriverContextP
ctx
,
VASurfaceID
surface
,
VASurfaceID
surface
,
const
VARectangle
*
src_rect
,
const
VARectangle
*
src_rect
,
const
VARectangle
*
dst_rect
,
const
VARectangle
*
dst_rect
,
unsigned
int
flags
unsigned
int
flags
,
int
*
has_done_scaling
)
)
{
{
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
VASurfaceID
in_surface_id
=
surface
;
VASurfaceID
out_surface_id
=
VA_INVALID_ID
;
if
(
HAS_PP
(
i965
))
{
if
(
HAS_PP
(
i965
))
{
/* Currently only support post processing for NV12 surface */
/* Currently only support post processing for NV12 surface */
if
(
i965
->
render_state
.
interleaved_uv
)
{
if
(
i965
->
render_state
.
interleaved_uv
)
{
int
internal_input
=
0
;
struct
object_surface
*
obj_surface
;
VAStatus
status
;
if
(
flags
&
I965_PP_FLAG_DEINTERLACING
)
{
if
(
flags
&
I965_PP_FLAG_DEINTERLACING
)
{
i965_post_processing_internal
(
ctx
,
surface
,
internal_input
,
obj_surface
=
SURFACE
(
in_surface_id
);
status
=
i965_CreateSurfaces
(
ctx
,
obj_surface
->
orig_width
,
obj_surface
->
orig_height
,
VA_RT_FORMAT_YUV420
,
1
,
&
out_surface_id
);
assert
(
status
==
VA_STATUS_SUCCESS
);
obj_surface
=
SURFACE
(
out_surface_id
);
i965_check_alloc_surface_bo
(
ctx
,
obj_surface
,
0
,
VA_FOURCC
(
'N'
,
'V'
,
'1'
,
'2'
));
i965_post_processing_internal
(
ctx
,
in_surface_id
,
out_surface_id
,
src_rect
,
dst_rect
,
src_rect
,
dst_rect
,
PP_NV12_DNDI
);
PP_NV12_DNDI
);
internal_input
=
1
;
}
}
if
(
flags
&
I965_PP_FLAG_AVS
)
{
if
(
flags
&
I965_PP_FLAG_AVS
)
{
i965_post_processing_internal
(
ctx
,
surface
,
internal_input
,
struct
i965_render_state
*
render_state
=
&
i965
->
render_state
;
struct
intel_region
*
dest_region
=
render_state
->
draw_region
;
if
(
out_surface_id
!=
VA_INVALID_ID
)
in_surface_id
=
out_surface_id
;
status
=
i965_CreateSurfaces
(
ctx
,
dest_region
->
width
,
dest_region
->
height
,
VA_RT_FORMAT_YUV420
,
1
,
&
out_surface_id
);
assert
(
status
==
VA_STATUS_SUCCESS
);
obj_surface
=
SURFACE
(
out_surface_id
);
i965_check_alloc_surface_bo
(
ctx
,
obj_surface
,
0
,
VA_FOURCC
(
'N'
,
'V'
,
'1'
,
'2'
));
i965_post_processing_internal
(
ctx
,
in_surface_id
,
out_surface_id
,
src_rect
,
dst_rect
,
src_rect
,
dst_rect
,
PP_NV12_AVS
);
PP_NV12_AVS
);
if
(
in_surface_id
!=
surface
)
i965_DestroySurfaces
(
ctx
,
&
in_surface_id
,
1
);
*
has_done_scaling
=
1
;
}
}
}
}
}
}
return
out_surface_id
;
}
}
Bool
Bool
...
...
i965_drv_video/i965_post_processing.h
View file @
12f5b095
...
@@ -53,14 +53,22 @@ struct pp_load_save_context
...
@@ -53,14 +53,22 @@ struct pp_load_save_context
struct
pp_scaling_context
struct
pp_scaling_context
{
{
int
dest_x
;
/* in pixel */
int
dest_y
;
/* in pixel */
int
dest_w
;
int
dest_w
;
int
dest_h
;
int
dest_h
;
int
src_normalized_x
;
int
src_normalized_y
;
};
};
struct
pp_avs_context
struct
pp_avs_context
{
{
int
dest_x
;
/* in pixel */
int
dest_y
;
/* in pixel */
int
dest_w
;
int
dest_w
;
int
dest_h
;
int
dest_h
;
int
src_normalized_x
;
int
src_normalized_y
;
int
src_w
;
int
src_w
;
int
src_h
;
int
src_h
;
};
};
...
@@ -69,7 +77,6 @@ struct pp_dndi_context
...
@@ -69,7 +77,6 @@ struct pp_dndi_context
{
{
int
dest_w
;
int
dest_w
;
int
dest_h
;
int
dest_h
;
};
};
struct
pp_module
struct
pp_module
...
@@ -77,9 +84,9 @@ struct pp_module
...
@@ -77,9 +84,9 @@ struct pp_module
struct
i965_kernel
kernel
;
struct
i965_kernel
kernel
;
/* others */
/* others */
void
(
*
initialize
)(
VADriverContextP
ctx
,
VASurfaceID
surface
,
int
input
,
void
(
*
initialize
)(
VADriverContextP
ctx
,
unsigned
short
srcw
,
unsigned
short
srch
,
VASurfaceID
in_surface_id
,
VASurfaceID
out_surface_id
,
unsigned
short
destw
,
unsigned
short
desth
);
const
VARectangle
*
src_rect
,
const
VARectangle
*
dst_rect
);
};
};
struct
pp_static_parameter
struct
pp_static_parameter
...
@@ -350,13 +357,14 @@ struct i965_post_processing_context
...
@@ -350,13 +357,14 @@ struct i965_post_processing_context
int
(
*
pp_set_block_parameter
)(
struct
i965_post_processing_context
*
pp_context
,
int
x
,
int
y
);
int
(
*
pp_set_block_parameter
)(
struct
i965_post_processing_context
*
pp_context
,
int
x
,
int
y
);
};
};
void
VASurfaceID
i965_post_processing
(
i965_post_processing
(
VADriverContextP
ctx
,
VADriverContextP
ctx
,
VASurfaceID
surface
,
VASurfaceID
surface
,
const
VARectangle
*
src_rect
,
const
VARectangle
*
src_rect
,
const
VARectangle
*
dst_rect
,
const
VARectangle
*
dst_rect
,
unsigned
int
flags
unsigned
int
flags
,
int
*
has_done_scaling
);
);
Bool
Bool
...
...
i965_drv_video/i965_render.c
View file @
12f5b095
...
@@ -757,7 +757,6 @@ i965_render_src_surfaces_state(VADriverContextP ctx,
...
@@ -757,7 +757,6 @@ i965_render_src_surfaces_state(VADriverContextP ctx,
VASurfaceID
surface
)
VASurfaceID
surface
)
{
{
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
i965_render_state
*
render_state
=
&
i965
->
render_state
;
struct
object_surface
*
obj_surface
;
struct
object_surface
*
obj_surface
;
int
w
,
h
;
int
w
,
h
;
int
rw
,
rh
;
int
rw
,
rh
;
...
@@ -766,19 +765,11 @@ i965_render_src_surfaces_state(VADriverContextP ctx,
...
@@ -766,19 +765,11 @@ i965_render_src_surfaces_state(VADriverContextP ctx,
obj_surface
=
SURFACE
(
surface
);
obj_surface
=
SURFACE
(
surface
);
assert
(
obj_surface
);
assert
(
obj_surface
);
if
(
obj_surface
->
pp_out_bo
)
{
w
=
obj_surface
->
pp_out_width
;
h
=
obj_surface
->
pp_out_height
;
rw
=
obj_surface
->
orig_pp_out_width
;
rh
=
obj_surface
->
orig_pp_out_height
;
region
=
obj_surface
->
pp_out_bo
;
}
else
{
w
=
obj_surface
->
width
;
w
=
obj_surface
->
width
;
h
=
obj_surface
->
height
;
h
=
obj_surface
->
height
;
rw
=
obj_surface
->
orig_width
;
rw
=
obj_surface
->
orig_width
;
rh
=
obj_surface
->
orig_height
;
rh
=
obj_surface
->
orig_height
;
region
=
obj_surface
->
bo
;
region
=
obj_surface
->
bo
;
}
i965_render_src_surface_state
(
ctx
,
1
,
region
,
0
,
rw
,
rh
,
w
,
I965_SURFACEFORMAT_R8_UNORM
);
/* Y */
i965_render_src_surface_state
(
ctx
,
1
,
region
,
0
,
rw
,
rh
,
w
,
I965_SURFACEFORMAT_R8_UNORM
);
/* Y */
i965_render_src_surface_state
(
ctx
,
2
,
region
,
0
,
rw
,
rh
,
w
,
I965_SURFACEFORMAT_R8_UNORM
);
i965_render_src_surface_state
(
ctx
,
2
,
region
,
0
,
rw
,
rh
,
w
,
I965_SURFACEFORMAT_R8_UNORM
);
...
@@ -2901,7 +2892,10 @@ gen7_render_put_subpicture(
...
@@ -2901,7 +2892,10 @@ gen7_render_put_subpicture(
/*
/*
* global functions
* global functions
*/
*/
VAStatus
i965_DestroySurfaces
(
VADriverContextP
ctx
,
VASurfaceID
*
surface_list
,
int
num_surfaces
);
void
void
intel_render_put_surface
(
intel_render_put_surface
(
VADriverContextP
ctx
,
VADriverContextP
ctx
,
...
@@ -2912,15 +2906,24 @@ intel_render_put_surface(
...
@@ -2912,15 +2906,24 @@ intel_render_put_surface(
)
)
{
{
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
int
has_done_scaling
=
0
;
VASurfaceID
in_surface_id
=
surface
;
VASurfaceID
out_surface_id
=
i965_post_processing
(
ctx
,
surface
,
src_rect
,
dst_rect
,
flags
,
&
has_done_scaling
);
assert
((
!
has_done_scaling
)
||
(
out_surface_id
!=
VA_INVALID_ID
));
i965_post_processing
(
ctx
,
surface
,
src_rect
,
dst_rect
,
flags
);
if
(
out_surface_id
!=
VA_INVALID_ID
)
in_surface_id
=
out_surface_id
;
if
(
IS_GEN7
(
i965
->
intel
.
device_id
))
if
(
IS_GEN7
(
i965
->
intel
.
device_id
))
gen7_render_put_surface
(
ctx
,
surface
,
src_rect
,
dst_rect
,
flags
);
gen7_render_put_surface
(
ctx
,
in_surface_id
,
has_done_scaling
?
dst_rect
:
src_rect
,
dst_rect
,
flags
);
else
if
(
IS_GEN6
(
i965
->
intel
.
device_id
))
else
if
(
IS_GEN6
(
i965
->
intel
.
device_id
))
gen6_render_put_surface
(
ctx
,
surface
,
src_rect
,
dst_rect
,
flags
);
gen6_render_put_surface
(
ctx
,
in_surface_id
,
has_done_scaling
?
dst_rect
:
src_rect
,
dst_rect
,
flags
);
else
else
i965_render_put_surface
(
ctx
,
surface
,
src_rect
,
dst_rect
,
flags
);
i965_render_put_surface
(
ctx
,
in_surface_id
,
has_done_scaling
?
dst_rect
:
src_rect
,
dst_rect
,
flags
);
if
(
in_surface_id
!=
surface
)
i965_DestroySurfaces
(
ctx
,
&
in_surface_id
,
1
);
}
}
void
void
...
...
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