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
1ead5459
Commit
1ead5459
authored
Nov 20, 2009
by
Austin Yuan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
git+ssh://AustinYuan@git.freedesktop.org/git/libva
parents
7e62098a
2135de7e
Changes
16
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
344 additions
and
308 deletions
+344
-308
i965_drv_video/i965_defines.h
i965_drv_video/i965_defines.h
+1
-1
i965_drv_video/i965_drv_video.c
i965_drv_video/i965_drv_video.c
+212
-90
i965_drv_video/i965_drv_video.h
i965_drv_video/i965_drv_video.h
+12
-11
i965_drv_video/i965_media_mpeg2.c
i965_drv_video/i965_media_mpeg2.c
+1
-1
i965_drv_video/i965_render.c
i965_drv_video/i965_render.c
+84
-65
i965_drv_video/intel_driver.h
i965_drv_video/intel_driver.h
+1
-0
i965_drv_video/shaders/render/Makefile.am
i965_drv_video/shaders/render/Makefile.am
+3
-3
i965_drv_video/shaders/render/exa_wm_blend_subpicture.g4b
i965_drv_video/shaders/render/exa_wm_blend_subpicture.g4b
+0
-15
i965_drv_video/shaders/render/exa_wm_blend_subpicture.g4b.gen5
...drv_video/shaders/render/exa_wm_blend_subpicture.g4b.gen5
+0
-15
i965_drv_video/shaders/render/exa_wm_src_sample_argb.g4a
i965_drv_video/shaders/render/exa_wm_src_sample_argb.g4a
+7
-43
i965_drv_video/shaders/render/exa_wm_src_sample_argb.g4b
i965_drv_video/shaders/render/exa_wm_src_sample_argb.g4b
+2
-0
i965_drv_video/shaders/render/exa_wm_src_sample_argb.g4b.gen5
..._drv_video/shaders/render/exa_wm_src_sample_argb.g4b.gen5
+2
-0
src/va.c
src/va.c
+2
-0
src/va.h
src/va.h
+3
-1
src/x11/dri1_util.c
src/x11/dri1_util.c
+0
-1
src/x11/va_x11.c
src/x11/va_x11.c
+14
-62
No files found.
i965_drv_video/i965_defines.h
View file @
1ead5459
...
...
@@ -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_drv_video.c
View file @
1ead5459
This diff is collapsed.
Click to expand it.
i965_drv_video/i965_drv_video.h
View file @
1ead5459
...
...
@@ -42,7 +42,7 @@
#define I965_MAX_ENTRYPOINTS 5
#define I965_MAX_CONFIG_ATTRIBUTES 10
#define I965_MAX_IMAGE_FORMATS 10
#define I965_MAX_SUBPIC_FORMATS
4
#define I965_MAX_SUBPIC_FORMATS
2
#define I965_MAX_DISPLAY_ATTRIBUTES 4
#define I965_STR_VENDOR "i965 Driver 0.1"
...
...
@@ -106,23 +106,24 @@ struct object_buffer
int
size_element
;
VABufferType
type
;
};
struct
object_image
{
struct
object_base
base
;
int
width
;
int
height
;
int
size
;
VAImage
image
;
dri_bo
*
bo
;
unsigned
int
*
palette
;
};
struct
object_subpic
{
struct
object_base
base
;
VAImageID
image
;
int
dstx
;
int
dsty
;
VARectangle
src_rect
;
VARectangle
dst_rect
;
unsigned
int
format
;
int
width
;
int
height
;
unsigned
char
palette
[
3
][
16
];
dri_bo
*
bo
;
};
...
...
i965_drv_video/i965_media_mpeg2.c
View file @
1ead5459
...
...
@@ -868,7 +868,7 @@ i965_media_mpeg2_objects(VADriverContextP ctx, struct decode_state *decode_state
I915_GEM_DOMAIN_SAMPLER
,
0
,
slice_param
->
slice_data_offset
+
(
slice_param
->
macroblock_offset
>>
3
));
OUT_BATCH
(
ctx
,
((
0
<<
24
)
|
((
slice_param
->
slice_horizontal_position
<<
24
)
|
(
slice_param
->
slice_vertical_position
<<
16
)
|
(
127
<<
8
)
|
(
slice_param
->
macroblock_offset
&
0x7
)));
...
...
i965_drv_video/i965_render.c
View file @
1ead5459
...
...
@@ -70,7 +70,7 @@ static const unsigned int ps_subpic_kernel_static[][4] =
{
#include "shaders/render/exa_wm_xy.g4b"
#include "shaders/render/exa_wm_src_affine.g4b"
#include "shaders/render/exa_wm_
blend_subpicture
.g4b"
#include "shaders/render/exa_wm_
src_sample_argb
.g4b"
#include "shaders/render/exa_wm_write.g4b"
};
...
...
@@ -92,7 +92,7 @@ static const unsigned int ps_subpic_kernel_static_gen5[][4] =
{
#include "shaders/render/exa_wm_xy.g4b.gen5"
#include "shaders/render/exa_wm_src_affine.g4b.gen5"
#include "shaders/render/exa_wm_
blend_subpicture
.g4b.gen5"
#include "shaders/render/exa_wm_
src_sample_argb
.g4b.gen5"
#include "shaders/render/exa_wm_write.g4b.gen5"
};
...
...
@@ -580,12 +580,13 @@ 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
format
)
{
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
i965_render_state
*
render_state
=
&
i965
->
render_state
;
...
...
@@ -601,7 +602,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
=
format
;
ss
->
ss0
.
writedisable_alpha
=
0
;
ss
->
ss0
.
writedisable_red
=
0
;
ss
->
ss0
.
writedisable_green
=
0
;
...
...
@@ -677,8 +678,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
->
width
,
obj_image
->
heigh
t
);
i965_subpic_render_src_surface_state
(
ctx
,
2
,
subpic_region
,
0
,
obj_
image
->
width
,
obj_image
->
height
);
i965_subpic_render_src_surface_state
(
ctx
,
1
,
subpic_region
,
0
,
obj_
subpic
->
width
,
obj_subpic
->
height
,
obj_subpic
->
forma
t
);
i965_subpic_render_src_surface_state
(
ctx
,
2
,
subpic_region
,
0
,
obj_
subpic
->
width
,
obj_subpic
->
height
,
obj_subpic
->
format
);
}
static
void
...
...
@@ -789,57 +790,56 @@ i965_render_binding_table(VADriverContextP ctx)
static
void
i965_subpic_render_upload_vertex
(
VADriverContextP
ctx
,
VASurfaceID
surface
,
short
srcx
,
short
srcy
,
unsigned
short
srcw
,
unsigned
short
srch
,
short
destx
,
short
desty
,
unsigned
short
destw
,
unsigned
short
desth
)
const
VARectangle
*
output_rect
)
{
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
i965_render_state
*
render_state
=
&
i965
->
render_state
;
struct
intel_region
*
dest_region
=
render_state
->
draw_region
;
struct
object_surface
*
obj_surface
;
struct
object_subpic
*
obj_subpic
;
float
*
vb
;
float
src_scale_x
,
src_scale_y
;
int
i
,
width
,
height
;
obj_surface
=
SURFACE
(
surface
);
obj_subpic
=
SUBPIC
(
obj_surface
->
subpic
);
assert
(
obj_surface
);
assert
(
obj_subpic
);
int
box_x1
=
dest_region
->
x
+
obj_subpic
->
dstx
;
int
box_y1
=
dest_region
->
y
+
obj_subpic
->
dsty
;
int
box_x2
=
box_x1
+
obj_subpic
->
width
;
int
box_y2
=
box_y1
+
obj_subpic
->
height
;
struct
object_surface
*
obj_surface
=
SURFACE
(
surface
);
struct
object_subpic
*
obj_subpic
=
SUBPIC
(
obj_surface
->
subpic
);
width
=
obj_surface
->
width
;
height
=
obj_surface
->
height
;
src_scale_x
=
((
float
)
srcw
/
width
)
/
(
float
)
destw
;
src_scale_y
=
((
float
)
srch
/
height
)
/
(
float
)
desth
;
const
float
psx
=
(
float
)
obj_surface
->
width
/
(
float
)
obj_subpic
->
width
;
const
float
psy
=
(
float
)
obj_surface
->
height
/
(
float
)
obj_subpic
->
height
;
const
float
ssx
=
(
float
)
output_rect
->
width
/
(
float
)
obj_surface
->
width
;
const
float
ssy
=
(
float
)
output_rect
->
height
/
(
float
)
obj_surface
->
height
;
const
float
sx
=
psx
*
ssx
;
const
float
sy
=
psy
*
ssy
;
float
*
vb
,
tx1
,
tx2
,
ty1
,
ty2
,
x1
,
x2
,
y1
,
y2
;
int
i
=
0
;
VARectangle
dst_rect
;
dst_rect
.
x
=
output_rect
->
x
+
sx
*
(
float
)
obj_subpic
->
dst_rect
.
x
;
dst_rect
.
y
=
output_rect
->
y
+
sx
*
(
float
)
obj_subpic
->
dst_rect
.
y
;
dst_rect
.
width
=
sx
*
(
float
)
obj_subpic
->
dst_rect
.
width
;
dst_rect
.
height
=
sy
*
(
float
)
obj_subpic
->
dst_rect
.
height
;
dri_bo_map
(
render_state
->
vb
.
vertex_buffer
,
1
);
assert
(
render_state
->
vb
.
vertex_buffer
->
virtual
);
vb
=
render_state
->
vb
.
vertex_buffer
->
virtual
;
/*vertex covers the full subpicture*/
i
=
0
;
vb
[
i
++
]
=
1
;
vb
[
i
++
]
=
1
;
vb
[
i
++
]
=
(
float
)
box_x2
;
vb
[
i
++
]
=
(
float
)
box_y2
;
vb
[
i
++
]
=
0
.
0
;
vb
[
i
++
]
=
1
;
vb
[
i
++
]
=
(
float
)
box_x1
;
vb
[
i
++
]
=
(
float
)
box_y2
;
vb
[
i
++
]
=
0
.
0
;
vb
[
i
++
]
=
0
.
0
;
vb
[
i
++
]
=
(
float
)
box_x1
;
vb
[
i
++
]
=
(
float
)
box_y1
;
tx1
=
(
float
)
obj_subpic
->
src_rect
.
x
/
(
float
)
obj_subpic
->
width
;
ty1
=
(
float
)
obj_subpic
->
src_rect
.
y
/
(
float
)
obj_subpic
->
height
;
tx2
=
(
float
)(
obj_subpic
->
src_rect
.
x
+
obj_subpic
->
src_rect
.
width
)
/
(
float
)
obj_subpic
->
width
;
ty2
=
(
float
)(
obj_subpic
->
src_rect
.
y
+
obj_subpic
->
src_rect
.
height
)
/
(
float
)
obj_subpic
->
height
;
x1
=
(
float
)
dst_rect
.
x
;
y1
=
(
float
)
dst_rect
.
y
;
x2
=
(
float
)(
dst_rect
.
x
+
dst_rect
.
width
);
y2
=
(
float
)(
dst_rect
.
y
+
dst_rect
.
height
);
vb
[
i
++
]
=
tx2
;
vb
[
i
++
]
=
ty2
;
vb
[
i
++
]
=
x2
;
vb
[
i
++
]
=
y2
;
vb
[
i
++
]
=
tx1
;
vb
[
i
++
]
=
ty2
;
vb
[
i
++
]
=
x1
;
vb
[
i
++
]
=
y2
;
vb
[
i
++
]
=
tx1
;
vb
[
i
++
]
=
ty1
;
vb
[
i
++
]
=
x1
;
vb
[
i
++
]
=
y1
;
dri_bo_unmap
(
render_state
->
vb
.
vertex_buffer
);
}
...
...
@@ -947,9 +947,13 @@ i965_subpic_render_state_setup(VADriverContextP ctx,
i965_render_cc_viewport
(
ctx
);
i965_subpic_render_cc_unit
(
ctx
);
i965_render_binding_table
(
ctx
);
i965_subpic_render_upload_vertex
(
ctx
,
surface
,
srcx
,
srcy
,
srcw
,
srch
,
destx
,
desty
,
destw
,
desth
);
VARectangle
output_rect
;
output_rect
.
x
=
destx
;
output_rect
.
y
=
desty
;
output_rect
.
width
=
destw
;
output_rect
.
height
=
desth
;
i965_subpic_render_upload_vertex
(
ctx
,
surface
,
&
output_rect
);
}
...
...
@@ -1162,21 +1166,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
)
{
...
...
@@ -1284,7 +1298,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
);
...
...
@@ -1412,11 +1425,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
);
}
...
...
i965_drv_video/intel_driver.h
View file @
1ead5459
...
...
@@ -43,6 +43,7 @@ struct intel_batchbuffer;
#define ALIGN(i, n) (((i) + (n) - 1) & ~((n) - 1))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define SET_BLOCKED_SIGSET() do { \
sigset_t bl_mask; \
...
...
i965_drv_video/shaders/render/Makefile.am
View file @
1ead5459
...
...
@@ -7,27 +7,27 @@ INTEL_G4A = \
exa_sf.g4a
\
exa_wm_xy.g4a
\
exa_wm_src_affine.g4a
\
exa_wm_src_sample_argb.g4a
\
exa_wm_src_sample_planar.g4a
\
exa_wm_yuv_rgb.g4a
\
exa_wm_blend_subpicture.g4a
\
exa_wm_write.g4a
INTEL_G4B
=
\
exa_sf.g4b
\
exa_wm_xy.g4b
\
exa_wm_src_affine.g4b
\
exa_wm_src_sample_argb.g4b
\
exa_wm_src_sample_planar.g4b
\
exa_wm_yuv_rgb.g4b
\
exa_wm_blend_subpicture.g4b
\
exa_wm_write.g4b
INTEL_G4B_GEN5
=
\
exa_sf.g4b.gen5
\
exa_wm_xy.g4b.gen5
\
exa_wm_src_affine.g4b.gen5
\
exa_wm_src_sample_argb.g4b.gen5
\
exa_wm_src_sample_planar.g4b.gen5
\
exa_wm_yuv_rgb.g4b.gen5
\
exa_wm_blend_subpicture.g4b.gen5
\
exa_wm_write.g4b.gen5
EXTRA_DIST
=
$(INTEL_G4I)
\
...
...
i965_drv_video/shaders/render/exa_wm_blend_subpicture.g4b
deleted
100644 → 0
View file @
7e62098a
{ 0x00000201, 0x20080061, 0x00000000, 0x0000e000 },
{ 0x01800031, 0x22001d29, 0x008d0000, 0x02520001 },
{ 0x01800031, 0x21c01d29, 0x008d0000, 0x02520201 },
{ 0x01800031, 0x22401d29, 0x008d0000, 0x02520401 },
{ 0x00600001, 0x228003bd, 0x008d01c0, 0x00000000 },
{ 0x00600001, 0x22a003bd, 0x008d01e0, 0x00000000 },
{ 0x00600040, 0x21c07fbd, 0x008d01c0, 0x3f000000 },
{ 0x00600040, 0x21e07fbd, 0x008d01e0, 0x3f000000 },
{ 0x00600040, 0x22007fbd, 0x008d0200, 0x3f000000 },
{ 0x00600040, 0x22207fbd, 0x008d0220, 0x3f000000 },
{ 0x00600040, 0x22407fbd, 0x008d0240, 0x3f000000 },
{ 0x00600040, 0x22607fbd, 0x008d0260, 0x3f000000 },
{ 0x0000007e, 0x00000000, 0x00000000, 0x00000000 },
{ 0x0000007e, 0x00000000, 0x00000000, 0x00000000 },
{ 0x0000007e, 0x00000000, 0x00000000, 0x00000000 },
i965_drv_video/shaders/render/exa_wm_blend_subpicture.g4b.gen5
deleted
100644 → 0
View file @
7e62098a
{ 0x00000201, 0x20080061, 0x00000000, 0x0000e000 },
{ 0x01800031, 0x22001d29, 0x208d0000, 0x0a2a0001 },
{ 0x01800031, 0x21c01d29, 0x208d0000, 0x0a2a0201 },
{ 0x01800031, 0x22401d29, 0x208d0000, 0x0a2a0401 },
{ 0x00600001, 0x228003bd, 0x008d01c0, 0x00000000 },
{ 0x00600001, 0x22a003bd, 0x008d01e0, 0x00000000 },
{ 0x00600040, 0x21c07fbd, 0x008d01c0, 0x3f000000 },
{ 0x00600040, 0x21e07fbd, 0x008d01e0, 0x3f000000 },
{ 0x00600040, 0x22007fbd, 0x008d0200, 0x3f000000 },
{ 0x00600040, 0x22207fbd, 0x008d0220, 0x3f000000 },
{ 0x00600040, 0x22407fbd, 0x008d0240, 0x3f000000 },
{ 0x00600040, 0x22607fbd, 0x008d0260, 0x3f000000 },
{ 0x0000007e, 0x00000000, 0x00000000, 0x00000000 },
{ 0x0000007e, 0x00000000, 0x00000000, 0x00000000 },
{ 0x0000007e, 0x00000000, 0x00000000, 0x00000000 },
i965_drv_video/shaders/render/exa_wm_
blend_subpicture
.g4a
→
i965_drv_video/shaders/render/exa_wm_
src_sample_argb
.g4a
View file @
1ead5459
...
...
@@ -25,7 +25,8 @@
* Keith Packard <keithp@keithp.com>
*/
/* Sample the src surface in planar format */
/* Sample the src surface */
include(`exa_wm.g4i')
/* prepare sampler read back gX register, which would be written back to output */
...
...
@@ -33,51 +34,14 @@ include(`exa_wm.g4i')
/* use simd16 sampler, param 0 is u, param 1 is v. */
/* 'payload' loading, assuming tex coord start from g4 */
/* load
r
*/
mov (1) g0.8<1>UD 0x0000
e
000UD { align1 mask_disable };
/* load
argb
*/
mov (1) g0.8<1>UD 0x0000
0
000UD { align1 mask_disable };
/* src_msg will be copied with g0, as it contains send desc */
/* emit sampler 'send' cmd */
/* sample Y */
send (16) src_msg_ind /* msg reg index */
src_sample_g<1>UW /* readback */
g0<8,8,1>UW /* copy to msg start reg*/
sampler (1,0,F) /* sampler message description, (binding_table,sampler_index,datatype)*/
mlen 5 rlen 2 {align1};
/* sample U (Cr) */
send (16) src_msg_ind /* msg reg index */
src_sample_
r
<1>UW /* readback */
src_sample_
base
<1>UW /* readback */
g0<8,8,1>UW /* copy to msg start reg*/
sampler (1,
2
,F) /* sampler message description, (binding_table,sampler_index,datatype)
sampler (1,
0
,F) /* sampler message description, (binding_table,sampler_index,datatype)
/* here(src->dst) we should use src_sampler and src_surface */
mlen 5 rlen 2 { align1 }; /* required message len 5, readback len 8 */
/* sample V (Cb) */
send (16) src_msg_ind /* msg reg index */
src_sample_b<1>UW /* readback */
g0<8,8,1>UW /* copy to msg start reg*/
sampler (1,4,F) /* sampler message description, (binding_table,sampler_index,datatype)
/* here(src->dst) we should use src_sampler and src_surface */
mlen 5 rlen 2 { align1 }; /* required message len 5, readback len 8 */
/*extract alpha value, alpha value stores in one float with color value, because the color value is small,
we can neglect it when doing alpha blend*/
mov (8) src_sample_a<1>F g14<8,8,1>F { align1 };
mov (8) src_sample_a_23<1>F g15<8,8,1>F { align1 };
/*set subtitle color*/
add (8) g14<1>F g14<8,8,1>F 0.5F { align1 };
add (8) g15<1>F g15<8,8,1>F 0.5F { align1 };
add (8) g16<1>F g16<8,8,1>F 0.5F { align1 };
add (8) g17<1>F g17<8,8,1>F 0.5F { align1 };
add (8) g18<1>F g18<8,8,1>F 0.5F { align1 };
add (8) g19<1>F g19<8,8,1>F 0.5F { align1 };
nop;
nop;
nop;
mlen 5 rlen 8 { align1 }; /* required message len 5, readback len 8 */
i965_drv_video/shaders/render/exa_wm_src_sample_argb.g4b
0 → 100644
View file @
1ead5459
{ 0x00000201, 0x20080061, 0x00000000, 0x00000000 },
{ 0x01800031, 0x21c01d29, 0x008d0000, 0x02580001 },
i965_drv_video/shaders/render/exa_wm_src_sample_argb.g4b.gen5
0 → 100644
View file @
1ead5459
{ 0x00000201, 0x20080061, 0x00000000, 0x00000000 },
{ 0x01800031, 0x21c01d29, 0x208d0000, 0x0a8a0001 },
src/va.c
View file @
1ead5459
...
...
@@ -313,6 +313,8 @@ const char *vaErrorStr(VAStatus error_status)
return
"resolution not supported"
;
case
VA_STATUS_ERROR_UNIMPLEMENTED
:
return
"the requested function is not implemented"
;
case
VA_STATUS_ERROR_SURFACE_IN_DISPLAYING
:
return
"surface is in displaying (may by overlay)"
;
case
VA_STATUS_ERROR_UNKNOWN
:
return
"unknown libva error"
;
}
...
...
src/va.h
100644 → 100755
View file @
1ead5459
...
...
@@ -128,6 +128,7 @@ typedef int VAStatus; /* Return status type from functions */
#define VA_STATUS_ERROR_INVALID_PARAMETER 0x00000012
#define VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED 0x00000013
#define VA_STATUS_ERROR_UNIMPLEMENTED 0x00000014
#define VA_STATUS_ERROR_SURFACE_IN_DISPLAYING 0x00000015
#define VA_STATUS_ERROR_UNKNOWN 0xFFFFFFFF
/*
...
...
@@ -569,6 +570,7 @@ typedef struct _VASliceParameterBufferMPEG2
unsigned
int
slice_data_offset
;
/* the offset to the first byte of slice data */
unsigned
int
slice_data_flag
;
/* see VA_SLICE_DATA_FLAG_XXX defintions */
unsigned
int
macroblock_offset
;
/* the offset to the first bit of MB from the first byte of slice data */
unsigned
int
slice_horizontal_position
;
unsigned
int
slice_vertical_position
;
int
quantiser_scale_code
;
int
intra_slice_flag
;
...
...
src/x11/dri1_util.c
View file @
1ead5459
...
...
@@ -107,7 +107,6 @@ isDRI1Connected(VADriverContextP ctx, char **driver_name)
dri_state
->
fd
=
drmOpenOnce
(
NULL
,
BusID
,
&
newlyopened
);
XFree
(
BusID
);
assert
(
dri_state
->
fd
>=
0
);
if
(
dri_state
->
fd
<
0
)
goto
err_out1
;
...
...
src/x11/va_x11.c
View file @
1ead5459
...
...
@@ -42,26 +42,6 @@
static
VADisplayContextP
pDisplayContexts
=
NULL
;
static
void
va_errorMessage
(
const
char
*
msg
,
...)
{
va_list
args
;
fprintf
(
stderr
,
"libva error: "
);
va_start
(
args
,
msg
);
vfprintf
(
stderr
,
msg
,
args
);
va_end
(
args
);
}
static
void
va_infoMessage
(
const
char
*
msg
,
...)
{
va_list
args
;
fprintf
(
stderr
,
"libva: "
);
va_start
(
args
,
msg
);
vfprintf
(
stderr
,
msg
,
args
);
va_end
(
args
);
}
static
int
va_DisplayContextIsValid
(
VADisplayContextP
pDisplayContext
)
...
...
@@ -132,49 +112,21 @@ static VAStatus va_NVCTRL_GetDriverName (
)
{
VADriverContextP
ctx
=
pDisplayContext
->
pDriverContext
;
VAStatus
vaStatus
=
VA_STATUS_ERROR_UNKNOWN
;
int
direct_capable
;
int
driver_major
;
int
driver_minor
;
int
driver_patch
;
Bool
result
=
True
;
char
*
nvidia_driver_name
=
NULL
;
int
direct_capable
,
driver_major
,
driver_minor
,
driver_patch
;
Bool
result
;
if
(
result
)
{
result
=
VA_NVCTRLQueryDirectRenderingCapable
(
ctx
->
x11_dpy
,
ctx
->
x11_screen
,
&
direct_capable
);
if
(
!
result
)
{
va_errorMessage
(
"VA_NVCTRLQueryDirectRenderingCapable failed
\n
"
);
}
}
if
(
result
)
{
result
=
direct_capable
;
if
(
!
result
)
{
va_errorMessage
(
"VA_NVCTRLQueryDirectRenderingCapable returned false
\n
"
);
}
}
if
(
result
)
{
result
=
VA_NVCTRLGetClientDriverName
(
ctx
->
x11_dpy
,
ctx
->
x11_screen
,
&
driver_major
,
&
driver_minor
,
&
driver_patch
,
&
nvidia_driver_name
);
result
=
VA_NVCTRLQueryDirectRenderingCapable
(
ctx
->
x11_dpy
,
ctx
->
x11_screen
,
&
direct_capable
);
if
(
!
result
||
!
direct_capable
)
return
VA_STATUS_ERROR_UNKNOWN
;
result
=
VA_NVCTRLGetClientDriverName
(
ctx
->
x11_dpy
,
ctx
->
x11_screen
,
&
driver_major
,
&
driver_minor
,
&
driver_patch
,
driver_name
);
if
(
!
result
)
{
va_errorMessage
(
"VA_NVCTRLGetClientDriverName returned false
\n
"
);
}
}
if
(
result
)
{
vaStatus
=
VA_STATUS_SUCCESS
;
va_infoMessage
(
"va_NVCTRL_GetDriverName: %d.%d.%d %s (screen %d)
\n
"
,
driver_major
,
driver_minor
,
driver_patch
,
nvidia_driver_name
,
ctx
->
x11_screen
);
if
(
driver_name
)
*
driver_name
=
nvidia_driver_name
;
}
return
vaStatus
;
return
VA_STATUS_ERROR_UNKNOWN
;
return
VA_STATUS_SUCCESS
;
}
static
VAStatus
va_DisplayContextGetDriverName
(
...
...
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