libweston: let weston_output_update_capture_info() take drm_format

Let weston_output_update_capture_info() take a uint32_t drm_format
parameter directly instead of const struct pixel_format_info *format.
No other fields apart from the format were used from this structure.

Without this, callers may have to unnecessarily look up the pixel
format info in cases where the DRM fourcc is already available.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
This commit is contained in:
Philipp Zabel 2023-01-18 13:48:15 +01:00 committed by Daniel Stone
parent eb9a740c20
commit af5acbc9cb
5 changed files with 12 additions and 13 deletions

View File

@ -321,7 +321,7 @@ headless_output_enable_pixman(struct headless_output *output)
WESTON_OUTPUT_CAPTURE_SOURCE_FRAMEBUFFER,
output->base.current_mode->width,
output->base.current_mode->height,
pfmt);
pfmt->format);
return 0;

View File

@ -240,7 +240,7 @@ capture_info_get_csi(struct weston_output_capture_info *ci,
* \param src The source type on the output.
* \param width The new buffer width.
* \param height The new buffer height.
* \param format The new pixel format.
* \param drm_format The new pixel format.
*
* If any one of width, height or format is zero/NULL, the source becomes
* unavailable to clients. Otherwise the source becomes available.
@ -250,8 +250,7 @@ capture_info_get_csi(struct weston_output_capture_info *ci,
WL_EXPORT void
weston_output_update_capture_info(struct weston_output *output,
enum weston_output_capture_source src,
int width, int height,
const struct pixel_format_info *format)
int width, int height, uint32_t drm_format)
{
struct weston_output_capture_info *ci = output->capture_info;
struct weston_output_capture_source_info *csi;
@ -260,12 +259,12 @@ weston_output_update_capture_info(struct weston_output *output,
if (csi->width == width &&
csi->height == height &&
csi->drm_format == format->format)
csi->drm_format == drm_format)
return;
csi->width = width;
csi->height = height;
csi->drm_format = format->format;
csi->drm_format = drm_format;
if (source_info_is_available(csi)) {
capture_info_send_source_info(ci, csi);

View File

@ -65,8 +65,7 @@ weston_output_capture_info_repaint_done(struct weston_output_capture_info *ci);
void
weston_output_update_capture_info(struct weston_output *output,
enum weston_output_capture_source src,
int width, int height,
const struct pixel_format_info *format);
int width, int height, uint32_t drm_format);
bool
weston_output_has_capture_tasks(struct weston_output *output);

View File

@ -943,7 +943,7 @@ pixman_renderer_resize_output(struct weston_output *output,
WESTON_OUTPUT_CAPTURE_SOURCE_FRAMEBUFFER,
po->fb_size.width,
po->fb_size.height,
po->hw_format);
po->hw_format->format);
}
if (!po->shadow_format)
@ -961,7 +961,7 @@ pixman_renderer_resize_output(struct weston_output *output,
WESTON_OUTPUT_CAPTURE_SOURCE_BLENDING,
po->fb_size.width,
po->fb_size.height,
po->shadow_format);
po->shadow_format->format);
return !!po->shadow_image;
}
@ -1074,7 +1074,7 @@ pixman_renderer_output_set_buffer(struct weston_output *output,
WESTON_OUTPUT_CAPTURE_SOURCE_FRAMEBUFFER,
po->fb_size.width,
po->fb_size.height,
po->hw_format);
po->hw_format->format);
}
static int

View File

@ -3416,6 +3416,7 @@ gl_renderer_resize_output(struct weston_output *output,
{
struct gl_output_state *go = get_output_state(output);
const struct pixel_format_info *shfmt = go->shadow_format;
uint32_t drm_format = output->compositor->read_format->format;
bool ret;
check_compositing_area(fb_size, area);
@ -3426,12 +3427,12 @@ gl_renderer_resize_output(struct weston_output *output,
weston_output_update_capture_info(output,
WESTON_OUTPUT_CAPTURE_SOURCE_FRAMEBUFFER,
area->width, area->height,
output->compositor->read_format);
drm_format);
weston_output_update_capture_info(output,
WESTON_OUTPUT_CAPTURE_SOURCE_FULL_FRAMEBUFFER,
fb_size->width, fb_size->height,
output->compositor->read_format);
drm_format);
if (!shfmt)
return true;