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
b88e0895
Commit
b88e0895
authored
Jul 08, 2009
by
Gwenole Beauchesne
Committed by
Austin Yuan
Jul 08, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix driver name retrieval for dri1 and dri2.
Signed-off-by:
Austin Yuan
<
shengquan.yuan@intel.com
>
parent
c00a20b3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
95 deletions
+6
-95
src/va.c
src/va.c
+1
-14
src/va_backend.h
src/va_backend.h
+1
-1
src/x11/va_x11.c
src/x11/va_x11.c
+4
-80
No files found.
src/va.c
View file @
b88e0895
...
...
@@ -116,21 +116,8 @@ static Bool va_checkString(const char* value, char *variable)
static
VAStatus
va_getDriverName
(
VADisplay
dpy
,
char
**
driver_name
)
{
VADisplayContextP
pDisplayContext
=
(
VADisplayContextP
)
dpy
;
VADriverContextP
ctx
=
CTX
(
dpy
);
VAStatus
ret
;
ret
=
pDisplayContext
->
vaGetDriverName
(
pDisplayContext
,
driver_name
);
if
(
ret
==
VA_STATUS_SUCCESS
)
{
if
(
isDRI2Connected
(
ctx
,
driver_name
))
{
ret
=
VA_STATUS_SUCCESS
;
}
else
if
(
isDRI1Connected
(
ctx
,
driver_name
))
{
ret
=
VA_STATUS_SUCCESS
;
}
}
return
ret
;
return
pDisplayContext
->
vaGetDriverName
(
pDisplayContext
,
driver_name
);
}
static
VAStatus
va_openDriver
(
VADisplay
dpy
,
char
*
driver_name
)
...
...
src/va_backend.h
View file @
b88e0895
...
...
@@ -414,7 +414,7 @@ struct VADriverContext
Display
*
x11_dpy
;
int
x11_screen
;
int
dri2
;
int
old_dri2
;
/* obsolete */
int
version_major
;
int
version_minor
;
int
max_profiles
;
...
...
src/x11/va_x11.c
View file @
b88e0895
...
...
@@ -104,34 +104,10 @@ static VAStatus va_DRI2GetDriverName (
)
{
VADriverContextP
ctx
=
pDisplayContext
->
pDriverContext
;
VAStatus
vaStatus
=
VA_STATUS_ERROR_UNKNOWN
;
int
eventBase
,
errorBase
;
char
*
device_name
;
int
driver_major
;
int
driver_minor
;
int
driver_patch
;
Bool
result
=
True
;
if
(
!
VA_DRI2QueryExtension
(
ctx
->
x11_dpy
,
&
eventBase
,
&
errorBase
))
{
va_infoMessage
(
"DRI2 extension isn't present
\n
"
);
if
(
!
isDRI2Connected
(
ctx
,
driver_name
))
return
VA_STATUS_ERROR_UNKNOWN
;
}
if
(
!
VA_DRI2QueryVersion
(
ctx
->
x11_dpy
,
&
driver_major
,
&
driver_minor
))
{
va_errorMessage
(
"VA_DRI2QueryVersion failed
\n
"
);
return
VA_STATUS_ERROR_UNKNOWN
;
}
if
(
!
VA_DRI2Connect
(
ctx
->
x11_dpy
,
RootWindow
(
ctx
->
x11_dpy
,
ctx
->
x11_screen
),
driver_name
,
&
device_name
))
{
va_infoMessage
(
"DRI2 isn't enabled, fallback to DRI1
\n
"
);
return
VA_STATUS_ERROR_UNKNOWN
;
}
va_infoMessage
(
"VA_DRI2Connect: %d.%d.%d %s (screen %d)
\n
"
,
driver_major
,
driver_minor
,
driver_patch
,
*
driver_name
,
ctx
->
x11_screen
);
ctx
->
dri2
=
1
;
return
VA_STATUS_SUCCESS
;
}
...
...
@@ -141,57 +117,11 @@ static VAStatus va_DRIGetDriverName (
)
{
VADriverContextP
ctx
=
pDisplayContext
->
pDriverContext
;
VAStatus
vaStatus
=
VA_STATUS_ERROR_UNKNOWN
;
int
eventBase
,
errorBase
;
int
direct_capable
;
int
driver_major
;
int
driver_minor
;
int
driver_patch
;
Bool
result
=
True
;
char
*
x_driver_name
=
NULL
;
if
(
!
VA_DRIQueryExtension
(
ctx
->
x11_dpy
,
&
eventBase
,
&
errorBase
))
{
va_errorMessage
(
"VA_DRIQueryExtension failed
\n
"
);
if
(
!
isDRI1Connected
(
ctx
,
driver_name
))
return
VA_STATUS_ERROR_UNKNOWN
;
}
if
(
result
)
{
result
=
VA_DRIQueryDirectRenderingCapable
(
ctx
->
x11_dpy
,
ctx
->
x11_screen
,
&
direct_capable
);
if
(
!
result
)
{
va_errorMessage
(
"VA_DRIQueryDirectRenderingCapable failed
\n
"
);
}
}
if
(
result
)
{
result
=
direct_capable
;
if
(
!
result
)
{
va_errorMessage
(
"VA_DRIQueryDirectRenderingCapable returned false
\n
"
);
}
}
if
(
result
)
{
result
=
VA_DRIGetClientDriverName
(
ctx
->
x11_dpy
,
ctx
->
x11_screen
,
&
driver_major
,
&
driver_minor
,
&
driver_patch
,
&
x_driver_name
);
if
(
!
result
)
{
va_errorMessage
(
"VA_DRIGetClientDriverName returned false
\n
"
);
}
}
if
(
result
)
{
vaStatus
=
VA_STATUS_SUCCESS
;
va_infoMessage
(
"VA_DRIGetClientDriverName: %d.%d.%d %s (screen %d)
\n
"
,
driver_major
,
driver_minor
,
driver_patch
,
x_driver_name
,
ctx
->
x11_screen
);
if
(
driver_name
)
*
driver_name
=
strdup
(
x_driver_name
);
}
if
(
x_driver_name
)
XFree
(
x_driver_name
);
return
vaStatus
;
return
VA_STATUS_SUCCESS
;
}
static
VAStatus
va_DisplayContextGetDriverName
(
...
...
@@ -199,13 +129,7 @@ static VAStatus va_DisplayContextGetDriverName (
char
**
driver_name
)
{
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
;
VAStatus
vaStatus
;
char
*
driver_name_env
;
if
(
driver_name
)
...
...
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