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
e498c6a1
Commit
e498c6a1
authored
May 06, 2010
by
Ren Zhaohan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
restore old va_DisplayContextGetDriverName
parent
a9ea9bcf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
25 deletions
+36
-25
va/android/va_android.c
va/android/va_android.c
+35
-18
va/va_android.h
va/va_android.h
+1
-3
va/va_backend.h
va/va_backend.h
+0
-4
No files found.
va/android/va_android.c
View file @
e498c6a1
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
#endif
#endif
#define CHECK_SYMBOL(func) { if (!func) printf("func %s not found\n", #func); return VA_STATUS_ERROR_UNKNOWN; }
#define CHECK_SYMBOL(func) { if (!func) printf("func %s not found\n", #func); return VA_STATUS_ERROR_UNKNOWN; }
#define DEVICE_NAME "/dev/
dri/
card0"
#define DEVICE_NAME "/dev/card0"
static
VADisplayContextP
pDisplayContexts
=
NULL
;
static
VADisplayContextP
pDisplayContexts
=
NULL
;
...
@@ -65,7 +65,7 @@ static int open_device (char *dev_name)
...
@@ -65,7 +65,7 @@ static int open_device (char *dev_name)
return
-
1
;
return
-
1
;
}
}
fd
=
open
(
dev_name
,
O_RDWR
/* required */
|
O_NONBLOCK
,
0
);
fd
=
open
(
dev_name
,
O_RDWR
);
if
(
-
1
==
fd
)
if
(
-
1
==
fd
)
{
{
...
@@ -167,39 +167,56 @@ static VAStatus va_DisplayContextGetDriverName (
...
@@ -167,39 +167,56 @@ static VAStatus va_DisplayContextGetDriverName (
VADriverContextP
ctx
=
pDisplayContext
->
pDriverContext
;
VADriverContextP
ctx
=
pDisplayContext
->
pDriverContext
;
struct
dri_state
*
dri_state
=
(
struct
dri_state
*
)
ctx
->
dri_state
;
struct
dri_state
*
dri_state
=
(
struct
dri_state
*
)
ctx
->
dri_state
;
char
*
driver_name_env
;
char
*
driver_name_env
;
int
vendor_id
,
device_id
;
struct
{
struct
{
unsigned
int
vendor_id
;
int
vendor_id
;
unsigned
int
device_id
;
int
device_id
;
char
driver_name
[
64
];
char
driver_name
[
64
];
}
devices
[]
=
{
}
devices
[]
=
{
{
0x8086
,
0x4100
,
"pvr"
},
{
0x8086
,
0x4100
,
"pvr"
},
{
0x8086
,
0x0130
,
"pvr"
},
{
0x0
,
0x0
,
"
\0
"
},
};
};
memset
(
dri_state
,
0
,
sizeof
(
*
dri_state
));
memset
(
dri_state
,
0
,
sizeof
(
*
dri_state
));
dri_state
->
fd
=
drm_open_any_master
();
dri_state
->
fd
=
drm_open_any
(
&
vendor_id
,
&
device_id
);
if
(
dri_state
->
fd
<
0
)
{
fprintf
(
stderr
,
"open DRM device by udev failed, try /dev/dri/card0
\n
"
);
dri_state
->
fd
=
open
(
"/dev/dri/card0"
,
O_RDWR
);
}
if
(
dri_state
->
fd
<
0
)
{
if
(
dri_state
->
fd
<
0
)
{
fprintf
(
stderr
,
"can't open DRM devices
\n
"
);
fprintf
(
stderr
,
"can't open DRM devices
\n
"
);
return
VA_STATUS_ERROR_UNKNOWN
;
return
VA_STATUS_ERROR_UNKNOWN
;
}
}
if
((
driver_name_env
=
getenv
(
"LIBVA_DRIVER_NAME"
))
!=
NULL
if
((
driver_name_env
=
getenv
(
"LIBVA_DRIVER_NAME"
))
!=
NULL
&&
geteuid
()
==
getuid
())
&&
geteuid
()
==
getuid
())
{
{
/* don't allow setuid apps to use LIBVA_DRIVER_NAME */
/* don't allow setuid apps to use LIBVA_DRIVER_NAME */
*
driver_name
=
strdup
(
driver_name_env
);
*
driver_name
=
strdup
(
driver_name_env
);
return
VA_STATUS_SUCCESS
;
return
VA_STATUS_SUCCESS
;
}
else
/* TBD: other vendor driver names */
}
else
{
/* TBD: other vendor driver names */
*
driver_name
=
strdup
(
devices
[
0
].
driver_name
);
int
i
=
0
;
while
(
devices
[
i
].
device_id
!=
0
)
{
if
((
devices
[
i
].
vendor_id
==
vendor_id
)
&&
(
devices
[
i
].
device_id
==
device_id
))
break
;
i
++
;
}
if
(
devices
[
i
].
device_id
!=
0
)
*
driver_name
=
strdup
(
devices
[
i
].
driver_name
);
else
{
fprintf
(
stderr
,
"device (0x%04x:0x%04x) is not supported
\n
"
,
vendor_id
,
device_id
);
return
VA_STATUS_ERROR_UNKNOWN
;
}
}
printf
(
"DRM device is opened, loading driver %s for device 0x%04x:0x%04x
\n
"
,
driver_name
,
vendor_id
,
device_id
);
dri_state
->
driConnectedFlag
=
VA_DUMMY
;
dri_state
->
driConnectedFlag
=
VA_DUMMY
;
return
VA_STATUS_SUCCESS
;
return
VA_STATUS_SUCCESS
;
}
}
#endif
#endif
...
...
va/va_android.h
View file @
e498c6a1
...
@@ -3,8 +3,6 @@
...
@@ -3,8 +3,6 @@
#include <va/va.h>
#include <va/va.h>
#define Surface void
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
#endif
#endif
...
@@ -30,7 +28,7 @@ VADisplay vaGetDisplay (
...
@@ -30,7 +28,7 @@ VADisplay vaGetDisplay (
VAStatus
vaPutSurface
(
VAStatus
vaPutSurface
(
VADisplay
dpy
,
VADisplay
dpy
,
VASurfaceID
surface
,
VASurfaceID
surface
,
Surface
*
draw
,
/* Android Window/Surface */
void
*
draw
,
/* Android Window/Surface */
short
srcx
,
short
srcx
,
short
srcy
,
short
srcy
,
unsigned
short
srcw
,
unsigned
short
srcw
,
...
...
va/va_backend.h
View file @
e498c6a1
...
@@ -185,11 +185,7 @@ struct VADriverVTable
...
@@ -185,11 +185,7 @@ struct VADriverVTable
VAStatus
(
*
vaPutSurface
)
(
VAStatus
(
*
vaPutSurface
)
(
VADriverContextP
ctx
,
VADriverContextP
ctx
,
VASurfaceID
surface
,
VASurfaceID
surface
,
#ifdef ANDROID
Surface
*
draw
,
/* Drawable of window system */
Surface
*
draw
,
/* Drawable of window system */
#else
Drawable
draw
,
#endif
short
srcx
,
short
srcx
,
short
srcy
,
short
srcy
,
unsigned
short
srcw
,
unsigned
short
srcw
,
...
...
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