All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Remove RADEON_HOST_DATA_SWAP_HDW case from RadeonCopySwap
@ 2016-11-04  8:23 Jochen Rollwagen
       [not found] ` <581C456D.7010707-zqRNUXuvxA0b1SvskN2V4Q@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Jochen Rollwagen @ 2016-11-04  8:23 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

[-- Attachment #1: Type: text/plain, Size: 1200 bytes --]

 From ba45efaafc3cf790c44b905d2f6272ef7830b403 Mon Sep 17 00:00:00 2001
From: Jochen Rollwagen <joro-2013-zqRNUXuvxA0b1SvskN2V4Q@public.gmane.org>
Date: Fri, 4 Nov 2016 08:39:30 +0100
Subject: [PATCH] Remove RADEON_HOST_DATA_SWAP_HDW case from RadeonCopySwap

RadeonCopySwap is never called with swap=RADEON_HOST_DATA_SWAP_HDW. 
Remove the case from the switch for clarity.
---
  src/radeon_accel.c |   10 ----------
  1 file changed, 10 deletions(-)

diff --git a/src/radeon_accel.c b/src/radeon_accel.c
index 1def2a3..af2fc99 100644
--- a/src/radeon_accel.c
+++ b/src/radeon_accel.c
@@ -131,16 +131,6 @@ int radeon_cs_space_remaining(ScrnInfoPtr pScrn)
  void RADEONCopySwap(uint8_t *dst, uint8_t *src, unsigned int size, int 
swap)
  {
      switch(swap) {
-    case RADEON_HOST_DATA_SWAP_HDW:
-        {
-        unsigned int *d = (unsigned int *)dst;
-        unsigned int *s = (unsigned int *)src;
-        unsigned int nwords = size >> 2;
-
-        for (; nwords > 0; --nwords, ++d, ++s)
-        *d = ((*s & 0xffff) << 16) | ((*s >> 16) & 0xffff);
-        return;
-        }
      case RADEON_HOST_DATA_SWAP_32BIT:
          {
          unsigned int *d = (unsigned int *)dst;
-- 
1.7.9.5



[-- Attachment #2: 0001-Remove-RADEON_HOST_DATA_SWAP_HDW-case-from-RadeonCop.patch --]
[-- Type: text/x-patch, Size: 1165 bytes --]

>From ba45efaafc3cf790c44b905d2f6272ef7830b403 Mon Sep 17 00:00:00 2001
From: Jochen Rollwagen <joro-2013-zqRNUXuvxA0b1SvskN2V4Q@public.gmane.org>
Date: Fri, 4 Nov 2016 08:39:30 +0100
Subject: [PATCH] Remove RADEON_HOST_DATA_SWAP_HDW case from RadeonCopySwap

RadeonCopySwap is never called with swap=RADEON_HOST_DATA_SWAP_HDW. Remove the case from the switch for clarity.
---
 src/radeon_accel.c |   10 ----------
 1 file changed, 10 deletions(-)

diff --git a/src/radeon_accel.c b/src/radeon_accel.c
index 1def2a3..af2fc99 100644
--- a/src/radeon_accel.c
+++ b/src/radeon_accel.c
@@ -131,16 +131,6 @@ int radeon_cs_space_remaining(ScrnInfoPtr pScrn)
 void RADEONCopySwap(uint8_t *dst, uint8_t *src, unsigned int size, int swap)
 {
     switch(swap) {
-    case RADEON_HOST_DATA_SWAP_HDW:
-        {
-	    unsigned int *d = (unsigned int *)dst;
-	    unsigned int *s = (unsigned int *)src;
-	    unsigned int nwords = size >> 2;
-
-	    for (; nwords > 0; --nwords, ++d, ++s)
-		*d = ((*s & 0xffff) << 16) | ((*s >> 16) & 0xffff);
-	    return;
-        }
     case RADEON_HOST_DATA_SWAP_32BIT:
         {
 	    unsigned int *d = (unsigned int *)dst;
-- 
1.7.9.5


[-- Attachment #3: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Remove RADEON_HOST_DATA_SWAP_HDW case from RadeonCopySwap
       [not found] ` <581C456D.7010707-zqRNUXuvxA0b1SvskN2V4Q@public.gmane.org>
@ 2016-11-07  1:58   ` Michel Dänzer
  0 siblings, 0 replies; 2+ messages in thread
From: Michel Dänzer @ 2016-11-07  1:58 UTC (permalink / raw)
  To: Jochen Rollwagen
  Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org

On 04/11/16 05:23 PM, Jochen Rollwagen wrote:
> From ba45efaafc3cf790c44b905d2f6272ef7830b403 Mon Sep 17 00:00:00 2001
> From: Jochen Rollwagen <joro-2013@t-online.de>
> Date: Fri, 4 Nov 2016 08:39:30 +0100
> Subject: [PATCH] Remove RADEON_HOST_DATA_SWAP_HDW case from RadeonCopySwap
> 
> RadeonCopySwap is never called with swap=RADEON_HOST_DATA_SWAP_HDW.
> Remove the case from the switch for clarity.
> ---
>  src/radeon_accel.c |   10 ----------
>  1 file changed, 10 deletions(-)
> 
> diff --git a/src/radeon_accel.c b/src/radeon_accel.c
> index 1def2a3..af2fc99 100644
> --- a/src/radeon_accel.c
> +++ b/src/radeon_accel.c
> @@ -131,16 +131,6 @@ int radeon_cs_space_remaining(ScrnInfoPtr pScrn)
>  void RADEONCopySwap(uint8_t *dst, uint8_t *src, unsigned int size, int
> swap)
>  {
>      switch(swap) {
> -    case RADEON_HOST_DATA_SWAP_HDW:
> -        {
> -        unsigned int *d = (unsigned int *)dst;
> -        unsigned int *s = (unsigned int *)src;
> -        unsigned int nwords = size >> 2;
> -
> -        for (; nwords > 0; --nwords, ++d, ++s)
> -        *d = ((*s & 0xffff) << 16) | ((*s >> 16) & 0xffff);
> -        return;
> -        }
>      case RADEON_HOST_DATA_SWAP_32BIT:
>          {
>          unsigned int *d = (unsigned int *)dst;

It'd be better to keep something like

    case RADEON_HOST_DATA_SWAP_HDW:
	FatalError("Unsupported swap value RADEON_HOST_DATA_SWAP_HDW\n");

so that if somebody makes a change which causes this value to be passed
in, there's an obvious failure (Xorg aborts with the message passed to
FatalError) instead of a subtle one (RADEONCopySwap uses different byte
swapping than intended).


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-07  1:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-04  8:23 [PATCH] Remove RADEON_HOST_DATA_SWAP_HDW case from RadeonCopySwap Jochen Rollwagen
     [not found] ` <581C456D.7010707-zqRNUXuvxA0b1SvskN2V4Q@public.gmane.org>
2016-11-07  1:58   ` Michel Dänzer

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.