xf86-video-intel: 3 commits - src/i830_video.c
Ian Romanick
idr at kemper.freedesktop.org
Wed Jul 1 15:40:35 PDT 2009
src/i830_video.c | 58 ++++++++++++++++++++++++-------------------------------
1 file changed, 26 insertions(+), 32 deletions(-)
New commits:
commit 4100abdf5d208bbcbb4ceabad0572c04221443c9
Author: Daniel Vetter <daniel.vetter at ffwll.ch>
Date: Tue Jun 30 13:12:45 2009 +0200
Xv: kill !textured condition
This is in the overlay path and therefore always true.
Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
diff --git a/src/i830_video.c b/src/i830_video.c
index f8bd4a2..e142fb5 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -1055,8 +1055,7 @@ I830StopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
}
if (pPriv->buf) {
- if (!pPriv->textured)
- drm_intel_bo_unpin(pPriv->buf);
+ drm_intel_bo_unpin(pPriv->buf);
drm_intel_bo_unreference(pPriv->buf);
pPriv->buf = NULL;
pPriv->videoStatus = 0;
commit b0df0fe91e2b800ed096f369850aa1af4be2f157
Author: Daniel Vetter <daniel.vetter at ffwll.ch>
Date: Tue Jun 30 13:12:44 2009 +0200
Xv overlay: implement GAMMA5 errata
- also ensure that the most significant byte is zero
- while I was looking at the code, add the Overlay suffix to
SetPortAttribute like in the textured case.
Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
diff --git a/src/i830_video.c b/src/i830_video.c
index 9e70d89..f8bd4a2 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -92,7 +92,7 @@ static void I830InitOffscreenImages(ScreenPtr);
static XF86VideoAdaptorPtr I830SetupImageVideoOverlay(ScreenPtr);
static XF86VideoAdaptorPtr I830SetupImageVideoTextured(ScreenPtr);
static void I830StopVideo(ScrnInfoPtr, pointer, Bool);
-static int I830SetPortAttribute(ScrnInfoPtr, Atom, INT32, pointer);
+static int I830SetPortAttributeOverlay(ScrnInfoPtr, Atom, INT32, pointer);
static int I830SetPortAttributeTextured(ScrnInfoPtr, Atom, INT32, pointer);
static int I830GetPortAttribute(ScrnInfoPtr, Atom, INT32 *, pointer);
static void I830QueryBestSize(ScrnInfoPtr, Bool,
@@ -782,12 +782,26 @@ static uint32_t I830BoundGammaElt (uint32_t elt, uint32_t eltPrev)
static uint32_t I830BoundGamma (uint32_t gamma, uint32_t gammaPrev)
{
- return (I830BoundGammaElt (gamma >> 24, gammaPrev >> 24) << 24 |
- I830BoundGammaElt (gamma >> 16, gammaPrev >> 16) << 16 |
+ return (I830BoundGammaElt (gamma >> 16, gammaPrev >> 16) << 16 |
I830BoundGammaElt (gamma >> 8, gammaPrev >> 8) << 8 |
I830BoundGammaElt (gamma , gammaPrev ));
}
+static uint32_t I830Gamma5Errata(uint32_t gamma)
+{
+ int i;
+
+ for (i = 0; i < 3; i++) {
+ if ((gamma >> i*8 & 0xff) == 0x80) {
+ /* According to Intel docs, overlay fails if GAMMA5 is 0x80.
+ * In this case, change the value to 0x81 */
+ gamma += 1 << i*8;
+ }
+ }
+
+ return gamma;
+}
+
static void
I830UpdateGamma(ScrnInfoPtr pScrn)
{
@@ -809,6 +823,7 @@ I830UpdateGamma(ScrnInfoPtr pScrn)
gamma3 = I830BoundGamma (gamma3, gamma2);
gamma4 = I830BoundGamma (gamma4, gamma3);
gamma5 = I830BoundGamma (gamma5, gamma4);
+ gamma5 = I830Gamma5Errata(gamma5);
#if 0
ErrorF ("Bounded gamma: 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx\n",
gamma0, gamma1, gamma2, gamma3, gamma4, gamma5);
@@ -877,7 +892,7 @@ I830SetupImageVideoOverlay(ScreenPtr pScreen)
adapt->GetVideo = NULL;
adapt->GetStill = NULL;
adapt->StopVideo = I830StopVideo;
- adapt->SetPortAttribute = I830SetPortAttribute;
+ adapt->SetPortAttribute = I830SetPortAttributeOverlay;
adapt->GetPortAttribute = I830GetPortAttribute;
adapt->QueryBestSize = I830QueryBestSize;
adapt->PutImage = I830PutImage;
@@ -1083,7 +1098,7 @@ I830SetPortAttributeTextured(ScrnInfoPtr pScrn,
}
static int
-I830SetPortAttribute(ScrnInfoPtr pScrn,
+I830SetPortAttributeOverlay(ScrnInfoPtr pScrn,
Atom attribute, INT32 value, pointer data)
{
I830PortPrivPtr pPriv = (I830PortPrivPtr) data;
@@ -2775,7 +2790,7 @@ I830GetSurfaceAttribute(ScrnInfoPtr pScrn, Atom attribute, INT32 * value)
static int
I830SetSurfaceAttribute(ScrnInfoPtr pScrn, Atom attribute, INT32 value)
{
- return I830SetPortAttribute(pScrn, attribute, value, NULL);
+ return I830SetPortAttributeOverlay(pScrn, attribute, value, NULL);
}
static int
commit 5ef4d3cde1335350d82469ebbaed1b547a59552c
Author: Daniel Vetter <daniel.vetter at ffwll.ch>
Date: Tue Jun 30 13:12:43 2009 +0200
Xv: kill unneeded indirection
overlay and textured video have the exact same QueryImageAttributes
function.
Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
diff --git a/src/i830_video.c b/src/i830_video.c
index d543cc4..9e70d89 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -101,10 +101,8 @@ static void I830QueryBestSize(ScrnInfoPtr, Bool,
static int I830PutImage(ScrnInfoPtr, short, short, short, short, short, short,
short, short, int, unsigned char *, short, short,
Bool, RegionPtr, pointer, DrawablePtr);
-static int I830QueryImageAttributesOverlay(ScrnInfoPtr, int, unsigned short *,
+static int I830QueryImageAttributes(ScrnInfoPtr, int, unsigned short *,
unsigned short *, int *, int *);
-static int I830QueryImageAttributesTextured(ScrnInfoPtr, int, unsigned short *,
- unsigned short *, int *, int *);
#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
@@ -883,7 +881,7 @@ I830SetupImageVideoOverlay(ScreenPtr pScreen)
adapt->GetPortAttribute = I830GetPortAttribute;
adapt->QueryBestSize = I830QueryBestSize;
adapt->PutImage = I830PutImage;
- adapt->QueryImageAttributes = I830QueryImageAttributesOverlay;
+ adapt->QueryImageAttributes = I830QueryImageAttributes;
pPriv->textured = FALSE;
pPriv->colorKey = pI830->colorKey & ((1 << pScrn->depth) - 1);
@@ -999,7 +997,7 @@ I830SetupImageVideoTextured(ScreenPtr pScreen)
adapt->GetPortAttribute = I830GetPortAttribute;
adapt->QueryBestSize = I830QueryBestSize;
adapt->PutImage = I830PutImage;
- adapt->QueryImageAttributes = I830QueryImageAttributesTextured;
+ adapt->QueryImageAttributes = I830QueryImageAttributes;
for (i = 0; i < nports; i++) {
I830PortPrivPtr pPriv = &portPrivs[i];
@@ -2554,7 +2552,7 @@ static int
I830QueryImageAttributes(ScrnInfoPtr pScrn,
int id,
unsigned short *w, unsigned short *h,
- int *pitches, int *offsets, Bool textured)
+ int *pitches, int *offsets)
{
I830Ptr pI830 = I830PTR(pScrn);
int size, tmp;
@@ -2635,24 +2633,6 @@ I830QueryImageAttributes(ScrnInfoPtr pScrn,
return size;
}
-static int
-I830QueryImageAttributesOverlay(ScrnInfoPtr pScrn,
- int id,
- unsigned short *w, unsigned short *h,
- int *pitches, int *offsets)
-{
- return I830QueryImageAttributes(pScrn, id, w, h, pitches, offsets, FALSE);
-}
-
-static int
-I830QueryImageAttributesTextured(ScrnInfoPtr pScrn,
- int id,
- unsigned short *w, unsigned short *h,
- int *pitches, int *offsets)
-{
- return I830QueryImageAttributes(pScrn, id, w, h, pitches, offsets, TRUE);
-}
-
void
I830VideoBlockHandler(int i, pointer blockData, pointer pTimeout,
pointer pReadmask)
More information about the xorg-commit
mailing list