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
9cab1a3f
Commit
9cab1a3f
authored
Apr 22, 2009
by
Austin Yuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial support for DRI2
Signed-off-by:
Austin Yuan
<
shengquan.yuan@intel.com
>
parent
696e11da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
13 deletions
+83
-13
src/X11/va_x11.c
src/X11/va_x11.c
+82
-12
src/va_backend.h
src/va_backend.h
+1
-1
No files found.
src/X11/va_x11.c
View file @
9cab1a3f
...
@@ -89,13 +89,51 @@ static void va_DisplayContextDestroy (
...
@@ -89,13 +89,51 @@ static void va_DisplayContextDestroy (
free
(
pDisplayContext
);
free
(
pDisplayContext
);
}
}
static
VAStatus
va_DisplayContextGetDriverName
(
static
VAStatus
va_DRI2GetDriverName
(
VADisplayContextP
pDisplayContext
,
char
**
driver_name
)
{
VADriverContextP
ctx
=
pDisplayContext
->
pDriverContext
;
VAStatus
vaStatus
=
VA_STATUS_ERROR_UNKNOWN
;
char
*
driverName
,
*
deviceName
;
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
"
);
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
;
}
static
VAStatus
va_DRIGetDriverName
(
VADisplayContextP
pDisplayContext
,
VADisplayContextP
pDisplayContext
,
char
**
driver_name
char
**
driver_name
)
)
{
{
VADriverContextP
ctx
=
pDisplayContext
->
pDriverContext
;
VADriverContextP
ctx
=
pDisplayContext
->
pDriverContext
;
VAStatus
vaStatus
=
VA_STATUS_ERROR_UNKNOWN
;
VAStatus
vaStatus
=
VA_STATUS_ERROR_UNKNOWN
;
int
eventBase
,
errorBase
;
int
direct_capable
;
int
direct_capable
;
int
driver_major
;
int
driver_major
;
int
driver_minor
;
int
driver_minor
;
...
@@ -103,18 +141,11 @@ static VAStatus va_DisplayContextGetDriverName (
...
@@ -103,18 +141,11 @@ static VAStatus va_DisplayContextGetDriverName (
Bool
result
=
True
;
Bool
result
=
True
;
char
*
x_driver_name
=
NULL
;
char
*
x_driver_name
=
NULL
;
if
(
driver_name
)
if
(
!
VA_DRIQueryExtension
(
ctx
->
x11_dpy
,
&
eventBase
,
&
errorBase
))
{
*
driver_name
=
NULL
;
va_errorMessage
(
"VA_DRIQueryExtension failed
\n
"
);
if
(
geteuid
()
==
getuid
())
return
VA_STATUS_ERROR_UNKNOWN
;
{
/* don't allow setuid apps to use LIBVA_DRIVER_NAME */
if
(
getenv
(
"LIBVA_DRIVER_NAME"
))
{
/* For easier debugging */
*
driver_name
=
strdup
(
getenv
(
"LIBVA_DRIVER_NAME"
));
return
VA_STATUS_SUCCESS
;
}
}
}
if
(
result
)
if
(
result
)
{
{
result
=
VA_DRIQueryDirectRenderingCapable
(
ctx
->
x11_dpy
,
ctx
->
x11_screen
,
&
direct_capable
);
result
=
VA_DRIQueryDirectRenderingCapable
(
ctx
->
x11_dpy
,
ctx
->
x11_screen
,
&
direct_capable
);
...
@@ -154,6 +185,45 @@ static VAStatus va_DisplayContextGetDriverName (
...
@@ -154,6 +185,45 @@ static VAStatus va_DisplayContextGetDriverName (
return
vaStatus
;
return
vaStatus
;
}
}
static
VAStatus
va_DisplayContextGetDriverName
(
VADisplayContextP
pDisplayContext
,
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
;
char
*
x_driver_name
=
NULL
;
if
(
driver_name
)
*
driver_name
=
NULL
;
vaStatus
=
va_DRI2GetDriverName
(
pDisplayContext
,
driver_name
);
if
(
vaStatus
!=
VA_STATUS_SUCCESS
)
vaStatus
=
va_DRIGetDriverName
(
pDisplayContext
,
driver_name
);
if
((
vaStatus
==
VA_STATUS_SUCCESS
)
&&
geteuid
()
==
getuid
())
{
/* don't allow setuid apps to use LIBVA_DRIVER_NAME */
if
(
getenv
(
"LIBVA_DRIVER_NAME"
))
{
/* For easier debugging */
if
(
*
driver_name
)
Xfree
(
*
driver_name
);
*
driver_name
=
strdup
(
getenv
(
"LIBVA_DRIVER_NAME"
));
return
VA_STATUS_SUCCESS
;
}
}
return
vaStatus
;
}
int
vaDisplayIsValid
(
VADisplay
dpy
)
int
vaDisplayIsValid
(
VADisplay
dpy
)
{
{
VADisplayContextP
tmp
=
NULL
;
VADisplayContextP
tmp
=
NULL
;
...
...
src/va_backend.h
View file @
9cab1a3f
...
@@ -423,7 +423,7 @@ struct VADriverContext
...
@@ -423,7 +423,7 @@ struct VADriverContext
Display
*
x11_dpy
;
Display
*
x11_dpy
;
int
x11_screen
;
int
x11_screen
;
int
dri2
;
int
version_major
;
int
version_major
;
int
version_minor
;
int
version_minor
;
int
max_profiles
;
int
max_profiles
;
...
...
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