@samitouri / QOSamiQemu / commits / ff3da02eaf

ati-vga: Remove ATIVGAState param from ati_2d_do_blt

This completes the decoupling from the ATIVGAState struct. Signed-off-by: Chad Jablonski <chad@jablonski.xyz> Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu> [balaton: Fix build without pixman] Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Message-ID: <6e3545dea9f4522e07e91f9db885a7d74dae781a.1773020351.git.balaton@eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Chad Jablonski committed Mar 9, 2026 at 02:47 UTC ff3da02eaffa31e8e708d101331a6c4dcec0f171
1 file changed +5 -5
hw/display/ati_2d.c
+5 -5
@@ -123,7 +123,7 @@ static void setup_2d_blt_ctx(const ATIVGAState *s, ATI2DCtx *ctx)
123 (ctx->top_to_bottom ? 'v' : '^'));
124 }
125
126 -static bool ati_2d_do_blt(ATIVGAState *s, ATI2DCtx *ctx)
126 +static bool ati_2d_do_blt(ATI2DCtx *ctx, uint8_t use_pixman)
127 {
128 if (!ctx->bpp) {
129 qemu_log_mask(LOG_GUEST_ERROR, "Invalid bpp\n");
@@ -164,14 +164,14 @@ static bool ati_2d_do_blt(ATIVGAState *s, ATI2DCtx *ctx)
164 #ifdef CONFIG_PIXMAN
165 int src_stride_words = ctx->src_stride / sizeof(uint32_t);
166 int dst_stride_words = ctx->dst_stride / sizeof(uint32_t);
167 - if ((s->use_pixman & BIT(1)) &&
167 + if ((use_pixman & BIT(1)) &&
168 ctx->left_to_right && ctx->top_to_bottom) {
169 fallback = !pixman_blt((uint32_t *)ctx->src_bits,
170 (uint32_t *)ctx->dst_bits, src_stride_words,
171 dst_stride_words, ctx->bpp, ctx->bpp,
172 ctx->src.x, ctx->src.y, ctx->dst.x,
173 ctx->dst.y, ctx->dst.width, ctx->dst.height);
174 - } else if (s->use_pixman & BIT(1)) {
174 + } else if (use_pixman & BIT(1)) {
175 /* FIXME: We only really need a temporary if src and dst overlap */
176 int llb = ctx->dst.width * (ctx->bpp / 8);
177 int tmp_stride_words = DIV_ROUND_UP(llb, sizeof(uint32_t));
@@ -241,7 +241,7 @@ static bool ati_2d_do_blt(ATIVGAState *s, ATI2DCtx *ctx)
241 ctx->dst.x, ctx->dst.y, ctx->dst.width, ctx->dst.height,
242 filler);
243 #ifdef CONFIG_PIXMAN
244 - if (!(s->use_pixman & BIT(0)) ||
244 + if (!(use_pixman & BIT(0)) ||
245 !pixman_fill((uint32_t *)ctx->dst_bits,
246 ctx->dst_stride / sizeof(uint32_t), ctx->bpp,
247 ctx->dst.x, ctx->dst.y,
@@ -272,7 +272,7 @@ void ati_2d_blt(ATIVGAState *s)
272 {
273 ATI2DCtx ctx;
274 setup_2d_blt_ctx(s, &ctx);
275 - if (ati_2d_do_blt(s, &ctx)) {
275 + if (ati_2d_do_blt(&ctx, s->use_pixman)) {
276 ati_set_dirty(&s->vga, &ctx);
277 }
278 }