From: "Michel Dänzer" <michel@daenzer.net>
To: Oded Gabbay <oded.gabbay@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/3] radeon: Fix VCE ring test for Big-Endian systems
Date: Mon, 7 Dec 2015 16:51:41 +0900 [thread overview]
Message-ID: <56653A8D.6010006@daenzer.net> (raw)
In-Reply-To: <1449263345-4938-2-git-send-email-oded.gabbay@gmail.com>
On 05.12.2015 06:09, Oded Gabbay wrote:
> This patch fixes the VCE ring test when running on Big-Endian machines.
> Every write to the ring needs to be translated to little-endian.
>
> Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
> Cc: stable@vger.kernel.org
> ---
> drivers/gpu/drm/radeon/radeon_vce.c | 32 ++++++++++++++++----------------
> 1 file changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_vce.c b/drivers/gpu/drm/radeon/radeon_vce.c
> index 574f62b..86f57e4 100644
> --- a/drivers/gpu/drm/radeon/radeon_vce.c
> +++ b/drivers/gpu/drm/radeon/radeon_vce.c
> @@ -699,12 +699,12 @@ bool radeon_vce_semaphore_emit(struct radeon_device *rdev,
> {
> uint64_t addr = semaphore->gpu_addr;
>
> - radeon_ring_write(ring, VCE_CMD_SEMAPHORE);
> - radeon_ring_write(ring, (addr >> 3) & 0x000FFFFF);
> - radeon_ring_write(ring, (addr >> 23) & 0x000FFFFF);
> - radeon_ring_write(ring, 0x01003000 | (emit_wait ? 1 : 0));
> + radeon_ring_write(ring, cpu_to_le32(VCE_CMD_SEMAPHORE));
> + radeon_ring_write(ring, cpu_to_le32((addr >> 3) & 0x000FFFFF));
> + radeon_ring_write(ring, cpu_to_le32((addr >> 23) & 0x000FFFFF));
> + radeon_ring_write(ring, cpu_to_le32(0x01003000 | (emit_wait ? 1 : 0)));
> if (!emit_wait)
> - radeon_ring_write(ring, VCE_CMD_END);
> + radeon_ring_write(ring, cpu_to_le32(VCE_CMD_END));
>
> return true;
> }
> @@ -719,10 +719,10 @@ bool radeon_vce_semaphore_emit(struct radeon_device *rdev,
> void radeon_vce_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib)
> {
> struct radeon_ring *ring = &rdev->ring[ib->ring];
> - radeon_ring_write(ring, VCE_CMD_IB);
> - radeon_ring_write(ring, ib->gpu_addr);
> - radeon_ring_write(ring, upper_32_bits(ib->gpu_addr));
> - radeon_ring_write(ring, ib->length_dw);
> + radeon_ring_write(ring, cpu_to_le32(VCE_CMD_IB));
> + radeon_ring_write(ring, cpu_to_le32(ib->gpu_addr));
> + radeon_ring_write(ring, cpu_to_le32(upper_32_bits(ib->gpu_addr)));
> + radeon_ring_write(ring, cpu_to_le32(ib->length_dw));
> }
>
> /**
> @@ -738,12 +738,12 @@ void radeon_vce_fence_emit(struct radeon_device *rdev,
> struct radeon_ring *ring = &rdev->ring[fence->ring];
> uint64_t addr = rdev->fence_drv[fence->ring].gpu_addr;
>
> - radeon_ring_write(ring, VCE_CMD_FENCE);
> - radeon_ring_write(ring, addr);
> - radeon_ring_write(ring, upper_32_bits(addr));
> - radeon_ring_write(ring, fence->seq);
> - radeon_ring_write(ring, VCE_CMD_TRAP);
> - radeon_ring_write(ring, VCE_CMD_END);
> + radeon_ring_write(ring, cpu_to_le32(VCE_CMD_FENCE));
> + radeon_ring_write(ring, cpu_to_le32(addr));
> + radeon_ring_write(ring, cpu_to_le32(upper_32_bits(addr)));
> + radeon_ring_write(ring, cpu_to_le32(fence->seq));
> + radeon_ring_write(ring, cpu_to_le32(VCE_CMD_TRAP));
> + radeon_ring_write(ring, cpu_to_le32(VCE_CMD_END));
> }
>
> /**
> @@ -765,7 +765,7 @@ int radeon_vce_ring_test(struct radeon_device *rdev, struct radeon_ring *ring)
> ring->idx, r);
> return r;
> }
> - radeon_ring_write(ring, VCE_CMD_END);
> + radeon_ring_write(ring, cpu_to_le32(VCE_CMD_END));
> radeon_ring_unlock_commit(rdev, ring, false);
>
> for (i = 0; i < rdev->usec_timeout; i++) {
>
A new helper function such as
static inline void radeon_ring_write_le(struct radeon_ring *ring, uint32_t v)
{
radeon_ring_write(ring, cpu_to_le32(v));
}
might be nice for this.
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2015-12-07 7:51 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-04 21:09 [PATCH 1/3] radeon/cik: Fix GFX IB test on Big-Endian Oded Gabbay
2015-12-04 21:09 ` Oded Gabbay
2015-12-04 21:09 ` [PATCH 2/3] radeon: Fix VCE ring test for Big-Endian systems Oded Gabbay
2015-12-07 7:51 ` Michel Dänzer [this message]
2015-12-07 17:49 ` Oded Gabbay
2015-12-08 3:00 ` Michel Dänzer
2015-12-09 10:20 ` Rafał Miłecki
2015-12-04 21:09 ` [PATCH 3/3] radeon: Fix VCE IB test on " Oded Gabbay
2015-12-05 10:23 ` [PATCH 1/3] radeon/cik: Fix GFX IB test on Big-Endian Christian König
2015-12-06 7:29 ` Oded Gabbay
2015-12-06 7:29 ` Oded Gabbay
2015-12-06 18:45 ` Christian König
2015-12-06 18:45 ` Christian König
2015-12-06 19:00 ` Oded Gabbay
2015-12-06 19:03 ` Christian König
2015-12-06 19:03 ` Christian König
2015-12-06 19:05 ` Oded Gabbay
2015-12-09 5:25 ` Alex Deucher
2015-12-09 5:25 ` Alex Deucher
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=56653A8D.6010006@daenzer.net \
--to=michel@daenzer.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=oded.gabbay@gmail.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 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.