summaryrefslogtreecommitdiff
path: root/glamor
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@linux.intel.com>2011-12-11 02:26:15 +0800
committerEric Anholt <eric@anholt.net>2013-12-18 11:23:46 -0800
commit92fd83872f5509a2792338b4665dc2b3e1ed68cd (patch)
tree3255e5dac7185ad69259892f6b534e5799b13da9 /glamor
parentd135e879a6c8698bf21ae44a02315f370b961b14 (diff)
Remove the access mode from private pixmap structure.
Change the finish_access to pass in the access mode, and remove the access mode from the pixmap structure. This element should not be a pixmap's property. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'glamor')
-rw-r--r--glamor/glamor_copyarea.c4
-rw-r--r--glamor/glamor_core.c19
-rw-r--r--glamor/glamor_fill.c2
-rw-r--r--glamor/glamor_fillspans.c2
-rw-r--r--glamor/glamor_getspans.c2
-rw-r--r--glamor/glamor_picture.c4
-rw-r--r--glamor/glamor_polyfillrect.c2
-rw-r--r--glamor/glamor_polylines.c2
-rw-r--r--glamor/glamor_priv.h6
-rw-r--r--glamor/glamor_putimage.c4
-rw-r--r--glamor/glamor_render.c6
-rw-r--r--glamor/glamor_setspans.c2
-rw-r--r--glamor/glamor_triangles.c4
13 files changed, 29 insertions, 30 deletions
diff --git a/glamor/glamor_copyarea.c b/glamor/glamor_copyarea.c
index 38254d6fc..98da98a11 100644
--- a/glamor/glamor_copyarea.c
+++ b/glamor/glamor_copyarea.c
@@ -422,9 +422,9 @@ _glamor_copy_n_to_n(DrawablePtr src,
dx, dy, reverse, upsidedown, bitplane,
closure);
if (dst != src)
- glamor_finish_access(src);
+ glamor_finish_access(src, GLAMOR_ACCESS_RO);
}
- glamor_finish_access(dst);
+ glamor_finish_access(dst, GLAMOR_ACCESS_RW);
}
done:
diff --git a/glamor/glamor_core.c b/glamor/glamor_core.c
index 4c58022a8..54e110a37 100644
--- a/glamor/glamor_core.c
+++ b/glamor/glamor_core.c
@@ -255,7 +255,7 @@ glamor_init_finish_access_shaders(ScreenPtr screen)
}
void
-glamor_finish_access(DrawablePtr drawable)
+glamor_finish_access(DrawablePtr drawable, glamor_access_t access_mode)
{
PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable);
glamor_pixmap_private *pixmap_priv =
@@ -267,7 +267,7 @@ glamor_finish_access(DrawablePtr drawable)
if (!pixmap_priv || !GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv))
return;
- if (pixmap_priv->access_mode != GLAMOR_ACCESS_RO) {
+ if (access_mode != GLAMOR_ACCESS_RO) {
glamor_restore_pixmap_to_texture(pixmap);
}
@@ -307,7 +307,8 @@ glamor_prepare_access_gc(GCPtr gc)
GLAMOR_ACCESS_RO)) {
if (gc->stipple)
glamor_finish_access(&gc->
- stipple->drawable);
+ stipple->drawable,
+ GLAMOR_ACCESS_RO);
return FALSE;
}
}
@@ -321,9 +322,9 @@ void
glamor_finish_access_gc(GCPtr gc)
{
if (gc->fillStyle == FillTiled)
- glamor_finish_access(&gc->tile.pixmap->drawable);
+ glamor_finish_access(&gc->tile.pixmap->drawable, GLAMOR_ACCESS_RO);
if (gc->stipple)
- glamor_finish_access(&gc->stipple->drawable);
+ glamor_finish_access(&gc->stipple->drawable, GLAMOR_ACCESS_RO);
}
Bool
@@ -406,7 +407,7 @@ glamor_validate_gc(GCPtr gc, unsigned long changes, DrawablePtr drawable)
(old_tile,
drawable->bitsPerPixel);
glamor_finish_access
- (&old_tile->drawable);
+ (&old_tile->drawable, GLAMOR_ACCESS_RO);
}
}
if (new_tile) {
@@ -432,7 +433,7 @@ glamor_validate_gc(GCPtr gc, unsigned long changes, DrawablePtr drawable)
GLAMOR_ACCESS_RW)) {
fbPadPixmap(gc->tile.pixmap);
glamor_finish_access
- (&gc->tile.pixmap->drawable);
+ (&gc->tile.pixmap->drawable, GLAMOR_ACCESS_RW);
}
}
}
@@ -449,7 +450,7 @@ glamor_validate_gc(GCPtr gc, unsigned long changes, DrawablePtr drawable)
if (glamor_prepare_access
(&gc->stipple->drawable, GLAMOR_ACCESS_RW)) {
fbValidateGC(gc, changes, drawable);
- glamor_finish_access(&gc->stipple->drawable);
+ glamor_finish_access(&gc->stipple->drawable, GLAMOR_ACCESS_RW);
}
} else {
fbValidateGC(gc, changes, drawable);
@@ -491,7 +492,7 @@ glamor_bitmap_to_region(PixmapPtr pixmap)
if (!glamor_prepare_access(&pixmap->drawable, GLAMOR_ACCESS_RO))
return NULL;
ret = fbPixmapToRegion(pixmap);
- glamor_finish_access(&pixmap->drawable);
+ glamor_finish_access(&pixmap->drawable, GLAMOR_ACCESS_RO);
return ret;
}
diff --git a/glamor/glamor_fill.c b/glamor/glamor_fill.c
index b20ec5e39..10baeb3bf 100644
--- a/glamor/glamor_fill.c
+++ b/glamor/glamor_fill.c
@@ -88,7 +88,7 @@ glamor_fill(DrawablePtr drawable,
fbFill(drawable, gc, x, y, width, height);
glamor_finish_access_gc(gc);
}
- glamor_finish_access(drawable);
+ glamor_finish_access(drawable, GLAMOR_ACCESS_RW);
}
return TRUE;
}
diff --git a/glamor/glamor_fillspans.c b/glamor/glamor_fillspans.c
index 996f0c5e8..bbe098571 100644
--- a/glamor/glamor_fillspans.c
+++ b/glamor/glamor_fillspans.c
@@ -83,7 +83,7 @@ _glamor_fill_spans(DrawablePtr drawable,
sorted);
glamor_finish_access_gc(gc);
}
- glamor_finish_access(drawable);
+ glamor_finish_access(drawable, GLAMOR_ACCESS_RW);
}
return TRUE;
}
diff --git a/glamor/glamor_getspans.c b/glamor/glamor_getspans.c
index dff55ba73..fc0d90b3e 100644
--- a/glamor/glamor_getspans.c
+++ b/glamor/glamor_getspans.c
@@ -101,7 +101,7 @@ glamor_get_spans(DrawablePtr drawable,
glamor_get_drawable_location(drawable));
if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RO)) {
fbGetSpans(drawable, wmax, points, widths, count, dst);
- glamor_finish_access(drawable);
+ glamor_finish_access(drawable, GLAMOR_ACCESS_RO);
}
}
diff --git a/glamor/glamor_picture.c b/glamor/glamor_picture.c
index 68c90eb7a..3b5d56892 100644
--- a/glamor/glamor_picture.c
+++ b/glamor/glamor_picture.c
@@ -33,12 +33,12 @@ glamor_prepare_access_picture(PicturePtr picture, glamor_access_t access)
}
void
-glamor_finish_access_picture(PicturePtr picture)
+glamor_finish_access_picture(PicturePtr picture, glamor_access_t access)
{
if (!picture || !picture->pDrawable)
return;
- glamor_finish_access(picture->pDrawable);
+ glamor_finish_access(picture->pDrawable, access);
}
/*
diff --git a/glamor/glamor_polyfillrect.c b/glamor/glamor_polyfillrect.c
index 44df8a80f..8a691bbb2 100644
--- a/glamor/glamor_polyfillrect.c
+++ b/glamor/glamor_polyfillrect.c
@@ -102,7 +102,7 @@ _glamor_poly_fill_rect(DrawablePtr drawable,
fbPolyFillRect(drawable, gc, nrect, prect);
glamor_finish_access_gc(gc);
}
- glamor_finish_access(drawable);
+ glamor_finish_access(drawable, GLAMOR_ACCESS_RW);
}
return TRUE;
}
diff --git a/glamor/glamor_polylines.c b/glamor/glamor_polylines.c
index 01124bbe0..2bb36c7e6 100644
--- a/glamor/glamor_polylines.c
+++ b/glamor/glamor_polylines.c
@@ -151,7 +151,7 @@ glamor_poly_lines(DrawablePtr drawable, GCPtr gc, int mode, int n,
fbPolyLine(temp_dest, gc, mode, n, points);
glamor_finish_access_gc(gc);
}
- glamor_finish_access(temp_dest);
+ glamor_finish_access(temp_dest, GLAMOR_ACCESS_RW);
}
} else {
/* fb calls mi functions in the lineWidth != 0 case. */
diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h
index 4dfdbc456..1a462e200 100644
--- a/glamor/glamor_priv.h
+++ b/glamor/glamor_priv.h
@@ -226,7 +226,6 @@ typedef union _glamor_pending_op {
* @tex: attached texture.
* @fb: attached fbo.
* @pbo: attached pbo.
- * @access_mode: access mode during the prepare/finish pair.
* @pict_format: the corresponding picture's format.
* #pending_op: currently only support pending filling.
* @container: The corresponding pixmap's pointer.
@@ -240,7 +239,6 @@ typedef struct glamor_pixmap_private {
GLuint tex;
GLuint fb;
GLuint pbo;
- glamor_access_t access_mode;
PictFormatShort pict_format;
glamor_pending_op pending_op;
PixmapPtr container;
@@ -316,7 +314,7 @@ void glamor_copy_window(WindowPtr win, DDXPointRec old_origin,
/* glamor_core.c */
Bool glamor_prepare_access(DrawablePtr drawable, glamor_access_t access);
-void glamor_finish_access(DrawablePtr drawable);
+void glamor_finish_access(DrawablePtr drawable, glamor_access_t access);
Bool glamor_prepare_access_window(WindowPtr window);
void glamor_finish_access_window(WindowPtr window);
Bool glamor_prepare_access_gc(GCPtr gc);
@@ -524,7 +522,7 @@ int glamor_create_picture(PicturePtr picture);
Bool
glamor_prepare_access_picture(PicturePtr picture, glamor_access_t access);
-void glamor_finish_access_picture(PicturePtr picture);
+void glamor_finish_access_picture(PicturePtr picture, glamor_access_t access);
void glamor_destroy_picture(PicturePtr picture);
diff --git a/glamor/glamor_putimage.c b/glamor/glamor_putimage.c
index 989f635da..61018500d 100644
--- a/glamor/glamor_putimage.c
+++ b/glamor/glamor_putimage.c
@@ -234,7 +234,7 @@ glamor_put_image_xybitmap(DrawablePtr drawable, GCPtr gc,
if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW)) {
fbPutImage(drawable, gc, 1, x, y, w, h, left_pad, XYBitmap,
bits);
- glamor_finish_access(drawable);
+ glamor_finish_access(drawable, GLAMOR_ACCESS_RW);
}
}
#endif
@@ -401,7 +401,7 @@ _glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y,
if (glamor_prepare_access(&pixmap->drawable, GLAMOR_ACCESS_RW)) {
fbPutImage(&pixmap->drawable, gc, depth, x, y, w, h,
left_pad, image_format, bits);
- glamor_finish_access(&pixmap->drawable);
+ glamor_finish_access(&pixmap->drawable, GLAMOR_ACCESS_RW);
}
return TRUE;
}
diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index e7e53053c..fa4253283 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -1366,11 +1366,11 @@ _glamor_composite(CARD8 op,
x_mask, y_mask, x_dest,
y_dest, width, height);
if (mask)
- glamor_finish_access_picture(mask);
+ glamor_finish_access_picture(mask, GLAMOR_ACCESS_RO);
}
- glamor_finish_access_picture(source);
+ glamor_finish_access_picture(source, GLAMOR_ACCESS_RO);
}
- glamor_finish_access_picture(dest);
+ glamor_finish_access_picture(dest, GLAMOR_ACCESS_RW);
}
done:
if (temp_src != source)
diff --git a/glamor/glamor_setspans.c b/glamor/glamor_setspans.c
index 61163ce9b..4d6fe9602 100644
--- a/glamor/glamor_setspans.c
+++ b/glamor/glamor_setspans.c
@@ -101,6 +101,6 @@ glamor_set_spans(DrawablePtr drawable, GCPtr gc, char *src,
drawable, glamor_get_drawable_location(drawable));
if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW)) {
fbSetSpans(drawable, gc, src, points, widths, n, sorted);
- glamor_finish_access(drawable);
+ glamor_finish_access(drawable, GLAMOR_ACCESS_RW);
}
}
diff --git a/glamor/glamor_triangles.c b/glamor/glamor_triangles.c
index b7ddd823e..1ea7fd665 100644
--- a/glamor/glamor_triangles.c
+++ b/glamor/glamor_triangles.c
@@ -50,9 +50,9 @@ _glamor_triangles(CARD8 op,
ySrc, ntris, tris);
}
if (pSrc->pDrawable != NULL)
- glamor_finish_access(pSrc->pDrawable);
+ glamor_finish_access(pSrc->pDrawable, GLAMOR_ACCESS_RO);
- glamor_finish_access(pDst->pDrawable);
+ glamor_finish_access(pDst->pDrawable, GLAMOR_ACCESS_RW);
}
return TRUE;
}