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
78bf8f01
Commit
78bf8f01
authored
Nov 18, 2009
by
Gwenole Beauchesne
Committed by
Xiang, Haihao
Nov 18, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix upload of the subpicture palette.
parent
06553a76
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
16 deletions
+45
-16
i965_drv_video/i965_defines.h
i965_drv_video/i965_defines.h
+1
-1
i965_drv_video/i965_render.c
i965_drv_video/i965_render.c
+44
-15
No files found.
i965_drv_video/i965_defines.h
View file @
78bf8f01
...
...
@@ -14,7 +14,7 @@
#define CMD_STATE_BASE_ADDRESS CMD(0, 1, 1)
#define CMD_STATE_SIP CMD(0, 1, 2)
#define CMD_PIPELINE_SELECT CMD(1, 1, 4)
#define CMD_SAMPLER_PALETTE_LOAD CMD(3,
3
, 2)
#define CMD_SAMPLER_PALETTE_LOAD CMD(3,
1
, 2)
#define CMD_MEDIA_STATE_POINTERS CMD(2, 0, 0)
#define CMD_MEDIA_OBJECT CMD(2, 1, 0)
...
...
i965_drv_video/i965_render.c
View file @
78bf8f01
...
...
@@ -580,17 +580,31 @@ i965_render_src_surface_state(VADriverContextP ctx,
render_state
->
wm
.
surface
[
index
]
=
ss_bo
;
render_state
->
wm
.
sampler_count
++
;
}
static
void
i965_subpic_render_src_surface_state
(
VADriverContextP
ctx
,
int
index
,
dri_bo
*
region
,
unsigned
long
offset
,
int
w
,
int
h
)
int
w
,
int
h
,
int
fourcc
)
{
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
i965_render_state
*
render_state
=
&
i965
->
render_state
;
struct
i965_surface_state
*
ss
;
dri_bo
*
ss_bo
;
int
surface_format
;
switch
(
fourcc
)
{
case
VA_FOURCC
(
'I'
,
'A'
,
'4'
,
'4'
):
surface_format
=
I965_SURFACEFORMAT_P4A4_UNORM
;
break
;
case
VA_FOURCC
(
'A'
,
'I'
,
'4'
,
'4'
):
surface_format
=
I965_SURFACEFORMAT_A4P4_UNORM
;
break
;
default:
assert
(
0
);
/* XXX: fix supported subpicture formats */
break
;
}
ss_bo
=
dri_bo_alloc
(
i965
->
intel
.
bufmgr
,
"surface state"
,
...
...
@@ -601,7 +615,7 @@ i965_subpic_render_src_surface_state(VADriverContextP ctx,
ss
=
ss_bo
->
virtual
;
memset
(
ss
,
0
,
sizeof
(
*
ss
));
ss
->
ss0
.
surface_type
=
I965_SURFACE_2D
;
ss
->
ss0
.
surface_format
=
I965_SURFACEFORMAT_R8_UNORM
;
ss
->
ss0
.
surface_format
=
surface_format
;
ss
->
ss0
.
writedisable_alpha
=
0
;
ss
->
ss0
.
writedisable_red
=
0
;
ss
->
ss0
.
writedisable_green
=
0
;
...
...
@@ -677,8 +691,8 @@ i965_subpic_render_src_surfaces_state(VADriverContextP ctx,
region
=
obj_surface
->
bo
;
subpic_region
=
obj_image
->
bo
;
/*subpicture surface*/
i965_subpic_render_src_surface_state
(
ctx
,
1
,
subpic_region
,
0
,
obj_image
->
image
.
width
,
obj_image
->
image
.
height
);
i965_subpic_render_src_surface_state
(
ctx
,
2
,
subpic_region
,
0
,
obj_image
->
image
.
width
,
obj_image
->
image
.
height
);
i965_subpic_render_src_surface_state
(
ctx
,
1
,
subpic_region
,
0
,
obj_image
->
image
.
width
,
obj_image
->
image
.
height
,
obj_image
->
image
.
format
.
fourcc
);
i965_subpic_render_src_surface_state
(
ctx
,
2
,
subpic_region
,
0
,
obj_image
->
image
.
width
,
obj_image
->
image
.
height
,
obj_image
->
image
.
format
.
fourcc
);
}
static
void
...
...
@@ -1165,21 +1179,31 @@ i965_render_vertex_elements(VADriverContextP ctx)
}
}
void
i965_render_upload_palette
(
VADriverContextP
ctx
)
static
void
i965_render_upload_image_palette
(
VADriverContextP
ctx
,
VAImageID
image_id
,
unsigned
int
alpha
)
{
BEGIN_BATCH
(
ctx
,
17
);
OUT_BATCH
(
ctx
,
CMD_SAMPLER_PALETTE_LOAD
|
15
);
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
unsigned
int
i
;
struct
object_image
*
obj_image
=
IMAGE
(
image_id
);
assert
(
obj_image
);
if
(
obj_image
->
image
.
num_palette_entries
==
0
)
return
;
BEGIN_BATCH
(
ctx
,
1
+
obj_image
->
image
.
num_palette_entries
);
OUT_BATCH
(
ctx
,
CMD_SAMPLER_PALETTE_LOAD
|
(
obj_image
->
image
.
num_palette_entries
-
1
));
/*fill palette*/
//int32_t out[16]; //0-23:color 23-31:alpha
int32_t
i
,
c
;
for
(
i
=
0
;
i
<
16
;
i
++
){
c
=
i
*
16
;
//16 colors
OUT_BATCH
(
ctx
,
c
<<
24
/*alpha*/
|
c
<<
16
/*R*/
|
c
<<
8
/*G*/
|
c
/*B*/
);
//c<<24/*alpha*/|c<<16/*R*/|c<<8/*G*/|c/*B*/);
}
for
(
i
=
0
;
i
<
obj_image
->
image
.
num_palette_entries
;
i
++
)
OUT_BATCH
(
ctx
,
(
alpha
<<
24
)
|
obj_image
->
palette
[
i
]);
ADVANCE_BATCH
(
ctx
);
}
static
void
i965_render_startup
(
VADriverContextP
ctx
)
{
...
...
@@ -1287,7 +1311,6 @@ i965_subpic_render_pipeline_setup(VADriverContextP ctx)
i965_render_binding_table_pointers
(
ctx
);
i965_render_constant_color
(
ctx
);
i965_render_pipelined_pointers
(
ctx
);
//i965_render_upload_palette(ctx);
i965_render_urb_layout
(
ctx
);
i965_render_cs_urb_layout
(
ctx
);
i965_render_drawing_rectangle
(
ctx
);
...
...
@@ -1415,11 +1438,17 @@ i965_render_put_subpic(VADriverContextP ctx,
unsigned
short
destw
,
unsigned
short
desth
)
{
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
object_surface
*
obj_surface
=
SURFACE
(
surface
);
struct
object_subpic
*
obj_subpic
=
SUBPIC
(
obj_surface
->
subpic
);
assert
(
obj_subpic
);
i965_render_initialize
(
ctx
);
i965_subpic_render_state_setup
(
ctx
,
surface
,
srcx
,
srcy
,
srcw
,
srch
,
destx
,
desty
,
destw
,
desth
);
i965_subpic_render_pipeline_setup
(
ctx
);
i965_render_upload_image_palette
(
ctx
,
obj_subpic
->
image
,
0xff
);
intel_batchbuffer_flush
(
ctx
);
}
...
...
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