Skip to contentSkip to conversation

Remove RADEON_HOST_DATA_SWAP_HDW case from RadeonCopySwap

PATCH In review Jochen Rollwagen 2 participants 2 messages Nov 4, 2016 – Nov 7, 2016 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove RADEON_HOST_DATA_SWAP_HDW case from RadeonCopySwap

From ba45efaafc3cf790c44b905d2f6272ef7830b403 Mon Sep 17 00:00:00 2001
From: Jochen Rollwagen <[email protected]>
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(-)
src/radeon_accel.c +0 -0
index 1def2a3..af2fc99 100644
@@ -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;
Signature · 1 line
1.7.9.5
Quoted 1 line

From ba45efaafc3cf790c44b905d2f6272ef7830b403 Mon Sep 17 00:00:00 2001

From: Jochen Rollwagen <[email protected]>
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(-)
src/radeon_accel.c +0 -10
index 1def2a3..af2fc99 100644
@@ -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;
Signature · 1 line
1.7.9.5

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 32 lines · Jochen Rollwagen

From ba45efaafc3cf790c44b905d2f6272ef7830b403 Mon Sep 17 00:00:00 2001
From: Jochen Rollwagen <[email protected]>
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(-)
src/radeon_accel.c +0 -10
index 1def2a3..af2fc99 100644
@@ -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:
         {
Quoted 1 line
         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).

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx