xf86-video-ati: Branch 'kms-only' - 2 commits
Dave Airlie
airlied at kemper.freedesktop.org
Fri Jun 15 10:48:09 PDT 2012
src/radeon.h | 2
src/radeon_accel.c | 5 -
src/radeon_exa.c | 5 -
src/radeon_textured_video.c | 82 ++++++++++++++++++++++
src/radeon_video.c | 163 --------------------------------------------
src/radeon_video.h | 5 -
6 files changed, 84 insertions(+), 178 deletions(-)
New commits:
commit 997b0dddfeb180043ece5eff0ac0d6a1a751f9b5
Author: Dave Airlie <airlied at redhat.com>
Date: Fri Jun 15 18:43:01 2012 +0100
radeon: drop radeonGetPixmapOffset
no longer needed.
Signed-off-by: Dave Airlie <airlied at redhat.com>
diff --git a/src/radeon.h b/src/radeon.h
index c80aae9..21f950b 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -509,7 +509,6 @@ extern Bool RADEONAccelInit(ScreenPtr pScreen);
extern void RADEONEngineInit(ScrnInfoPtr pScrn);
extern void RADEONCopySwap(uint8_t *dst, uint8_t *src, unsigned int size, int swap);
extern void RADEONInit3DEngine(ScrnInfoPtr pScrn);
-uint32_t radeonGetPixmapOffset(PixmapPtr pPix);
extern int radeon_cs_space_remaining(ScrnInfoPtr pScrn);
/* radeon_commonfuncs.c */
diff --git a/src/radeon_accel.c b/src/radeon_accel.c
index c8d52b9..32f3095 100644
--- a/src/radeon_accel.c
+++ b/src/radeon_accel.c
@@ -146,11 +146,6 @@ void RADEONEngineInit(ScrnInfoPtr pScrn)
}
-uint32_t radeonGetPixmapOffset(PixmapPtr pPix)
-{
- return 0;
-}
-
int radeon_cs_space_remaining(ScrnInfoPtr pScrn)
{
RADEONInfoPtr info = RADEONPTR(pScrn);
diff --git a/src/radeon_exa.c b/src/radeon_exa.c
index be12533..99dc453 100644
--- a/src/radeon_exa.c
+++ b/src/radeon_exa.c
@@ -150,17 +150,16 @@ static Bool RADEONGetOffsetPitch(PixmapPtr pPix, int bpp, uint32_t *pitch_offset
Bool RADEONGetPixmapOffsetPitch(PixmapPtr pPix, uint32_t *pitch_offset)
{
- uint32_t pitch, offset;
+ uint32_t pitch;
int bpp;
bpp = pPix->drawable.bitsPerPixel;
if (bpp == 24)
bpp = 8;
- offset = radeonGetPixmapOffset(pPix);
pitch = exaGetPixmapPitch(pPix);
- return RADEONGetOffsetPitch(pPix, bpp, pitch_offset, offset, pitch);
+ return RADEONGetOffsetPitch(pPix, bpp, pitch_offset, 0, pitch);
}
/**
commit 639061edb3ac35a24e4d6633c9b6384434dcac64
Author: Dave Airlie <airlied at redhat.com>
Date: Fri Jun 15 18:38:48 2012 +0100
radeon: move more functions into texture video
make more thing static.
Signed-off-by: Dave Airlie <airlied at redhat.com>
diff --git a/src/radeon.h b/src/radeon.h
index 76af641..c80aae9 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -494,7 +494,6 @@ typedef struct {
struct radeon_surface_manager *surf_man;
struct radeon_surface front_surface;
-
/* Xv bicubic filtering */
struct radeon_bo *bicubic_bo;
diff --git a/src/radeon_textured_video.c b/src/radeon_textured_video.c
index 4544a08..63631c9 100644
--- a/src/radeon_textured_video.c
+++ b/src/radeon_textured_video.c
@@ -733,6 +733,88 @@ static void radeon_unload_bicubic_texture(ScrnInfoPtr pScrn)
}
#endif
+static void
+RADEONQueryBestSize(
+ ScrnInfoPtr pScrn,
+ Bool motion,
+ short vid_w, short vid_h,
+ short drw_w, short drw_h,
+ unsigned int *p_w, unsigned int *p_h,
+ pointer data
+){
+ RADEONPortPrivPtr pPriv = (RADEONPortPrivPtr)data;
+
+ if (!pPriv->textured) {
+ if (vid_w > (drw_w << 4))
+ drw_w = vid_w >> 4;
+ if (vid_h > (drw_h << 4))
+ drw_h = vid_h >> 4;
+ }
+
+ *p_w = drw_w;
+ *p_h = drw_h;
+}
+
+#define FOURCC_RGB24 0x00000000
+#define FOURCC_RGBT16 0x54424752
+#define FOURCC_RGB16 0x32424752
+#define FOURCC_RGBA32 0x41424752
+
+static int
+RADEONQueryImageAttributes(
+ ScrnInfoPtr pScrn,
+ int id,
+ unsigned short *w, unsigned short *h,
+ int *pitches, int *offsets
+){
+ const RADEONInfoRec * const info = RADEONPTR(pScrn);
+ int size, tmp;
+
+ if(*w > info->xv_max_width) *w = info->xv_max_width;
+ if(*h > info->xv_max_height) *h = info->xv_max_height;
+
+ *w = RADEON_ALIGN(*w, 2);
+ if(offsets) offsets[0] = 0;
+
+ switch(id) {
+ case FOURCC_YV12:
+ case FOURCC_I420:
+ *h = RADEON_ALIGN(*h, 2);
+ size = RADEON_ALIGN(*w, 4);
+ if(pitches) pitches[0] = size;
+ size *= *h;
+ if(offsets) offsets[1] = size;
+ tmp = RADEON_ALIGN(*w >> 1, 4);
+ if(pitches) pitches[1] = pitches[2] = tmp;
+ tmp *= (*h >> 1);
+ size += tmp;
+ if(offsets) offsets[2] = size;
+ size += tmp;
+ break;
+ case FOURCC_RGBA32:
+ size = *w << 2;
+ if(pitches) pitches[0] = size;
+ size *= *h;
+ break;
+ case FOURCC_RGB24:
+ size = *w * 3;
+ if(pitches) pitches[0] = size;
+ size *= *h;
+ break;
+ case FOURCC_RGBT16:
+ case FOURCC_RGB16:
+ case FOURCC_UYVY:
+ case FOURCC_YUY2:
+ default:
+ size = *w << 1;
+ if(pitches) pitches[0] = size;
+ size *= *h;
+ break;
+ }
+
+ return size;
+}
+
XF86VideoAdaptorPtr
RADEONSetupImageTexturedVideo(ScreenPtr pScreen)
{
diff --git a/src/radeon_video.c b/src/radeon_video.c
index 2422779..e996ced 100644
--- a/src/radeon_video.c
+++ b/src/radeon_video.c
@@ -250,113 +250,6 @@ void RADEONInitVideo(ScreenPtr pScreen)
}
-#define INCLUDE_RGB_FORMATS 1
-
-#if INCLUDE_RGB_FORMATS
-
-#define NUM_IMAGES 8
-
-/* Note: GUIDs are bogus... - but nothing uses them anyway */
-
-#define FOURCC_RGBA32 0x41424752
-
-#define XVIMAGE_RGBA32(byte_order) \
- { \
- FOURCC_RGBA32, \
- XvRGB, \
- byte_order, \
- { 'R', 'G', 'B', 'A', \
- 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
- 32, \
- XvPacked, \
- 1, \
- 32, 0x00FF0000, 0x0000FF00, 0x000000FF, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, \
- {'A', 'R', 'G', 'B', \
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
- XvTopToBottom \
- }
-
-#define FOURCC_RGB24 0x00000000
-
-#define XVIMAGE_RGB24 \
- { \
- FOURCC_RGB24, \
- XvRGB, \
- LSBFirst, \
- { 'R', 'G', 'B', 0, \
- 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
- 24, \
- XvPacked, \
- 1, \
- 24, 0x00FF0000, 0x0000FF00, 0x000000FF, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, \
- { 'R', 'G', 'B', \
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
- XvTopToBottom \
- }
-
-#define FOURCC_RGBT16 0x54424752
-
-#define XVIMAGE_RGBT16(byte_order) \
- { \
- FOURCC_RGBT16, \
- XvRGB, \
- byte_order, \
- { 'R', 'G', 'B', 'T', \
- 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
- 16, \
- XvPacked, \
- 1, \
- 16, 0x00007C00, 0x000003E0, 0x0000001F, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, \
- {'A', 'R', 'G', 'B', \
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
- XvTopToBottom \
- }
-
-#define FOURCC_RGB16 0x32424752
-
-#define XVIMAGE_RGB16(byte_order) \
- { \
- FOURCC_RGB16, \
- XvRGB, \
- byte_order, \
- { 'R', 'G', 'B', 0x00, \
- 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
- 16, \
- XvPacked, \
- 1, \
- 16, 0x0000F800, 0x000007E0, 0x0000001F, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, \
- {'R', 'G', 'B', \
- 0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
- XvTopToBottom \
- }
-#endif
-
-void
-RADEONQueryBestSize(
- ScrnInfoPtr pScrn,
- Bool motion,
- short vid_w, short vid_h,
- short drw_w, short drw_h,
- unsigned int *p_w, unsigned int *p_h,
- pointer data
-){
- RADEONPortPrivPtr pPriv = (RADEONPortPrivPtr)data;
-
- if (!pPriv->textured) {
- if (vid_w > (drw_w << 4))
- drw_w = vid_w >> 4;
- if (vid_h > (drw_h << 4))
- drw_h = vid_h >> 4;
- }
-
- *p_w = drw_w;
- *p_h = drw_h;
-}
-
void
RADEONCopyData(
ScrnInfoPtr pScrn,
@@ -448,59 +341,3 @@ RADEONCopyMungedData(
}
}
}
-
-int
-RADEONQueryImageAttributes(
- ScrnInfoPtr pScrn,
- int id,
- unsigned short *w, unsigned short *h,
- int *pitches, int *offsets
-){
- const RADEONInfoRec * const info = RADEONPTR(pScrn);
- int size, tmp;
-
- if(*w > info->xv_max_width) *w = info->xv_max_width;
- if(*h > info->xv_max_height) *h = info->xv_max_height;
-
- *w = RADEON_ALIGN(*w, 2);
- if(offsets) offsets[0] = 0;
-
- switch(id) {
- case FOURCC_YV12:
- case FOURCC_I420:
- *h = RADEON_ALIGN(*h, 2);
- size = RADEON_ALIGN(*w, 4);
- if(pitches) pitches[0] = size;
- size *= *h;
- if(offsets) offsets[1] = size;
- tmp = RADEON_ALIGN(*w >> 1, 4);
- if(pitches) pitches[1] = pitches[2] = tmp;
- tmp *= (*h >> 1);
- size += tmp;
- if(offsets) offsets[2] = size;
- size += tmp;
- break;
- case FOURCC_RGBA32:
- size = *w << 2;
- if(pitches) pitches[0] = size;
- size *= *h;
- break;
- case FOURCC_RGB24:
- size = *w * 3;
- if(pitches) pitches[0] = size;
- size *= *h;
- break;
- case FOURCC_RGBT16:
- case FOURCC_RGB16:
- case FOURCC_UYVY:
- case FOURCC_YUY2:
- default:
- size = *w << 1;
- if(pitches) pitches[0] = size;
- size *= *h;
- break;
- }
-
- return size;
-}
-
diff --git a/src/radeon_video.h b/src/radeon_video.h
index ea61ece..f097f2f 100644
--- a/src/radeon_video.h
+++ b/src/radeon_video.h
@@ -81,11 +81,6 @@ typedef struct tagREF_TRANSFORM
#define RTFContrast(a) (1.0 + ((a)*1.0)/1000.0)
#define RTFHue(a) (((a)*3.1416)/1000.0)
-void RADEONQueryBestSize(ScrnInfoPtr, Bool, short, short, short, short,
- unsigned int *, unsigned int *, pointer);
-int RADEONQueryImageAttributes(ScrnInfoPtr, int, unsigned short *,
- unsigned short *, int *, int *);
-
XF86VideoAdaptorPtr
RADEONSetupImageTexturedVideo(ScreenPtr pScreen);
More information about the xorg-commit
mailing list