summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHong Liu <hong.liu@intel.com>2007-09-20 11:28:52 +0800
committerZhenyu Wang <zhenyu.z.wang@intel.com>2007-09-20 11:28:52 +0800
commitb73235f40497cfb10792ba191d4f6eac3a5df009 (patch)
treeb4f122a0315d0852d96a632f889f7d2231254919
parentbda3c69a7a044869ea63514b97f8aa9260d6b5a7 (diff)
Fix pixmap offset
Use consistent interface for counting pixmap offset.
-rw-r--r--src/i830_exa.c4
-rw-r--r--src/i830_video.c7
-rw-r--r--src/i915_video.c4
-rw-r--r--src/i965_video.c5
4 files changed, 9 insertions, 11 deletions
diff --git a/src/i830_exa.c b/src/i830_exa.c
index 273c6260..88503829 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -112,9 +112,7 @@ i830_pixmap_tiled(PixmapPtr pPixmap)
I830Ptr pI830 = I830PTR(pScrn);
unsigned long offset;
- /* Don't use exaGetPixmapOffset becuase we might be called from XAA code. */
- offset = (long)pPixmap->devPrivate.ptr -
- (long)pI830->FbBase;
+ offset = intel_get_pixmap_offset(pPixmap);
if (offset == pI830->front_buffer->offset &&
pI830->front_buffer->tiling != TILE_NONE)
{
diff --git a/src/i830_video.c b/src/i830_video.c
index 2128eb88..beec03ea 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -2402,9 +2402,10 @@ I830PutImage(ScrnInfoPtr pScrn,
}
#endif
- if (((char *)pPixmap->devPrivate.ptr < (char *)pI830->FbBase) ||
- ((char *)pPixmap->devPrivate.ptr >= (char *)pI830->FbBase +
- pI830->FbMapSize)) {
+ if (!pI830->useEXA &&
+ (((char *)pPixmap->devPrivate.ptr < (char *)pI830->FbBase) ||
+ ((char *)pPixmap->devPrivate.ptr >= (char *)pI830->FbBase +
+ pI830->FbMapSize))) {
/* If the pixmap wasn't in framebuffer, then we have no way in XAA to
* force it there. So, we simply refuse to draw and fail.
*/
diff --git a/src/i915_video.c b/src/i915_video.c
index a6447b1c..00494a7b 100644
--- a/src/i915_video.c
+++ b/src/i915_video.c
@@ -127,8 +127,8 @@ I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
/* front buffer, pitch, offset */
OUT_RING(_3DSTATE_BUF_INFO_CMD);
OUT_RING(BUF_3D_ID_COLOR_BACK | BUF_3D_USE_FENCE |
- BUF_3D_PITCH(pPixmap->devKind));
- OUT_RING(BUF_3D_ADDR((long)pPixmap->devPrivate.ptr - (long)pI830->FbBase));
+ BUF_3D_PITCH(intel_get_pixmap_pitch(pPixmap)));
+ OUT_RING(BUF_3D_ADDR(intel_get_pixmap_offset(pPixmap)));
ADVANCE_LP_RING();
if (!planar) {
diff --git a/src/i965_video.c b/src/i965_video.c
index 6ed7f01a..03572703 100644
--- a/src/i965_video.c
+++ b/src/i965_video.c
@@ -371,13 +371,12 @@ I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
dest_surf_state->ss0.mipmap_layout_mode = 0;
dest_surf_state->ss0.render_cache_read_mode = 0;
- dest_surf_state->ss1.base_addr = (long)pPixmap->devPrivate.ptr -
- (long)pI830->FbBase;
+ dest_surf_state->ss1.base_addr = intel_get_pixmap_offset(pPixmap);
dest_surf_state->ss2.height = pScrn->virtualY - 1;
dest_surf_state->ss2.width = pScrn->virtualX - 1;
dest_surf_state->ss2.mip_count = 0;
dest_surf_state->ss2.render_target_rotation = 0;
- dest_surf_state->ss3.pitch = pPixmap->devKind - 1;
+ dest_surf_state->ss3.pitch = intel_get_pixmap_pitch(pPixmap) - 1;
dest_surf_state->ss3.tiled_surface = i830_pixmap_tiled(pPixmap);
dest_surf_state->ss3.tile_walk = 0; /* TileX */