From: Peter Maydell <peter.maydell@linaro.org>
To: Vivek Kasireddy <vivek.kasireddy@intel.com>
Cc: qemu-devel@nongnu.org, "Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [PATCH] ui/spice: Destroy the temporary egl fb after the blit is submitted
Date: Fri, 18 Jul 2025 09:44:33 +0100 [thread overview]
Message-ID: <CAFEAcA-rTkSQe5zm2bLXA-DSoeo2pwC07NGPCGevwq7KXyE26Q@mail.gmail.com> (raw)
In-Reply-To: <20250718062607.2209900-1-vivek.kasireddy@intel.com>
On Fri, 18 Jul 2025 at 07:29, Vivek Kasireddy <vivek.kasireddy@intel.com> wrote:
>
> The temporary egl fb scanout_tex_fb is only needed to facilitate the
> blit to the display surface's texture (ssd->ds->texture). Therefore,
> destroy it after the blit is submitted. And, also make sure that it
> is empty initialized before it is actually used.
>
> Fixes: f851cd65 ("ui/spice: Blit the scanout texture if its memory layout is not linear")
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
> ---
> ui/spice-display.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/ui/spice-display.c b/ui/spice-display.c
> index 9ce622cefc..401d6c4aba 100644
> --- a/ui/spice-display.c
> +++ b/ui/spice-display.c
> @@ -1191,12 +1191,12 @@ static bool spice_gl_blit_scanout_texture(SimpleSpiceDisplay *ssd,
> uint64_t modifier;
> bool ret;
>
> - egl_fb_destroy(scanout_tex_fb);
> egl_fb_setup_for_tex(scanout_tex_fb,
> surface_width(ssd->ds), surface_height(ssd->ds),
> ssd->ds->texture, false);
> egl_fb_blit(scanout_tex_fb, &ssd->guest_fb, false);
> glFlush();
> + egl_fb_destroy(scanout_tex_fb);
>
> if (!ssd->new_scanout_texture) {
> return true;
> @@ -1330,7 +1330,7 @@ static void qemu_spice_gl_update(DisplayChangeListener *dcl,
> }
>
> if (spice_remote_client && ssd->blit_scanout_texture) {
> - egl_fb scanout_tex_fb;
> + egl_fb scanout_tex_fb = {};
>
> ret = spice_gl_blit_scanout_texture(ssd, &scanout_tex_fb);
> if (!ret) {
It looks like we only call spice_gl_blit_scanout_texture()
once -- would it make more sense to put the scanout_tx_fb
variable inside that function rather than making its only
callsite set it up? That way the function owns, sets up,
uses and destroys the egl_fb.
thanks
-- PMM
next prev parent reply other threads:[~2025-07-18 8:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-18 6:26 [PATCH] ui/spice: Destroy the temporary egl fb after the blit is submitted Vivek Kasireddy
2025-07-18 8:44 ` Peter Maydell [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-07-18 23:40 Vivek Kasireddy
2025-07-21 8:03 ` Marc-André Lureau
2025-08-12 23:41 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFEAcA-rTkSQe5zm2bLXA-DSoeo2pwC07NGPCGevwq7KXyE26Q@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=marcandre.lureau@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=vivek.kasireddy@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).