All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	qemu-trivial@nongnu.org,
	Alistair Francis <alistair@alistair23.me>,
	Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	qemu-devel@nongnu.org, Igor Mitsyanko <i.mitsyanko@gmail.com>,
	qemu-arm@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [PATCH 09/14] hw/display/xlnx_dp: Replace disabled DPRINTF() by error_report()
Date: Tue, 26 May 2020 11:47:19 +0200	[thread overview]
Message-ID: <20200526094719.GB8957@toto> (raw)
In-Reply-To: <20200526062252.19852-10-f4bug@amsat.org>

On Tue, May 26, 2020 at 08:22:47AM +0200, Philippe Mathieu-Daudé wrote:
> DPRINTF() calls are disabled by default, so when unexpected
> data is used, the whole process abort without information.
> 
> Display a bit of information with error_report() before crashing.

Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>



> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/display/xlnx_dp.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/hw/display/xlnx_dp.c b/hw/display/xlnx_dp.c
> index 3e5fb44e06..8d940cd8d1 100644
> --- a/hw/display/xlnx_dp.c
> +++ b/hw/display/xlnx_dp.c
> @@ -1,5 +1,5 @@
>  /*
> - * xlnx_dp.c
> + * Xilinx Display Port
>   *
>   *  Copyright (C) 2015 : GreenSocs Ltd
>   *      http://www.greensocs.com/ , email: info@greensocs.com
> @@ -24,6 +24,7 @@
>  
>  #include "qemu/osdep.h"
>  #include "qapi/error.h"
> +#include "qemu/error-report.h"
>  #include "qemu/log.h"
>  #include "qemu/module.h"
>  #include "hw/display/xlnx_dp.h"
> @@ -465,7 +466,7 @@ static uint8_t xlnx_dp_aux_pop_tx_fifo(XlnxDPState *s)
>      uint8_t ret;
>  
>      if (fifo8_is_empty(&s->tx_fifo)) {
> -        DPRINTF("tx_fifo underflow..\n");
> +        error_report("%s: TX_FIFO underflow", __func__);
>          abort();
>      }
>      ret = fifo8_pop(&s->tx_fifo);
> @@ -525,6 +526,7 @@ static void xlnx_dp_aux_set_command(XlnxDPState *s, uint32_t value)
>          qemu_log_mask(LOG_UNIMP, "xlnx_dp: Write i2c status not implemented\n");
>          break;
>      default:
> +        error_report("%s: invalid command: %u", __func__, cmd);
>          abort();
>      }
>  
> @@ -631,8 +633,8 @@ static void xlnx_dp_change_graphic_fmt(XlnxDPState *s)
>          s->g_plane.format = PIXMAN_b8g8r8;
>          break;
>      default:
> -        DPRINTF("error: unsupported graphic format %u.\n",
> -                s->avbufm_registers[AV_BUF_FORMAT] & DP_GRAPHIC_MASK);
> +        error_report("%s: unsupported graphic format %u", __func__,
> +                     s->avbufm_registers[AV_BUF_FORMAT] & DP_GRAPHIC_MASK);
>          abort();
>      }
>  
> @@ -647,8 +649,8 @@ static void xlnx_dp_change_graphic_fmt(XlnxDPState *s)
>          s->v_plane.format = PIXMAN_x8b8g8r8;
>          break;
>      default:
> -        DPRINTF("error: unsupported video format %u.\n",
> -                s->avbufm_registers[AV_BUF_FORMAT] & DP_NL_VID_FMT_MASK);
> +        error_report("%s: unsupported video format %u", __func__,
> +                     s->avbufm_registers[AV_BUF_FORMAT] & DP_NL_VID_FMT_MASK);
>          abort();
>      }
>  
> -- 
> 2.21.3
> 


  reply	other threads:[~2020-05-26  9:48 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26  6:22 [PATCH 00/14] hw/display: Omnibus cleanups Philippe Mathieu-Daudé
2020-05-26  6:22 ` [PATCH 01/14] hw/display/edid: Add missing 'qdev-properties.h' header Philippe Mathieu-Daudé
2020-05-26 16:40   ` Alistair Francis
2020-05-26  6:22 ` [PATCH 02/14] hw/display/cg3: Convert debug printf()s to trace events Philippe Mathieu-Daudé
2020-05-26 16:41   ` Alistair Francis
2020-05-26  6:22 ` [PATCH 03/14] hw/display/cirrus_vga: Convert debug printf() to trace event Philippe Mathieu-Daudé
2020-05-26 16:47   ` Alistair Francis
2020-05-26  6:22 ` [PATCH 04/14] hw/display/cirrus_vga: Use qemu_log_mask(UNIMP) instead of debug printf Philippe Mathieu-Daudé
2020-05-26 16:42   ` Alistair Francis
2020-05-26  6:22 ` [PATCH 05/14] hw/display/cirrus_vga: Use qemu_log_mask(ERROR) " Philippe Mathieu-Daudé
2020-05-26 16:44   ` Alistair Francis
2020-05-26  6:22 ` [PATCH 06/14] hw/display/cirrus_vga: Convert debug printf() to trace event Philippe Mathieu-Daudé
2020-05-26 16:46   ` Alistair Francis
2020-05-26  6:22 ` [PATCH 07/14] hw/display/dpcd: Fix memory region size Philippe Mathieu-Daudé
2020-05-26 17:22   ` Alistair Francis
2020-05-26  6:22 ` [PATCH 08/14] hw/display/dpcd: Convert debug printf()s to trace events Philippe Mathieu-Daudé
2020-05-26 17:23   ` Alistair Francis
2020-05-26  6:22 ` [PATCH 09/14] hw/display/xlnx_dp: Replace disabled DPRINTF() by error_report() Philippe Mathieu-Daudé
2020-05-26  9:47   ` Edgar E. Iglesias [this message]
2020-05-26 17:24   ` Alistair Francis
2020-05-26  6:22 ` [PATCH 10/14] hw/display/vmware_vga: Replace printf() calls by qemu_log_mask(ERROR) Philippe Mathieu-Daudé
2020-05-26 17:25   ` Alistair Francis
2020-05-26  6:22 ` [PATCH 11/14] hw/display/vmware_vga: Let the PCI device own its I/O MemoryRegion Philippe Mathieu-Daudé
2020-05-26  8:01   ` Gerd Hoffmann
2020-05-26  8:16     ` Philippe Mathieu-Daudé
2020-05-26 10:47       ` Gerd Hoffmann
2020-05-26  6:22 ` [PATCH 12/14] hw/display/exynos4210_fimd: Use qemu_log_mask(GUEST_ERROR) Philippe Mathieu-Daudé
2020-05-26 17:27   ` Alistair Francis
2020-05-26  6:22 ` [PATCH 13/14] hw/display/omap_dss: Replace fprintf() call by qemu_log_mask(LOG_UNIMP) Philippe Mathieu-Daudé
2020-05-26 17:27   ` Alistair Francis
2020-05-26  6:22 ` [PATCH 14/14] hw/display/pxa2xx_lcd: Replace printf() call by qemu_log_mask() Philippe Mathieu-Daudé
2020-05-26 17:28   ` Alistair Francis
2020-05-26  8:02 ` [PATCH 00/14] hw/display: Omnibus cleanups Gerd Hoffmann
2020-05-26  9:04 ` no-reply

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=20200526094719.GB8957@toto \
    --to=edgar.iglesias@gmail.com \
    --cc=alistair@alistair23.me \
    --cc=f4bug@amsat.org \
    --cc=i.mitsyanko@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.