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
94b49e9a
Commit
94b49e9a
authored
Apr 29, 2010
by
Austin Yuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
android and dummy backend
Signed-off-by:
Austin Yuan
<
shengquan.yuan@gmail.com
>
parent
1f4d9627
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
23 deletions
+36
-23
va/android/Makefile.am
va/android/Makefile.am
+2
-0
va/android/drmtest.c
va/android/drmtest.c
+14
-11
va/android/drmtest.h
va/android/drmtest.h
+3
-3
va/android/va_android.c
va/android/va_android.c
+17
-9
No files found.
va/android/Makefile.am
View file @
94b49e9a
...
...
@@ -22,6 +22,8 @@ AM_CFLAGS = -DLINUX -I$(top_srcdir)/va -I$(top_srcdir)/va/x11 $(DRM_CFLAGS)
noinst_LTLIBRARIES
=
libva_dummy.la
libva_dummy_la_LIBADD
=
$(LIBVA_LIBS)
-ldl
-ludev
libva_dummyincludedir
=
${includedir}
/va
libva_dummy_la_SOURCES
=
va_android.c drmtest.c
...
...
va/android/drmtest.c
View file @
94b49e9a
...
...
@@ -55,22 +55,24 @@ static int is_master(int fd)
}
/** Open the first DRM device matching the criteria */
int
drm_open_matching
(
const
char
*
pci_glob
,
int
flags
,
int
*
device_id
)
int
drm_open_matching
(
const
char
*
pci_glob
,
int
flags
,
int
*
vendor_id
,
int
*
device_id
)
{
struct
udev
*
udev
;
struct
udev_enumerate
*
e
;
struct
udev_device
*
device
,
*
parent
;
struct
udev_list_entry
*
entry
;
const
char
*
pci_id
,
*
path
;
char
*
tmp
;
int
fd
;
*
device_id
=
~
0
;
*
vendor_id
=
0
;
*
device_id
=
0
;
udev
=
udev_new
();
if
(
udev
==
NULL
)
{
fprintf
(
stderr
,
"failed to initialize udev context
\n
"
);
//abort();
return
-
1
;
//abort();
}
fd
=
-
1
;
...
...
@@ -100,16 +102,16 @@ int drm_open_matching(const char *pci_glob, int flags, int *device_id)
}
udev_enumerate_unref
(
e
);
udev_unref
(
udev
);
*
device_id
=
pci_id
;
*
vendor_id
=
(
int
)
strtol
(
pci_id
,
&
tmp
,
16
);
*
device_id
=
(
int
)
strtol
((
tmp
+
1
),
NULL
,
16
);
return
fd
;
}
int
drm_open_any
(
vo
id
)
int
drm_open_any
(
int
*
vendor_id
,
int
*
device_
id
)
{
int
dev_id
;
int
fd
=
drm_open_matching
(
"*:*"
,
0
,
&
dev_id
);
int
fd
=
drm_open_matching
(
"*:*"
,
0
,
vendor_id
,
device_id
);
if
(
fd
<
0
)
{
fprintf
(
stderr
,
"failed to open any drm device
\n
"
);
...
...
@@ -122,13 +124,14 @@ int drm_open_any(void)
/**
* Open the first DRM device we can find where we end up being the master.
*/
int
drm_open_any_master
(
int
*
device_
id
)
int
drm_open_any_master
(
vo
id
)
{
int
fd
=
drm_open_matching
(
"*:*"
,
DRM_TEST_MASTER
,
device_id
);
int
vendor_id
,
device_id
;
int
fd
=
drm_open_matching
(
"*:*"
,
DRM_TEST_MASTER
,
&
vendor_id
,
&
device_id
);
if
(
fd
<
0
)
{
fprintf
(
stderr
,
"failed to open any drm device
\n
"
);
//
abort();
abort
();
}
return
fd
;
...
...
va/android/drmtest.h
View file @
94b49e9a
...
...
@@ -35,6 +35,6 @@
#define DRM_TEST_MASTER 0x01
int
drm_open_any
(
vo
id
);
int
drm_open_any_master
(
int
*
device_
id
);
int
drm_open_matching
(
const
char
*
pci_glob
,
int
flags
,
int
*
device_id
);
int
drm_open_any
(
int
*
vendor_id
,
int
*
device_
id
);
int
drm_open_any_master
(
vo
id
);
int
drm_open_matching
(
const
char
*
pci_glob
,
int
flags
,
int
*
vendor_id
,
int
*
device_id
);
va/android/va_android.c
View file @
94b49e9a
...
...
@@ -90,20 +90,20 @@ static VAStatus va_DisplayContextGetDriverName (
VADriverContextP
ctx
=
pDisplayContext
->
pDriverContext
;
struct
dri_state
*
dri_state
=
(
struct
dri_state
*
)
ctx
->
dri_state
;
char
*
driver_name_env
;
int
dev
_id
;
int
vendor_id
,
device
_id
;
struct
{
int
ve
r
ndor_id
;
int
vendor_id
;
int
device_id
;
char
driver_name
[
64
];
}
devices
[]
=
{
{
0x8086
,
0x4100
,
"pvr"
},
{
0x8086
,
0x0
31
0
,
"pvr"
},
{
0x8086
,
0x0
13
0
,
"pvr"
},
{
0x0
,
0x0
,
"
\0
"
},
};
memset
(
dri_state
,
0
,
sizeof
(
*
dri_state
));
dri_state
->
fd
=
drm_open_any
_master
(
&
dev
_id
);
dri_state
->
fd
=
drm_open_any
(
&
vendor_id
,
&
device
_id
);
if
(
dri_state
->
fd
<
0
)
{
fprintf
(
stderr
,
"can't open DRM devices
\n
"
);
...
...
@@ -116,20 +116,28 @@ static VAStatus va_DisplayContextGetDriverName (
*
driver_name
=
strdup
(
driver_name_env
);
return
VA_STATUS_SUCCESS
;
}
else
{
/* TBD: other vendor driver names */
int
i
=
0
;
int
i
=
0
;
while
((
devices
[
i
].
device_id
!=
0
)
&&
(
devices
[
i
].
device_id
!=
dev_id
))
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
[
0
].
driver_name
);
*
driver_name
=
strdup
(
devices
[
i
].
driver_name
);
else
{
fprintf
(
stderr
,
"device (0x%04x) is not supported
\n
"
,
dev_id
);
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
;
return
VA_STATUS_SUCCESS
;
...
...
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