libweston: drop return type from ::query_dmabuf_{formats, modifiers}
Nobody checks for the bool returned by these functions. At the same time: a) the functions set the respective num_foo to zero on error and b) callers honour that variable. Just drop the return type - it's useless. Note: this is an ABI break. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
parent
340d25b76f
commit
fbf165f5e8
@ -755,10 +755,12 @@ struct weston_renderer {
|
|||||||
bool (*import_dmabuf)(struct weston_compositor *ec,
|
bool (*import_dmabuf)(struct weston_compositor *ec,
|
||||||
struct linux_dmabuf_buffer *buffer);
|
struct linux_dmabuf_buffer *buffer);
|
||||||
|
|
||||||
bool (*query_dmabuf_formats)(struct weston_compositor *ec,
|
/** On error sets num_formats to zero */
|
||||||
|
void (*query_dmabuf_formats)(struct weston_compositor *ec,
|
||||||
int **formats, int *num_formats);
|
int **formats, int *num_formats);
|
||||||
|
|
||||||
bool (*query_dmabuf_modifiers)(struct weston_compositor *ec,
|
/** On error sets num_modifiers to zero */
|
||||||
|
void (*query_dmabuf_modifiers)(struct weston_compositor *ec,
|
||||||
int format, uint64_t **modifiers,
|
int format, uint64_t **modifiers,
|
||||||
int *num_modifiers);
|
int *num_modifiers);
|
||||||
};
|
};
|
||||||
|
@ -2083,7 +2083,7 @@ import_dmabuf(struct gl_renderer *gr,
|
|||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static void
|
||||||
gl_renderer_query_dmabuf_formats(struct weston_compositor *wc,
|
gl_renderer_query_dmabuf_formats(struct weston_compositor *wc,
|
||||||
int **formats, int *num_formats)
|
int **formats, int *num_formats)
|
||||||
{
|
{
|
||||||
@ -2095,25 +2095,24 @@ gl_renderer_query_dmabuf_formats(struct weston_compositor *wc,
|
|||||||
if (!gr->has_dmabuf_import_modifiers ||
|
if (!gr->has_dmabuf_import_modifiers ||
|
||||||
!gr->query_dmabuf_formats(gr->egl_display, 0, NULL, &num)) {
|
!gr->query_dmabuf_formats(gr->egl_display, 0, NULL, &num)) {
|
||||||
*num_formats = 0;
|
*num_formats = 0;
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
*formats = calloc(num, sizeof(int));
|
*formats = calloc(num, sizeof(int));
|
||||||
if (*formats == NULL) {
|
if (*formats == NULL) {
|
||||||
*num_formats = 0;
|
*num_formats = 0;
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
if (!gr->query_dmabuf_formats(gr->egl_display, num, *formats, &num)) {
|
if (!gr->query_dmabuf_formats(gr->egl_display, num, *formats, &num)) {
|
||||||
*num_formats = 0;
|
*num_formats = 0;
|
||||||
free(*formats);
|
free(*formats);
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
*num_formats = num;
|
*num_formats = num;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static void
|
||||||
gl_renderer_query_dmabuf_modifiers(struct weston_compositor *wc, int format,
|
gl_renderer_query_dmabuf_modifiers(struct weston_compositor *wc, int format,
|
||||||
uint64_t **modifiers,
|
uint64_t **modifiers,
|
||||||
int *num_modifiers)
|
int *num_modifiers)
|
||||||
@ -2127,23 +2126,22 @@ gl_renderer_query_dmabuf_modifiers(struct weston_compositor *wc, int format,
|
|||||||
!gr->query_dmabuf_modifiers(gr->egl_display, format, 0, NULL,
|
!gr->query_dmabuf_modifiers(gr->egl_display, format, 0, NULL,
|
||||||
NULL, &num)) {
|
NULL, &num)) {
|
||||||
*num_modifiers = 0;
|
*num_modifiers = 0;
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
*modifiers = calloc(num, sizeof(uint64_t));
|
*modifiers = calloc(num, sizeof(uint64_t));
|
||||||
if (*modifiers == NULL) {
|
if (*modifiers == NULL) {
|
||||||
*num_modifiers = 0;
|
*num_modifiers = 0;
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
if (!gr->query_dmabuf_modifiers(gr->egl_display, format,
|
if (!gr->query_dmabuf_modifiers(gr->egl_display, format,
|
||||||
num, *modifiers, NULL, &num)) {
|
num, *modifiers, NULL, &num)) {
|
||||||
*num_modifiers = 0;
|
*num_modifiers = 0;
|
||||||
free(*modifiers);
|
free(*modifiers);
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
*num_modifiers = num;
|
*num_modifiers = num;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
Loading…
Reference in New Issue
Block a user