[PATCH 37/67] ui/console: rename vga_ functions → qemu_console_

marcandre.lureau@redhat.com posted 67 patches 2 years, 5 months ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Dr. David Alan Gilbert" <dave@treblig.org>, Peter Maydell <peter.maydell@linaro.org>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Yoshinori Sato <ysato@users.sourceforge.jp>, "Daniel P. Berrangé" <berrange@redhat.com>, Thomas Huth <thuth@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>, Akihiko Odaki <akihiko.odaki@daynix.com>
[PATCH 37/67] ui/console: rename vga_ functions → qemu_console_
Posted by marcandre.lureau@redhat.com 2 years, 5 months ago
From: Marc-André Lureau <marcandre.lureau@redhat.com>

They are not specific to VGA. Let's use the object type name as prefix
instead, to avoid confusion.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 ui/console.c | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/ui/console.c b/ui/console.c
index 88e37eaff3..a157a5b31c 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -331,9 +331,8 @@ void graphic_hw_text_update(QemuConsole *con, console_ch_t *chardata)
     }
 }
 
-static void vga_fill_rect(QemuConsole *con,
-                          int posx, int posy, int width, int height,
-                          pixman_color_t color)
+static void qemu_console_fill_rect(QemuConsole *con, int posx, int posy,
+                                   int width, int height, pixman_color_t color)
 {
     DisplaySurface *surface = qemu_console_surface(con);
     pixman_rectangle16_t rect = {
@@ -345,8 +344,8 @@ static void vga_fill_rect(QemuConsole *con,
 }
 
 /* copy from (xs, ys) to (xd, yd) a rectangle of size (w, h) */
-static void vga_bitblt(QemuConsole *con,
-                       int xs, int ys, int xd, int yd, int w, int h)
+static void qemu_console_bitblt(QemuConsole *con,
+                                int xs, int ys, int xd, int yd, int w, int h)
 {
     DisplaySurface *surface = qemu_console_surface(con);
 
@@ -526,8 +525,8 @@ static void console_refresh(QemuTextConsole *s)
     s->text_y[1] = s->height - 1;
     s->cursor_invalidate = 1;
 
-    vga_fill_rect(QEMU_CONSOLE(s), 0, 0, surface_width(surface), surface_height(surface),
-                  color_table_rgb[0][QEMU_COLOR_BLACK]);
+    qemu_console_fill_rect(QEMU_CONSOLE(s), 0, 0, surface_width(surface), surface_height(surface),
+                           color_table_rgb[0][QEMU_COLOR_BLACK]);
     y1 = s->y_displayed;
     for (y = 0; y < s->height; y++) {
         c = s->cells + y1 * s->width;
@@ -605,12 +604,12 @@ static void vc_put_lf(VCChardev *vc)
             s->text_x[1] = s->width - 1;
             s->text_y[1] = s->height - 1;
 
-            vga_bitblt(QEMU_CONSOLE(s), 0, FONT_HEIGHT, 0, 0,
-                       s->width * FONT_WIDTH,
-                       (s->height - 1) * FONT_HEIGHT);
-            vga_fill_rect(QEMU_CONSOLE(s), 0, (s->height - 1) * FONT_HEIGHT,
-                          s->width * FONT_WIDTH, FONT_HEIGHT,
-                          color_table_rgb[0][TEXT_ATTRIBUTES_DEFAULT.bgcol]);
+            qemu_console_bitblt(QEMU_CONSOLE(s), 0, FONT_HEIGHT, 0, 0,
+                                s->width * FONT_WIDTH,
+                                (s->height - 1) * FONT_HEIGHT);
+            qemu_console_fill_rect(QEMU_CONSOLE(s), 0, (s->height - 1) * FONT_HEIGHT,
+                                   s->width * FONT_WIDTH, FONT_HEIGHT,
+                                   color_table_rgb[0][TEXT_ATTRIBUTES_DEFAULT.bgcol]);
             s->update_x0 = 0;
             s->update_y0 = 0;
             s->update_x1 = s->width * FONT_WIDTH;
-- 
2.41.0


Re: [PATCH 37/67] ui/console: rename vga_ functions → qemu_console_
Posted by Philippe Mathieu-Daudé 2 years, 5 months ago
On 30/8/23 11:38, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> They are not specific to VGA. Let's use the object type name as prefix
> instead, to avoid confusion.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>   ui/console.c | 25 ++++++++++++-------------
>   1 file changed, 12 insertions(+), 13 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


Re: [PATCH 37/67] ui/console: rename vga_ functions → qemu_console_
Posted by BALATON Zoltan 2 years, 5 months ago
On Wed, 30 Aug 2023, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>

Maybe refrain from using unicode arrow in Subject: as it may show up 
wrongly with some fonts. Just write "replace ... with" or "rename ... to" 
instead which is also more normal looking sentence than with an arrow.

Regards,
BALATON Zoltan

> They are not specific to VGA. Let's use the object type name as prefix
> instead, to avoid confusion.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> ui/console.c | 25 ++++++++++++-------------
> 1 file changed, 12 insertions(+), 13 deletions(-)
>
> diff --git a/ui/console.c b/ui/console.c
> index 88e37eaff3..a157a5b31c 100644
> --- a/ui/console.c
> +++ b/ui/console.c
> @@ -331,9 +331,8 @@ void graphic_hw_text_update(QemuConsole *con, console_ch_t *chardata)
>     }
> }
>
> -static void vga_fill_rect(QemuConsole *con,
> -                          int posx, int posy, int width, int height,
> -                          pixman_color_t color)
> +static void qemu_console_fill_rect(QemuConsole *con, int posx, int posy,
> +                                   int width, int height, pixman_color_t color)
> {
>     DisplaySurface *surface = qemu_console_surface(con);
>     pixman_rectangle16_t rect = {
> @@ -345,8 +344,8 @@ static void vga_fill_rect(QemuConsole *con,
> }
>
> /* copy from (xs, ys) to (xd, yd) a rectangle of size (w, h) */
> -static void vga_bitblt(QemuConsole *con,
> -                       int xs, int ys, int xd, int yd, int w, int h)
> +static void qemu_console_bitblt(QemuConsole *con,
> +                                int xs, int ys, int xd, int yd, int w, int h)
> {
>     DisplaySurface *surface = qemu_console_surface(con);
>
> @@ -526,8 +525,8 @@ static void console_refresh(QemuTextConsole *s)
>     s->text_y[1] = s->height - 1;
>     s->cursor_invalidate = 1;
>
> -    vga_fill_rect(QEMU_CONSOLE(s), 0, 0, surface_width(surface), surface_height(surface),
> -                  color_table_rgb[0][QEMU_COLOR_BLACK]);
> +    qemu_console_fill_rect(QEMU_CONSOLE(s), 0, 0, surface_width(surface), surface_height(surface),
> +                           color_table_rgb[0][QEMU_COLOR_BLACK]);
>     y1 = s->y_displayed;
>     for (y = 0; y < s->height; y++) {
>         c = s->cells + y1 * s->width;
> @@ -605,12 +604,12 @@ static void vc_put_lf(VCChardev *vc)
>             s->text_x[1] = s->width - 1;
>             s->text_y[1] = s->height - 1;
>
> -            vga_bitblt(QEMU_CONSOLE(s), 0, FONT_HEIGHT, 0, 0,
> -                       s->width * FONT_WIDTH,
> -                       (s->height - 1) * FONT_HEIGHT);
> -            vga_fill_rect(QEMU_CONSOLE(s), 0, (s->height - 1) * FONT_HEIGHT,
> -                          s->width * FONT_WIDTH, FONT_HEIGHT,
> -                          color_table_rgb[0][TEXT_ATTRIBUTES_DEFAULT.bgcol]);
> +            qemu_console_bitblt(QEMU_CONSOLE(s), 0, FONT_HEIGHT, 0, 0,
> +                                s->width * FONT_WIDTH,
> +                                (s->height - 1) * FONT_HEIGHT);
> +            qemu_console_fill_rect(QEMU_CONSOLE(s), 0, (s->height - 1) * FONT_HEIGHT,
> +                                   s->width * FONT_WIDTH, FONT_HEIGHT,
> +                                   color_table_rgb[0][TEXT_ATTRIBUTES_DEFAULT.bgcol]);
>             s->update_x0 = 0;
>             s->update_y0 = 0;
>             s->update_x1 = s->width * FONT_WIDTH;
>
Re: [PATCH 37/67] ui/console: rename vga_ functions → qemu_console_
Posted by Daniel P. Berrangé 2 years, 5 months ago
On Wed, Aug 30, 2023 at 01:38:11PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> They are not specific to VGA. Let's use the object type name as prefix
> instead, to avoid confusion.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  ui/console.c | 25 ++++++++++++-------------
>  1 file changed, 12 insertions(+), 13 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|