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
daa6c567
Commit
daa6c567
authored
Jan 27, 2011
by
Gwenole Beauchesne
Committed by
Xiang, Haihao
Jan 27, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[G45] Fix check for H.264 decoding support.
parent
63f85159
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
27 deletions
+48
-27
i965_drv_video/i965_drv_video.c
i965_drv_video/i965_drv_video.c
+27
-16
i965_drv_video/intel_batchbuffer.c
i965_drv_video/intel_batchbuffer.c
+8
-6
i965_drv_video/intel_driver.c
i965_drv_video/intel_driver.c
+9
-5
i965_drv_video/intel_driver.h
i965_drv_video/intel_driver.h
+4
-0
No files found.
i965_drv_video/i965_drv_video.c
View file @
daa6c567
...
@@ -50,6 +50,12 @@
...
@@ -50,6 +50,12 @@
#define HAS_VC1(ctx) (IS_GEN6((ctx)->intel.device_id))
#define HAS_VC1(ctx) (IS_GEN6((ctx)->intel.device_id))
/* Defined to 1 if GPU supports H.264 decoding */
/* XXX: drop IS_IRONLAKE(ctx) check once G4X support is available */
#define HAS_H264(ctx) (IS_GEN6((ctx)->intel.device_id) || \
(IS_IRONLAKE((ctx)->intel.device_id) && \
(ctx)->intel.has_bsd))
enum
{
enum
{
I965_SURFACETYPE_RGBA
=
1
,
I965_SURFACETYPE_RGBA
=
1
,
I965_SURFACETYPE_YUV
,
I965_SURFACETYPE_YUV
,
...
@@ -126,9 +132,12 @@ i965_QueryConfigProfiles(VADriverContextP ctx,
...
@@ -126,9 +132,12 @@ i965_QueryConfigProfiles(VADriverContextP ctx,
profile_list
[
i
++
]
=
VAProfileMPEG2Simple
;
profile_list
[
i
++
]
=
VAProfileMPEG2Simple
;
profile_list
[
i
++
]
=
VAProfileMPEG2Main
;
profile_list
[
i
++
]
=
VAProfileMPEG2Main
;
if
(
HAS_H264
(
i965
))
{
profile_list
[
i
++
]
=
VAProfileH264Baseline
;
profile_list
[
i
++
]
=
VAProfileH264Baseline
;
profile_list
[
i
++
]
=
VAProfileH264Main
;
profile_list
[
i
++
]
=
VAProfileH264Main
;
profile_list
[
i
++
]
=
VAProfileH264High
;
profile_list
[
i
++
]
=
VAProfileH264High
;
}
if
(
HAS_VC1
(
i965
))
{
if
(
HAS_VC1
(
i965
))
{
profile_list
[
i
++
]
=
VAProfileVC1Simple
;
profile_list
[
i
++
]
=
VAProfileVC1Simple
;
...
@@ -161,6 +170,7 @@ i965_QueryConfigEntrypoints(VADriverContextP ctx,
...
@@ -161,6 +170,7 @@ i965_QueryConfigEntrypoints(VADriverContextP ctx,
case
VAProfileH264Baseline
:
case
VAProfileH264Baseline
:
case
VAProfileH264Main
:
case
VAProfileH264Main
:
case
VAProfileH264High
:
case
VAProfileH264High
:
if
(
HAS_H264
(
i965
))
entrypoint_list
[
n
++
]
=
VAEntrypointVLD
;
entrypoint_list
[
n
++
]
=
VAEntrypointVLD
;
break
;
break
;
...
@@ -267,7 +277,7 @@ i965_CreateConfig(VADriverContextP ctx,
...
@@ -267,7 +277,7 @@ i965_CreateConfig(VADriverContextP ctx,
case
VAProfileH264Baseline
:
case
VAProfileH264Baseline
:
case
VAProfileH264Main
:
case
VAProfileH264Main
:
case
VAProfileH264High
:
case
VAProfileH264High
:
if
(
VAEntrypointVLD
==
entrypoint
)
{
if
(
HAS_H264
(
i965
)
&&
VAEntrypointVLD
==
entrypoint
)
{
vaStatus
=
VA_STATUS_SUCCESS
;
vaStatus
=
VA_STATUS_SUCCESS
;
}
else
{
}
else
{
vaStatus
=
VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT
;
vaStatus
=
VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT
;
...
@@ -330,6 +340,7 @@ i965_CreateConfig(VADriverContextP ctx,
...
@@ -330,6 +340,7 @@ i965_CreateConfig(VADriverContextP ctx,
VAStatus
VAStatus
i965_DestroyConfig
(
VADriverContextP
ctx
,
VAConfigID
config_id
)
i965_DestroyConfig
(
VADriverContextP
ctx
,
VAConfigID
config_id
)
{
{
struct
intel_driver_data
*
const
intel
=
intel_driver_data
(
ctx
);
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
object_config
*
obj_config
=
CONFIG
(
config_id
);
struct
object_config
*
obj_config
=
CONFIG
(
config_id
);
VAStatus
vaStatus
;
VAStatus
vaStatus
;
...
@@ -755,18 +766,17 @@ i965_CreateContext(VADriverContextP ctx,
...
@@ -755,18 +766,17 @@ i965_CreateContext(VADriverContextP ctx,
return
vaStatus
;
return
vaStatus
;
}
}
if
(
IS_GEN6
(
i965
->
intel
.
device_id
))
render_state
->
interleaved_uv
=
1
;
else
{
switch
(
obj_config
->
profile
)
{
switch
(
obj_config
->
profile
)
{
case
VAProfileH264Baseline
:
case
VAProfileH264Baseline
:
case
VAProfileH264Main
:
case
VAProfileH264Main
:
case
VAProfileH264High
:
case
VAProfileH264High
:
if
(
!
HAS_H264
(
i965
))
return
VA_STATUS_ERROR_UNSUPPORTED_PROFILE
;
render_state
->
interleaved_uv
=
1
;
render_state
->
interleaved_uv
=
1
;
break
;
break
;
default:
default:
render_state
->
interleaved_uv
=
0
;
render_state
->
interleaved_uv
=
!!
IS_GEN6
(
i965
->
intel
.
device_id
)
;
}
break
;
}
}
obj_context
->
context_id
=
contextID
;
obj_context
->
context_id
=
contextID
;
...
@@ -987,6 +997,7 @@ i965_BeginPicture(VADriverContextP ctx,
...
@@ -987,6 +997,7 @@ i965_BeginPicture(VADriverContextP ctx,
VAContextID
context
,
VAContextID
context
,
VASurfaceID
render_target
)
VASurfaceID
render_target
)
{
{
struct
intel_driver_data
*
const
intel
=
intel_driver_data
(
ctx
);
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
i965_driver_data
*
i965
=
i965_driver_data
(
ctx
);
struct
object_context
*
obj_context
=
CONTEXT
(
context
);
struct
object_context
*
obj_context
=
CONTEXT
(
context
);
struct
object_surface
*
obj_surface
=
SURFACE
(
render_target
);
struct
object_surface
*
obj_surface
=
SURFACE
(
render_target
);
...
...
i965_drv_video/intel_batchbuffer.c
View file @
daa6c567
...
@@ -67,12 +67,14 @@ intel_batchbuffer_init(struct intel_driver_data *intel)
...
@@ -67,12 +67,14 @@ intel_batchbuffer_init(struct intel_driver_data *intel)
intel
->
batch
->
run
=
drm_intel_bo_mrb_exec
;
intel
->
batch
->
run
=
drm_intel_bo_mrb_exec
;
intel_batchbuffer_reset
(
intel
->
batch
);
intel_batchbuffer_reset
(
intel
->
batch
);
if
(
intel
->
has_bsd
)
{
intel
->
batch_bcs
=
calloc
(
1
,
sizeof
(
*
(
intel
->
batch_bcs
)));
intel
->
batch_bcs
=
calloc
(
1
,
sizeof
(
*
(
intel
->
batch_bcs
)));
assert
(
intel
->
batch_bcs
);
assert
(
intel
->
batch_bcs
);
intel
->
batch_bcs
->
intel
=
intel
;
intel
->
batch_bcs
->
intel
=
intel
;
intel
->
batch_bcs
->
flag
=
I915_EXEC_BSD
;
intel
->
batch_bcs
->
flag
=
I915_EXEC_BSD
;
intel
->
batch_bcs
->
run
=
drm_intel_bo_mrb_exec
;
intel
->
batch_bcs
->
run
=
drm_intel_bo_mrb_exec
;
intel_batchbuffer_reset
(
intel
->
batch_bcs
);
intel_batchbuffer_reset
(
intel
->
batch_bcs
);
}
return
True
;
return
True
;
}
}
...
...
i965_drv_video/intel_driver.c
View file @
daa6c567
...
@@ -38,16 +38,12 @@
...
@@ -38,16 +38,12 @@
static
Bool
static
Bool
intel_driver_get_param
(
struct
intel_driver_data
*
intel
,
int
param
,
int
*
value
)
intel_driver_get_param
(
struct
intel_driver_data
*
intel
,
int
param
,
int
*
value
)
{
{
int
ret
;
struct
drm_i915_getparam
gp
;
struct
drm_i915_getparam
gp
;
gp
.
param
=
param
;
gp
.
param
=
param
;
gp
.
value
=
value
;
gp
.
value
=
value
;
ret
=
drmCommandWriteRead
(
intel
->
fd
,
DRM_I915_GETPARAM
,
&
gp
,
sizeof
(
gp
));
return
drmCommandWriteRead
(
intel
->
fd
,
DRM_I915_GETPARAM
,
&
gp
,
sizeof
(
gp
))
==
0
;
assert
(
ret
==
0
);
return
True
;
}
}
Bool
Bool
...
@@ -55,6 +51,7 @@ intel_driver_init(VADriverContextP ctx)
...
@@ -55,6 +51,7 @@ intel_driver_init(VADriverContextP ctx)
{
{
struct
intel_driver_data
*
intel
=
intel_driver_data
(
ctx
);
struct
intel_driver_data
*
intel
=
intel_driver_data
(
ctx
);
struct
dri_state
*
dri_state
=
(
struct
dri_state
*
)
ctx
->
dri_state
;
struct
dri_state
*
dri_state
=
(
struct
dri_state
*
)
ctx
->
dri_state
;
int
has_exec2
,
has_bsd
,
has_blt
;
assert
(
dri_state
);
assert
(
dri_state
);
assert
(
dri_state
->
driConnectedFlag
==
VA_DRI2
||
assert
(
dri_state
->
driConnectedFlag
==
VA_DRI2
||
...
@@ -76,6 +73,13 @@ intel_driver_init(VADriverContextP ctx)
...
@@ -76,6 +73,13 @@ intel_driver_init(VADriverContextP ctx)
pthread_mutex_init
(
&
intel
->
ctxmutex
,
NULL
);
pthread_mutex_init
(
&
intel
->
ctxmutex
,
NULL
);
intel_driver_get_param
(
intel
,
I915_PARAM_CHIPSET_ID
,
&
intel
->
device_id
);
intel_driver_get_param
(
intel
,
I915_PARAM_CHIPSET_ID
,
&
intel
->
device_id
);
if
(
intel_driver_get_param
(
intel
,
I915_PARAM_HAS_EXECBUF2
,
&
has_exec2
))
intel
->
has_exec2
=
has_exec2
;
if
(
intel_driver_get_param
(
intel
,
I915_PARAM_HAS_BSD
,
&
has_bsd
))
intel
->
has_bsd
=
has_bsd
;
if
(
intel_driver_get_param
(
intel
,
I915_PARAM_HAS_BLT
,
&
has_blt
))
intel
->
has_blt
=
has_blt
;
intel_memman_init
(
intel
);
intel_memman_init
(
intel
);
intel_batchbuffer_init
(
intel
);
intel_batchbuffer_init
(
intel
);
...
...
i965_drv_video/intel_driver.h
View file @
daa6c567
...
@@ -92,6 +92,10 @@ struct intel_driver_data
...
@@ -92,6 +92,10 @@ struct intel_driver_data
struct
intel_batchbuffer
*
batch
;
struct
intel_batchbuffer
*
batch
;
struct
intel_batchbuffer
*
batch_bcs
;
struct
intel_batchbuffer
*
batch_bcs
;
dri_bufmgr
*
bufmgr
;
dri_bufmgr
*
bufmgr
;
unsigned
int
has_exec2
:
1
;
/* Flag: has execbuffer2? */
unsigned
int
has_bsd
:
1
;
/* Flag: has bitstream decoder for H.264? */
unsigned
int
has_blt
:
1
;
/* Flag: has BLT unit? */
};
};
Bool
intel_driver_init
(
VADriverContextP
ctx
);
Bool
intel_driver_init
(
VADriverContextP
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