tree: Change sunxi_cedrus_log for request_log

As part of the ongoing switch to a generic name, let's start with log
function.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
This commit is contained in:
Maxime Ripard
2018-07-17 15:54:55 +02:00
parent 2d1bce38c2
commit d43854dfd9
5 changed files with 27 additions and 31 deletions
+9 -9
View File
@@ -40,8 +40,8 @@ int media_request_alloc(int media_fd)
rc = ioctl(media_fd, MEDIA_IOC_REQUEST_ALLOC, &request_alloc);
if (rc < 0) {
sunxi_cedrus_log("Unable to allocate media request: %s\n",
strerror(errno));
request_log("Unable to allocate media request: %s\n",
strerror(errno));
return -1;
}
@@ -54,8 +54,8 @@ int media_request_reinit(int request_fd)
rc = ioctl(request_fd, MEDIA_REQUEST_IOC_REINIT, NULL);
if (rc < 0) {
sunxi_cedrus_log("Unable to reinit media request: %s\n",
strerror(errno));
request_log("Unable to reinit media request: %s\n",
strerror(errno));
return -1;
}
@@ -68,8 +68,8 @@ int media_request_queue(int request_fd)
rc = ioctl(request_fd, MEDIA_REQUEST_IOC_QUEUE, NULL);
if (rc < 0) {
sunxi_cedrus_log("Unable to queue media request: %s\n",
strerror(errno));
request_log("Unable to queue media request: %s\n",
strerror(errno));
return -1;
}
@@ -87,11 +87,11 @@ int media_request_wait_completion(int request_fd)
rc = select(request_fd + 1, NULL, NULL, &except_fds, &tv);
if (rc == 0) {
sunxi_cedrus_log("Timeout when waiting for media request\n");
request_log("Timeout when waiting for media request\n");
return -1;
} else if (rc < 0) {
sunxi_cedrus_log("Unable to select media request: %s\n",
strerror(errno));
request_log("Unable to select media request: %s\n",
strerror(errno));
return -1;
}
+2 -2
View File
@@ -149,8 +149,8 @@ VAStatus VA_DRIVER_INIT_FUNC(VADriverContextP context)
rc = ioctl(video_fd, VIDIOC_QUERYCAP, &capability);
if (rc < 0 || !(capability.capabilities & V4L2_CAP_VIDEO_M2M_MPLANE)) {
sunxi_cedrus_log("Video device %s does not support m2m mplanes\n",
video_path);
request_log("Video device %s does not support m2m mplanes\n",
video_path);
status = VA_STATUS_ERROR_OPERATION_FAILED;
goto error;
}
+1 -1
View File
@@ -30,7 +30,7 @@
#include "sunxi_cedrus.h"
#include "utils.h"
void sunxi_cedrus_log(const char *format, ...)
void request_log(const char *format, ...)
{
va_list arguments;
+1 -1
View File
@@ -26,6 +26,6 @@
#ifndef _UTILS_H_
#define _UTILS_H_
void sunxi_cedrus_log(const char *format, ...);
void request_log(const char *format, ...);
#endif
+14 -18
View File
@@ -71,8 +71,8 @@ int v4l2_set_format(int video_fd, unsigned int type, unsigned int pixelformat,
rc = ioctl(video_fd, VIDIOC_S_FMT, &format);
if (rc < 0) {
sunxi_cedrus_log("Unable to set format for type %d: %s\n", type,
strerror(errno));
request_log("Unable to set format for type %d: %s\n", type,
strerror(errno));
return -1;
}
@@ -93,8 +93,8 @@ int v4l2_get_format(int video_fd, unsigned int type, unsigned int *width,
rc = ioctl(video_fd, VIDIOC_G_FMT, &format);
if (rc < 0) {
sunxi_cedrus_log("Unable to get format for type %d: %s\n", type,
strerror(errno));
request_log("Unable to get format for type %d: %s\n", type,
strerror(errno));
return -1;
}
@@ -138,15 +138,15 @@ int v4l2_create_buffers(int video_fd, unsigned int type,
rc = ioctl(video_fd, VIDIOC_G_FMT, &buffers.format);
if (rc < 0) {
sunxi_cedrus_log("Unable to get format for type %d: %s\n", type,
strerror(errno));
request_log("Unable to get format for type %d: %s\n", type,
strerror(errno));
return -1;
}
rc = ioctl(video_fd, VIDIOC_CREATE_BUFS, &buffers);
if (rc < 0) {
sunxi_cedrus_log("Unable to create buffer for type %d: %s\n",
type, strerror(errno));
request_log("Unable to create buffer for type %d: %s\n", type,
strerror(errno));
return -1;
}
@@ -173,8 +173,7 @@ int v4l2_request_buffer(int video_fd, unsigned int type, unsigned int index,
rc = ioctl(video_fd, VIDIOC_QUERYBUF, &buffer);
if (rc < 0) {
sunxi_cedrus_log("Unable to query buffer: %s\n",
strerror(errno));
request_log("Unable to query buffer: %s\n", strerror(errno));
return -1;
}
@@ -217,8 +216,7 @@ int v4l2_queue_buffer(int video_fd, int request_fd, unsigned int type,
rc = ioctl(video_fd, VIDIOC_QBUF, &buffer);
if (rc < 0) {
sunxi_cedrus_log("Unable to queue buffer: %s\n",
strerror(errno));
request_log("Unable to queue buffer: %s\n", strerror(errno));
return -1;
}
@@ -248,8 +246,7 @@ int v4l2_dequeue_buffer(int video_fd, int request_fd, unsigned int type,
rc = ioctl(video_fd, VIDIOC_DQBUF, &buffer);
if (rc < 0) {
sunxi_cedrus_log("Unable to dequeue buffer: %s\n",
strerror(errno));
request_log("Unable to dequeue buffer: %s\n", strerror(errno));
return -1;
}
@@ -280,8 +277,7 @@ int v4l2_set_control(int video_fd, int request_fd, unsigned int id, void *data,
rc = ioctl(video_fd, VIDIOC_S_EXT_CTRLS, &controls);
if (rc < 0) {
sunxi_cedrus_log("Unable to set control: %s\n",
strerror(errno));
request_log("Unable to set control: %s\n", strerror(errno));
return -1;
}
@@ -296,8 +292,8 @@ int v4l2_set_stream(int video_fd, unsigned int type, bool enable)
rc = ioctl(video_fd, enable ? VIDIOC_STREAMON : VIDIOC_STREAMOFF,
&buf_type);
if (rc < 0) {
sunxi_cedrus_log("Unable to %sable stream: %s\n",
enable ? "en" : "dis", strerror(errno));
request_log("Unable to %sable stream: %s\n",
enable ? "en" : "dis", strerror(errno));
return -1;
}