<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: "Antonino A. Daplas" &lt;adaplas@hotpop.com&gt;

- use struct fb_pixmap pixmap instead of struct fb_pixmap sprite.  The
  softcursor uses fb_imageblit which also uses pixmap.

- remove/change all references to info-&gt;cursor

Signed-off-by: Antonino Daplas &lt;adaplas@pol.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 25-akpm/drivers/video/softcursor.c |   72 +++++++++++--------------------------
 1 files changed, 23 insertions(+), 49 deletions(-)

diff -puN drivers/video/softcursor.c~fbdev-clean-up-softcursor-implementation drivers/video/softcursor.c
--- 25/drivers/video/softcursor.c~fbdev-clean-up-softcursor-implementation	Wed Oct 20 15:45:02 2004
+++ 25-akpm/drivers/video/softcursor.c	Wed Oct 20 15:45:02 2004
@@ -19,79 +19,53 @@
 
 int soft_cursor(struct fb_info *info, struct fb_cursor *cursor)
 {
-	unsigned int scan_align = info-&gt;sprite.scan_align - 1;
-	unsigned int buf_align = info-&gt;sprite.buf_align - 1;
+	unsigned int scan_align = info-&gt;pixmap.scan_align - 1;
+	unsigned int buf_align = info-&gt;pixmap.buf_align - 1;
 	unsigned int i, size, dsize, s_pitch, d_pitch;
-	struct fb_cursor *cur;
+	struct fb_image *image;
 	u8 *dst, *src;
 
-	if (cursor-&gt;set &amp; FB_CUR_SETSIZE) {
-		info-&gt;cursor.image.height = cursor-&gt;image.height;
-		info-&gt;cursor.image.width = cursor-&gt;image.width;
-	}
-
-	if (cursor-&gt;set &amp; FB_CUR_SETPOS) {
-		info-&gt;cursor.image.dx = cursor-&gt;image.dx;
-		info-&gt;cursor.image.dy = cursor-&gt;image.dy;
-	}
-
-	if (cursor-&gt;set &amp; FB_CUR_SETHOT)
-		info-&gt;cursor.hot = cursor-&gt;hot;
-	
-	if (cursor-&gt;set &amp; FB_CUR_SETCMAP) {
-		if (cursor-&gt;image.depth == 1) {
-			info-&gt;cursor.image.bg_color = cursor-&gt;image.bg_color;
-			info-&gt;cursor.image.fg_color = cursor-&gt;image.fg_color;
-		} else {
-			if (cursor-&gt;image.cmap.len)
-				fb_copy_cmap(&amp;cursor-&gt;image.cmap, &amp;info-&gt;cursor.image.cmap);
-		}
-		info-&gt;cursor.image.depth = cursor-&gt;image.depth;
-	}	
-
-	info-&gt;cursor.image.data = cursor-&gt;image.data;
-
 	if (info-&gt;state != FBINFO_STATE_RUNNING)
 		return 0;
 
-	src = kmalloc(64 + sizeof(struct fb_cursor), GFP_ATOMIC);
+	src = kmalloc(64 + sizeof(struct fb_image), GFP_ATOMIC);
+
 	if (!src)
 		return -ENOMEM;
-	cur = (struct fb_cursor *) (src + 64);
-	*cur = info-&gt;cursor;
 
-	s_pitch = (info-&gt;cursor.image.width + 7) &gt;&gt; 3;
-	dsize = s_pitch * info-&gt;cursor.image.height;
+	image = (struct fb_image *) (src + 64);
+	*image = cursor-&gt;image;
+	s_pitch = (image-&gt;width + 7) &gt;&gt; 3;
+	dsize = s_pitch * image-&gt;height;
 	d_pitch = (s_pitch + scan_align) &amp; ~scan_align;
-	size = d_pitch * info-&gt;cursor.image.height + buf_align;
+	size = d_pitch * image-&gt;height + buf_align;
 	size &amp;= ~buf_align;
-	dst = fb_get_buffer_offset(info, &amp;info-&gt;sprite, size);
+	dst = fb_get_buffer_offset(info, &amp;info-&gt;pixmap, size);
 
-	if (info-&gt;cursor.enable) {
-		switch (info-&gt;cursor.rop) {
+	if (cursor-&gt;enable) {
+		switch (cursor-&gt;rop) {
 		case ROP_XOR:
 			for (i = 0; i &lt; dsize; i++)
-				src[i] = cursor-&gt;image.data[i] ^ info-&gt;cursor.mask[i]; 
+				src[i] = image-&gt;data[i] ^ cursor-&gt;mask[i];
 			break;
 		case ROP_COPY:
 		default:
 			for (i = 0; i &lt; dsize; i++)
-				src[i] = cursor-&gt;image.data[i] &amp; info-&gt;cursor.mask[i];
+				src[i] = image-&gt;data[i] &amp; cursor-&gt;mask[i];
 			break;
 		}
 	} else 
-		memcpy(src, cursor-&gt;image.data, dsize);
+		memcpy(src, image-&gt;data, dsize);
 	
-	if (info-&gt;sprite.outbuf)
-		fb_iomove_buf_aligned(info, &amp;info-&gt;sprite, dst, d_pitch, src,
-				  s_pitch, info-&gt;cursor.image.height);
+	if (info-&gt;pixmap.outbuf)
+		fb_iomove_buf_aligned(info, &amp;info-&gt;pixmap, dst, d_pitch, src,
+				  s_pitch, image-&gt;height);
 	else
-		fb_sysmove_buf_aligned(info, &amp;info-&gt;sprite, dst, d_pitch, src,
-				   s_pitch, info-&gt;cursor.image.height);
-	cur-&gt;image.data = dst;
-	
-	info-&gt;fbops-&gt;fb_imageblit(info, &amp;cur-&gt;image);
+		fb_sysmove_buf_aligned(info, &amp;info-&gt;pixmap, dst, d_pitch, src,
+				   s_pitch, image-&gt;height);
 
+	image-&gt;data = dst;
+	info-&gt;fbops-&gt;fb_imageblit(info, image);
 	kfree(src);
 
 	return 0;
_
</pre></body></html>