From: vincent.abriou@st.com (Vincent ABRIOU)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH, RESEND] drm/sti: use u32 to store DMA addresses
Date: Fri, 26 Feb 2016 09:18:58 +0100 [thread overview]
Message-ID: <56D00A72.10007@st.com> (raw)
In-Reply-To: <1456434711-48393-1-git-send-email-arnd@arndb.de>
Hi Arnd,
Your patch will be part of the next pull request for the STI driver that
will be done by the end of next week.
Reviewed-by: Vincent Abriou <vincent.abriou@st.com>
On 02/25/2016 10:11 PM, Arnd Bergmann wrote:
> The STi drm driver correctly warns about invalid format strings
> when built with 64-bit dma_addr_t:
>
> sti_hqvdp.c: In function 'sti_hqvdp_vtg_cb':
> sti_hqvdp.c:605:119: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t {aka long long unsigned int}' [-Wformat=]
> sti_hqvdp.c: In function 'sti_hqvdp_atomic_update':
> sti_hqvdp.c:931:118: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t {aka long long unsigned int}' [-Wformat=]
>
> This could be changed to using the %pad format string, but that
> does not work when printing an rvalue, so instead I'm changing
> the type in the sti_hqvdp structure to u32, which is what gets
> written into the registers anyway.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/gpu/drm/sti/sti_hqvdp.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> I originally submitted this on Tue, 08 Dec 2015, but got no reply,
> so resending the same patch now.
>
> diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
> index 1d3c3d029603..7818d47bea43 100644
> --- a/drivers/gpu/drm/sti/sti_hqvdp.c
> +++ b/drivers/gpu/drm/sti/sti_hqvdp.c
> @@ -349,7 +349,7 @@ struct sti_hqvdp {
> unsigned int curr_field_count;
> unsigned int last_field_count;
> void *hqvdp_cmd;
> - dma_addr_t hqvdp_cmd_paddr;
> + u32 hqvdp_cmd_paddr;
> struct sti_vtg *vtg;
> bool xp70_initialized;
> };
> @@ -372,8 +372,8 @@ static const uint32_t hqvdp_supported_formats[] = {
> */
> static int sti_hqvdp_get_free_cmd(struct sti_hqvdp *hqvdp)
> {
> - int curr_cmd, next_cmd;
> - dma_addr_t cmd = hqvdp->hqvdp_cmd_paddr;
> + u32 curr_cmd, next_cmd;
> + u32 cmd = hqvdp->hqvdp_cmd_paddr;
> int i;
>
> curr_cmd = readl(hqvdp->regs + HQVDP_MBX_CURRENT_CMD);
> @@ -400,8 +400,8 @@ static int sti_hqvdp_get_free_cmd(struct sti_hqvdp *hqvdp)
> */
> static int sti_hqvdp_get_curr_cmd(struct sti_hqvdp *hqvdp)
> {
> - int curr_cmd;
> - dma_addr_t cmd = hqvdp->hqvdp_cmd_paddr;
> + u32 curr_cmd;
> + u32 cmd = hqvdp->hqvdp_cmd_paddr;
> unsigned int i;
>
> curr_cmd = readl(hqvdp->regs + HQVDP_MBX_CURRENT_CMD);
> @@ -612,19 +612,21 @@ int sti_hqvdp_vtg_cb(struct notifier_block *nb, unsigned long evt, void *data)
> static void sti_hqvdp_init(struct sti_hqvdp *hqvdp)
> {
> int size;
> + dma_addr_t dma_addr;
>
> hqvdp->vtg_nb.notifier_call = sti_hqvdp_vtg_cb;
>
> /* Allocate memory for the VDP commands */
> size = NB_VDP_CMD * sizeof(struct sti_hqvdp_cmd);
> hqvdp->hqvdp_cmd = dma_alloc_wc(hqvdp->dev, size,
> - &hqvdp->hqvdp_cmd_paddr,
> + &dma_addr,
> GFP_KERNEL | GFP_DMA);
> if (!hqvdp->hqvdp_cmd) {
> DRM_ERROR("Failed to allocate memory for VDP cmd\n");
> return;
> }
>
> + hqvdp->hqvdp_cmd_paddr = (u32)dma_addr;
> memset(hqvdp->hqvdp_cmd, 0, size);
> }
>
>
WARNING: multiple messages have this Message-ID (diff)
From: Vincent ABRIOU <vincent.abriou@st.com>
To: Arnd Bergmann <arnd@arndb.de>, David Airlie <airlied@linux.ie>
Cc: "dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
Benjamin Gaignard <benjamin.gaignard@linaro.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH, RESEND] drm/sti: use u32 to store DMA addresses
Date: Fri, 26 Feb 2016 09:18:58 +0100 [thread overview]
Message-ID: <56D00A72.10007@st.com> (raw)
In-Reply-To: <1456434711-48393-1-git-send-email-arnd@arndb.de>
Hi Arnd,
Your patch will be part of the next pull request for the STI driver that
will be done by the end of next week.
Reviewed-by: Vincent Abriou <vincent.abriou@st.com>
On 02/25/2016 10:11 PM, Arnd Bergmann wrote:
> The STi drm driver correctly warns about invalid format strings
> when built with 64-bit dma_addr_t:
>
> sti_hqvdp.c: In function 'sti_hqvdp_vtg_cb':
> sti_hqvdp.c:605:119: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t {aka long long unsigned int}' [-Wformat=]
> sti_hqvdp.c: In function 'sti_hqvdp_atomic_update':
> sti_hqvdp.c:931:118: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t {aka long long unsigned int}' [-Wformat=]
>
> This could be changed to using the %pad format string, but that
> does not work when printing an rvalue, so instead I'm changing
> the type in the sti_hqvdp structure to u32, which is what gets
> written into the registers anyway.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/gpu/drm/sti/sti_hqvdp.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> I originally submitted this on Tue, 08 Dec 2015, but got no reply,
> so resending the same patch now.
>
> diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
> index 1d3c3d029603..7818d47bea43 100644
> --- a/drivers/gpu/drm/sti/sti_hqvdp.c
> +++ b/drivers/gpu/drm/sti/sti_hqvdp.c
> @@ -349,7 +349,7 @@ struct sti_hqvdp {
> unsigned int curr_field_count;
> unsigned int last_field_count;
> void *hqvdp_cmd;
> - dma_addr_t hqvdp_cmd_paddr;
> + u32 hqvdp_cmd_paddr;
> struct sti_vtg *vtg;
> bool xp70_initialized;
> };
> @@ -372,8 +372,8 @@ static const uint32_t hqvdp_supported_formats[] = {
> */
> static int sti_hqvdp_get_free_cmd(struct sti_hqvdp *hqvdp)
> {
> - int curr_cmd, next_cmd;
> - dma_addr_t cmd = hqvdp->hqvdp_cmd_paddr;
> + u32 curr_cmd, next_cmd;
> + u32 cmd = hqvdp->hqvdp_cmd_paddr;
> int i;
>
> curr_cmd = readl(hqvdp->regs + HQVDP_MBX_CURRENT_CMD);
> @@ -400,8 +400,8 @@ static int sti_hqvdp_get_free_cmd(struct sti_hqvdp *hqvdp)
> */
> static int sti_hqvdp_get_curr_cmd(struct sti_hqvdp *hqvdp)
> {
> - int curr_cmd;
> - dma_addr_t cmd = hqvdp->hqvdp_cmd_paddr;
> + u32 curr_cmd;
> + u32 cmd = hqvdp->hqvdp_cmd_paddr;
> unsigned int i;
>
> curr_cmd = readl(hqvdp->regs + HQVDP_MBX_CURRENT_CMD);
> @@ -612,19 +612,21 @@ int sti_hqvdp_vtg_cb(struct notifier_block *nb, unsigned long evt, void *data)
> static void sti_hqvdp_init(struct sti_hqvdp *hqvdp)
> {
> int size;
> + dma_addr_t dma_addr;
>
> hqvdp->vtg_nb.notifier_call = sti_hqvdp_vtg_cb;
>
> /* Allocate memory for the VDP commands */
> size = NB_VDP_CMD * sizeof(struct sti_hqvdp_cmd);
> hqvdp->hqvdp_cmd = dma_alloc_wc(hqvdp->dev, size,
> - &hqvdp->hqvdp_cmd_paddr,
> + &dma_addr,
> GFP_KERNEL | GFP_DMA);
> if (!hqvdp->hqvdp_cmd) {
> DRM_ERROR("Failed to allocate memory for VDP cmd\n");
> return;
> }
>
> + hqvdp->hqvdp_cmd_paddr = (u32)dma_addr;
> memset(hqvdp->hqvdp_cmd, 0, size);
> }
>
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
WARNING: multiple messages have this Message-ID (diff)
From: Vincent ABRIOU <vincent.abriou@st.com>
To: Arnd Bergmann <arnd@arndb.de>, David Airlie <airlied@linux.ie>
Cc: "linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Benjamin Gaignard <benjamin.gaignard@linaro.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH, RESEND] drm/sti: use u32 to store DMA addresses
Date: Fri, 26 Feb 2016 09:18:58 +0100 [thread overview]
Message-ID: <56D00A72.10007@st.com> (raw)
In-Reply-To: <1456434711-48393-1-git-send-email-arnd@arndb.de>
Hi Arnd,
Your patch will be part of the next pull request for the STI driver that
will be done by the end of next week.
Reviewed-by: Vincent Abriou <vincent.abriou@st.com>
On 02/25/2016 10:11 PM, Arnd Bergmann wrote:
> The STi drm driver correctly warns about invalid format strings
> when built with 64-bit dma_addr_t:
>
> sti_hqvdp.c: In function 'sti_hqvdp_vtg_cb':
> sti_hqvdp.c:605:119: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t {aka long long unsigned int}' [-Wformat=]
> sti_hqvdp.c: In function 'sti_hqvdp_atomic_update':
> sti_hqvdp.c:931:118: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t {aka long long unsigned int}' [-Wformat=]
>
> This could be changed to using the %pad format string, but that
> does not work when printing an rvalue, so instead I'm changing
> the type in the sti_hqvdp structure to u32, which is what gets
> written into the registers anyway.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/gpu/drm/sti/sti_hqvdp.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> I originally submitted this on Tue, 08 Dec 2015, but got no reply,
> so resending the same patch now.
>
> diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
> index 1d3c3d029603..7818d47bea43 100644
> --- a/drivers/gpu/drm/sti/sti_hqvdp.c
> +++ b/drivers/gpu/drm/sti/sti_hqvdp.c
> @@ -349,7 +349,7 @@ struct sti_hqvdp {
> unsigned int curr_field_count;
> unsigned int last_field_count;
> void *hqvdp_cmd;
> - dma_addr_t hqvdp_cmd_paddr;
> + u32 hqvdp_cmd_paddr;
> struct sti_vtg *vtg;
> bool xp70_initialized;
> };
> @@ -372,8 +372,8 @@ static const uint32_t hqvdp_supported_formats[] = {
> */
> static int sti_hqvdp_get_free_cmd(struct sti_hqvdp *hqvdp)
> {
> - int curr_cmd, next_cmd;
> - dma_addr_t cmd = hqvdp->hqvdp_cmd_paddr;
> + u32 curr_cmd, next_cmd;
> + u32 cmd = hqvdp->hqvdp_cmd_paddr;
> int i;
>
> curr_cmd = readl(hqvdp->regs + HQVDP_MBX_CURRENT_CMD);
> @@ -400,8 +400,8 @@ static int sti_hqvdp_get_free_cmd(struct sti_hqvdp *hqvdp)
> */
> static int sti_hqvdp_get_curr_cmd(struct sti_hqvdp *hqvdp)
> {
> - int curr_cmd;
> - dma_addr_t cmd = hqvdp->hqvdp_cmd_paddr;
> + u32 curr_cmd;
> + u32 cmd = hqvdp->hqvdp_cmd_paddr;
> unsigned int i;
>
> curr_cmd = readl(hqvdp->regs + HQVDP_MBX_CURRENT_CMD);
> @@ -612,19 +612,21 @@ int sti_hqvdp_vtg_cb(struct notifier_block *nb, unsigned long evt, void *data)
> static void sti_hqvdp_init(struct sti_hqvdp *hqvdp)
> {
> int size;
> + dma_addr_t dma_addr;
>
> hqvdp->vtg_nb.notifier_call = sti_hqvdp_vtg_cb;
>
> /* Allocate memory for the VDP commands */
> size = NB_VDP_CMD * sizeof(struct sti_hqvdp_cmd);
> hqvdp->hqvdp_cmd = dma_alloc_wc(hqvdp->dev, size,
> - &hqvdp->hqvdp_cmd_paddr,
> + &dma_addr,
> GFP_KERNEL | GFP_DMA);
> if (!hqvdp->hqvdp_cmd) {
> DRM_ERROR("Failed to allocate memory for VDP cmd\n");
> return;
> }
>
> + hqvdp->hqvdp_cmd_paddr = (u32)dma_addr;
> memset(hqvdp->hqvdp_cmd, 0, size);
> }
>
>
next prev parent reply other threads:[~2016-02-26 8:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-25 21:11 [PATCH, RESEND] drm/sti: use u32 to store DMA addresses Arnd Bergmann
2016-02-25 21:11 ` Arnd Bergmann
2016-02-25 21:11 ` Arnd Bergmann
2016-02-26 8:18 ` Vincent ABRIOU [this message]
2016-02-26 8:18 ` Vincent ABRIOU
2016-02-26 8:18 ` Vincent ABRIOU
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=56D00A72.10007@st.com \
--to=vincent.abriou@st.com \
--cc=linux-arm-kernel@lists.infradead.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.