v4l2_test:modify open drm function

Modify the interface that opens the DRM

Signed-off-by: arvin.zhu <arvin.zhu@starfivetech.com>
This commit is contained in:
arvin.zhu
2022-07-29 19:02:21 +08:00
parent 933ef5f158
commit 4feacade91
+6 -2
View File
@@ -7,14 +7,18 @@
#include "stf_drm.h"
#include "stf_log.h"
#define DRM_MODULE_NAME "starfive"
#define DRM_BUSID NULL
static int drm_open(const char *path, int need_dumb, int need_prime)
{
int fd, flags;
uint64_t has_it;
LOG(STF_LEVEL_TRACE, "Enter\n");
if ((fd = open(path, O_RDWR)) < 0) {
LOG(STF_LEVEL_ERR, "cannot open \"%s\"\n", path);
fd = drmOpen(DRM_MODULE_NAME, DRM_BUSID);
if (fd < 0) {
LOG(STF_LEVEL_ERR, "cannot open drm module starfive. \n");
error("open");
}