PATCH: move soft_cursor into fbconsole
Subsystems (3)
James has indicated that the soft_cursor only works with fbconsole and it won't work from user space. This means that soft_cursor is in the way of using a hardware cursor from user space. This patch removes soft_cursor from all of the drivers. So if the driver doesn't support a hardware cursor fb_cursor is NULL.
I also fixed the three drivers with hardware implementation. These drivers had cases where the hardware cursor had an error and then returned the software one instead. Now they return -ENODEV when they can't use the hardware one.
In console/bitlbt.c I made this change:
/* First try the hardware cursor */ if (info->fbops->fb_cursor) err = info->fbops->fb_cursor(info, &cursor); /* if that doesn't exist or didn't work, use the software one */ if (err) soft_cursor(info, &cursor);
The effect of all of this is the make a clear path for getting to hardware cursors without triggering the soft_cursor fallback. Triggering of the fallback was moved into fb_console. This also lets me remove the softcursor module from memory when fb_console is not loaded.
Give this a try and let me know what you think.
Signature · 2 lines
Jon Smirl [email protected]
Ug no. I see in the future more drivers using hardware cursors instead. We would be carry around extra software cursor code in the the framebuffer console all the time. We need to properly fix the cursor code. Unfortunely that will take more work. In the mean time please encourage people to support hardware cursors. Even crappy cards have hardware cursors most of the time.
Quoted 19 lines · Jon Smirl
James has indicated that the
soft_cursoronly works with fbconsole and it won't work from user space. This means thatsoft_cursoris in the way of using a hardware cursor from user space. This patch removessoft_cursorfrom all of the drivers. So if the driver doesn't support a hardware cursorfb_cursoris NULL.I also fixed the three drivers with hardware implementation. These drivers had cases where the hardware cursor had an error and then returned the software one instead. Now they return
-ENODEVwhen they can't use the hardware one.In
console/bitlbt.cI made this change:/* First try the hardware cursor */ if (info->fbops->fb_cursor) err = info->fbops->fb_cursor(info, &cursor); /* if that doesn't exist or didn't work, use the software one */ if (err) soft_cursor(info, &cursor);
Quoted 12 lines
The effect of all of this is the make a clear path for getting to hardware cursors without triggering the
soft_cursorfallback. Triggering of the fallback was moved intofb_console. This also lets me remove the softcursor module from memory whenfb_consoleis not loaded.Give this a try and let me know what you think.
Signature · 2 lines
Jon Smirl [email protected]
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
Quoted 7 lines · James Simmons
Ug no. I see in the future more drivers using hardware cursors instead. We would be carry around extra software cursor code in the the framebuffer console all the time. We need to properly fix the cursor code. Unfortunely that will take more work. In the mean time please encourage people to support hardware cursors. Even crappy cards have hardware cursors most of the time.
The way things are now I can't use the hardware cursors without triggering the software one. The way I changed it user space (when the interface is finished) will get hardware or nothing. fbconsole will get the same hardware or nothing, but if nothing it implements a software cursor.
The question here is who is responsible for generating a software cursor, is it the hardware driver's responsibility or the app using the system? fbconsole would be considered an app using the system.
Signature · 9 lines
Jon Smirl [email protected] ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r
Quoted 7 lines · James Simmons
Ug no. I see in the future more drivers using hardware cursors instead. We would be carry around extra software cursor code in the the framebuffer console all the time. We need to properly fix the cursor code. Unfortunely that will take more work. In the mean time please encourage people to support hardware cursors. Even crappy cards have hardware cursors most of the time.
Also, I didn't delete the fb_cursor field. I just removed all of the assignments of .fb_cursor = soft_cursor. The field is still there and defaulting to null, except in the three drivers with hardware cursors where it is set.
For a driver to implement software cursors it has to know the location of the scanout buffer, scanbuffer format, etc. I not sure if all of this is always know for user space apps. The hardware cursor doesn't need as much info about the framebuffer.
Signature · 9 lines
Jon Smirl [email protected] ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r
Quoted 19 lines · Jon Smirl
James has indicated that the
soft_cursoronly works with fbconsole and it won't work from user space. This means thatsoft_cursoris in the way of using a hardware cursor from user space. This patch removessoft_cursorfrom all of the drivers. So if the driver doesn't support a hardware cursorfb_cursoris NULL.I also fixed the three drivers with hardware implementation. These drivers had cases where the hardware cursor had an error and then returned the software one instead. Now they return
-ENODEVwhen they can't use the hardware one.In
console/bitlbt.cI made this change:/* First try the hardware cursor */ if (info->fbops->fb_cursor) err = info->fbops->fb_cursor(info, &cursor); /* if that doesn't exist or didn't work, use the software one */ if (err) soft_cursor(info, &cursor);
Quoted 7 lines
The effect of all of this is the make a clear path for getting to hardware cursors without triggering the
soft_cursorfallback. Triggering of the fallback was moved intofb_console. This also lets me remove the softcursor module from memory whenfb_consoleis not loaded.Give this a try and let me know what you think.
This patch corrupts some comments in drivers/video/amifb.c.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
Quoted 1 line · Geert Uytterhoeven
This patch corrupts some comments in
drivers/video/amifb.c.
This should fix it. I touched up a few other places with unintended changes. I don't think all of the fbdev files have been authored using the same codepage.
Signature · 2 lines
Jon Smirl [email protected]
drivers/video/68328fb.c +0 -1
@@ -113,7 +113,6 @@ static struct fb_ops mc68x328fb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, .fb_mmap = mc68x328fb_mmap, };
drivers/video/acornfb.c +0 -1
@@ -926,7 +926,6 @@ static struct fb_ops acornfb_ops = { .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, .fb_mmap = acornfb_mmap, - .fb_cursor = soft_cursor, };/*
drivers/video/amba-clcd.c +0 -1
@@ -332,7 +332,6 @@ static struct fb_ops clcdfb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, .fb_mmap = clcdfb_mmap, };
drivers/video/amifb.c +0 -1
@@ -1185,7 +1185,6 @@ static struct fb_ops amifb_ops = { .fb_fillrect = amifb_fillrect, .fb_copyarea = amifb_copyarea, .fb_imageblit = amifb_imageblit, - .fb_cursor = soft_cursor, .fb_ioctl = amifb_ioctl, };
drivers/video/asiliantfb.c +0 -1
@@ -106,7 +106,6 @@ static struct fb_ops asiliantfb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, };/* Calculate the ratios for the dot clocks without using a single long long
drivers/video/aty/aty128fb.c +0 -1
@@ -480,7 +480,6 @@ static struct fb_ops aty128fb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, };#ifdef CONFIG_PMAC_BACKLIGHT
drivers/video/aty/atyfb_base.c +0 -1
@@ -292,7 +292,6 @@ static struct fb_ops atyfb_ops = { .fb_fillrect = atyfb_fillrect, .fb_copyarea = atyfb_copyarea, .fb_imageblit = atyfb_imageblit, - .fb_cursor = soft_cursor,#ifdef __sparc__ .fb_mmap = atyfb_mmap,#endif
drivers/video/aty/radeon_base.c +0 -1
@@ -1873,7 +1873,6 @@ static struct fb_ops radeonfb_ops = { .fb_fillrect = radeonfb_fillrect, .fb_copyarea = radeonfb_copyarea, .fb_imageblit = radeonfb_imageblit, - .fb_cursor = soft_cursor, };
drivers/video/bw2.c +0 -1
@@ -51,7 +51,6 @@ static struct fb_ops bw2_ops = { .fb_imageblit = cfb_imageblit, .fb_mmap = bw2_mmap, .fb_ioctl = bw2_ioctl, - .fb_cursor = soft_cursor, };/* OBio addresses for the bwtwo registers */
drivers/video/cg14.c +0 -1
@@ -49,7 +49,6 @@ static struct fb_ops cg14_ops = { .fb_imageblit = cfb_imageblit, .fb_mmap = cg14_mmap, .fb_ioctl = cg14_ioctl, - .fb_cursor = soft_cursor, };#define CG14_MCR_INTENABLE_SHIFT 7
drivers/video/cg3.c +0 -1
@@ -50,7 +50,6 @@ static struct fb_ops cg3_ops = { .fb_imageblit = cfb_imageblit, .fb_mmap = cg3_mmap, .fb_ioctl = cg3_ioctl, - .fb_cursor = soft_cursor, };
drivers/video/cg6.c +0 -1
@@ -54,7 +54,6 @@ static struct fb_ops cg6_ops = { .fb_sync = cg6_sync, .fb_mmap = cg6_mmap, .fb_ioctl = cg6_ioctl, - .fb_cursor = soft_cursor, };/* Offset of interesting structures in the OBIO space */
drivers/video/chipsfb.c +0 -1
@@ -104,7 +104,6 @@ static struct fb_ops chipsfb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, }; static int chipsfb_check_var(struct fb_var_screeninfo *var,
drivers/video/cirrusfb.c +0 -1
@@ -548,7 +548,6 @@ static struct fb_ops cirrusfb_ops = { .fb_fillrect = cirrusfb_fillrect, .fb_copyarea = cirrusfb_copyarea, .fb_imageblit = cirrusfb_imageblit, - .fb_cursor = soft_cursor, };/*--- Hardware Specific Routines -------------------------------------------*/
drivers/video/clps711xfb.c +0 -1
@@ -219,7 +219,6 @@ static struct fb_ops clps7111fb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, }; static int
drivers/video/console/bitblit.c +7 -1
@@ -248,6 +248,7 @@ static void bit_cursor(struct vc_data *vint y =real_y (p, vc->vc_y);int attribute, use_sw = (vc->vc_cursor_type &0x10 );char *src; +int err = -ENODEV ; cursor.set =0 ;
@@ -383,7 +384,12 @@ static void bit_cursor(struct vc_data *v cursor.image.depth =1 ; cursor.rop =ROP_XOR ; - info->fbops->fb_cursor (info, &cursor); +/* First try the hardware cursor */ +if (info->fbops->fb_cursor) + err = info->fbops->fb_cursor (info, &cursor); +/* if that doesn't exist or didn't work, use the software one */ +if (err) +soft_cursor (info, &cursor); ops->cursor_reset =0 ; }
drivers/video/controlfb.c +0 -1
@@ -176,7 +176,6 @@ static struct fb_ops controlfb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, };
drivers/video/cyber2000fb.c +0 -1
@@ -1064,7 +1064,6 @@ static struct fb_ops cyber2000fb_ops = { .fb_fillrect = cyber2000fb_fillrect, .fb_copyarea = cyber2000fb_copyarea, .fb_imageblit = cyber2000fb_imageblit, - .fb_cursor = soft_cursor, .fb_sync = cyber2000fb_sync, };
drivers/video/dnfb.c +0 -1
@@ -114,7 +114,6 @@ static struct fb_ops dn_fb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = dnfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, };struct fb_var_screeninfo dnfb_var__devinitdata = {
drivers/video/epson1355fb.c +0 -1
@@ -482,7 +482,6 @@ static struct fb_ops epson1355fb_fbops = .fb_imageblit = cfb_imageblit, .fb_read = epson1355fb_read, .fb_write = epson1355fb_write, - .fb_cursor = soft_cursor, };/* ------------------------------------------------------------------------- */
drivers/video/ffb.c +0 -1
@@ -59,7 +59,6 @@ static struct fb_ops ffb_ops = { .fb_ioctl = ffb_ioctl,/* XXX Use FFB hw cursor once fb cursor API is better understood... */ - .fb_cursor = soft_cursor, };/* Register layout and definitions */
drivers/video/fm2fb.c +0 -1
@@ -172,7 +172,6 @@ static struct fb_ops fm2fb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, };/*
drivers/video/gbefb.c +0 -1
@@ -1038,7 +1038,6 @@ static struct fb_ops gbefb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, };/*
drivers/video/geode/gx1fb_core.c +0 -1
@@ -213,7 +213,6 @@ static struct fb_ops gx1fb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, };static struct fb_info *__init gx1fb_init_fbinfo (void )
drivers/video/hitfb.c +0 -1
@@ -262,7 +262,6 @@ static struct fb_ops hitfb_ops = { .fb_fillrect = hitfb_fillrect, .fb_copyarea = hitfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, };int __init hitfb_init (void )
drivers/video/hpfb.c +0 -1
@@ -193,7 +193,6 @@ static struct fb_ops hpfb_ops = { .fb_fillrect = hpfb_fillrect, .fb_copyarea = hpfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, .fb_sync = hpfb_sync, };
drivers/video/i810/i810_main.c +1 -1
@@ -1420,7 +1420,7 @@ static int i810fb_cursor(struct fb_infoif (!(par->dev_flags &USE_HWCUR ) || !info->var.accel_flags || par->dev_flags &LOCKUP ) -return soft_cursor (info, cursor); +return -ENODEV ;if (cursor->image.width >64 || cursor->image.height >64 )return -ENXIO ;
drivers/video/imsttfb.c +0 -1
@@ -1344,7 +1344,6 @@ static struct fb_ops imsttfb_ops = { .fb_fillrect = imsttfb_fillrect, .fb_copyarea = imsttfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, .fb_ioctl = imsttfb_ioctl, };
drivers/video/imxfb.c +1 -1
@@ -302,7 +302,7 @@ static struct fb_ops imxfb_ops = { .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, .fb_blank = imxfb_blank, - .fb_cursor = soft_cursor, /* FIXME: i.MX can do hardware cursor */ +/* FIXME: i.MX can do hardware cursor */ };/*
drivers/video/intelfb/intelfbdrv.c +1 -1
@@ -1486,7 +1486,7 @@ intelfb_cursor(struct fb_info *info, str#endif if (!dinfo->hwcursor) -return soft_cursor (info, cursor); +return -ENODEV ;intelfbhw_cursor_hide (dinfo);
drivers/video/kyro/fbdev.c +0 -1
@@ -669,7 +669,6 @@ static struct fb_ops kyrofb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, }; static int __devinit kyrofb_probe(struct pci_dev *pdev,
drivers/video/leo.c +0 -1
@@ -51,7 +51,6 @@ static struct fb_ops leo_ops = { .fb_imageblit = cfb_imageblit, .fb_mmap = leo_mmap, .fb_ioctl = leo_ioctl, - .fb_cursor = soft_cursor, };#define LEO_OFF_LC_SS0_KRN 0x00200000UL
drivers/video/macfb.c +0 -1
@@ -589,7 +589,6 @@ static struct fb_ops macfb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, };void __init macfb_setup (char *options)
drivers/video/matrox/matroxfb_accel.c +0 -1
@@ -122,7 +122,6 @@ void matrox_cfbX_init(WPMINFO2) {ACCESS_FBINFO (fbops).fb_copyarea = cfb_copyarea;ACCESS_FBINFO (fbops).fb_fillrect = cfb_fillrect;ACCESS_FBINFO (fbops).fb_imageblit = cfb_imageblit; -ACCESS_FBINFO (fbops).fb_cursor = soft_cursor; accel = (ACCESS_FBINFO (fbcon).var.accel_flags &FB_ACCELF_TEXT ) ==FB_ACCELF_TEXT ;
drivers/video/matrox/matroxfb_crtc2.c +0 -1
@@ -576,7 +576,6 @@ static struct fb_ops matroxfb_dh_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, };static struct fb_var_screeninfo matroxfb_dh_defined = {
drivers/video/maxinefb.c +0 -1
@@ -113,7 +113,6 @@ static struct fb_ops maxinefb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, };int __init maxinefb_init (void )
drivers/video/neofb.c +0 -1
@@ -1665,7 +1665,6 @@ static struct fb_ops neofb_ops = { .fb_fillrect = neofb_fillrect, .fb_copyarea = neofb_copyarea, .fb_imageblit = neofb_imageblit, - .fb_cursor = soft_cursor, };/* --------------------------------------------------------------------- */
drivers/video/nvidia/nvidia.c +1 -3
@@ -894,7 +894,7 @@ static int nvidiafb_cursor(struct fb_infint i, set = cursor->set;if (cursor->image.width >MAX_CURS || cursor->image.height >MAX_CURS ) -return soft_cursor (info, cursor); +return -ENODEV ;NVShowHideCursor (par,0 );
@@ -1351,8 +1351,6 @@ static int __devinit nvidia_set_fbinfo(s info->pixmap.size =8 *1024 ; info->pixmap.flags =FB_PIXMAP_SYSTEM ; -if (!hwcur) - info->fbops->fb_cursor = soft_cursor; info->var.accel_flags = (!noaccel);switch (par->Architecture) {
drivers/video/offb.c +0 -1
@@ -85,7 +85,6 @@ static struct fb_ops offb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, };/*
drivers/video/p9100.c +0 -1
@@ -48,7 +48,6 @@ static struct fb_ops p9100_ops = { .fb_imageblit = cfb_imageblit, .fb_mmap = p9100_mmap, .fb_ioctl = p9100_ioctl, - .fb_cursor = soft_cursor, };/* P9100 control registers */
drivers/video/platinumfb.c +0 -1
@@ -109,7 +109,6 @@ static struct fb_ops platinumfb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, };/*
drivers/video/pm2fb.c +0 -1
@@ -1034,7 +1034,6 @@ static struct fb_ops pm2fb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, };/*
drivers/video/pmag-ba-fb.c +0 -1
@@ -117,7 +117,6 @@ static struct fb_ops pmagbafb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, };int __init pmagbafb_init_one (int slot)
drivers/video/pmagb-b-fb.c +1 -2
@@ -118,8 +118,7 @@ static struct fb_ops pmagbbfb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, -}; +;int __init pmagbbfb_init_one (int slot) {
drivers/video/pvr2fb.c +0 -1
@@ -230,7 +230,6 @@ static struct fb_ops pvr2fb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, };static struct fb_videomode pvr2_modedb[]__initdata = {
drivers/video/pxafb.c +0 -1
@@ -417,7 +417,6 @@ static struct fb_ops pxafb_ops = { .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, .fb_blank = pxafb_blank, - .fb_cursor = soft_cursor, .fb_mmap = pxafb_mmap, };
drivers/video/q40fb.c +0 -1
@@ -84,7 +84,6 @@ static struct fb_ops q40fb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, };static int __init q40fb_probe (struct device *device)
drivers/video/radeonfb.c +0 -1
@@ -2218,7 +2218,6 @@ static struct fb_ops radeonfb_ops = { .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit,#endif - .fb_cursor = soft_cursor, };
drivers/video/riva/fbdev.c +1 -1
@@ -1587,7 +1587,7 @@ static int rivafb_cursor(struct fb_infoif (cursor->image.width >MAX_CURS || cursor->image.height >MAX_CURS ) -return soft_cursor (info, cursor); +return -ENODEV ; par->riva.ShowHideCursor (&par->riva,0 );
drivers/video/s1d13xxxfb.c +0 -1
@@ -378,7 +378,6 @@ static struct fb_ops s1d13xxxfb_fbops = .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor };static int s1d13xxxfb_width_tab[2 ][4 ]__devinitdata = {
drivers/video/sa1100fb.c +0 -1
@@ -851,7 +851,6 @@ static struct fb_ops sa1100fb_ops = { .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, .fb_blank = sa1100fb_blank, - .fb_cursor = soft_cursor, .fb_mmap = sa1100fb_mmap, };
drivers/video/savage/savagefb_driver.c +0 -1
@@ -1417,7 +1417,6 @@ static struct fb_ops savagefb_ops = { .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit,#endif - .fb_cursor = soft_cursor, };/* --------------------------------------------------------------------- */
drivers/video/sgivwfb.c +0 -1
@@ -124,7 +124,6 @@ static struct fb_ops sgivwfb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, .fb_mmap = sgivwfb_mmap, };
drivers/video/sis/sis_main.c +0 -1
@@ -2269,7 +2269,6 @@ static struct fb_ops sisfb_ops = { .fb_fillrect = fbcon_sis_fillrect, .fb_copyarea = fbcon_sis_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, .fb_sync = fbcon_sis_sync, .fb_ioctl = sisfb_ioctl,#ifdef CONFIG_COMPAT
drivers/video/sstfb.c +0 -1
@@ -1382,7 +1382,6 @@ static struct fb_ops sstfb_ops = { .fb_fillrect = cfb_fillrect, /* sstfb_fillrect */ .fb_copyarea = cfb_copyarea, /* sstfb_copyarea */ .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, .fb_ioctl = sstfb_ioctl, };
drivers/video/stifb.c +0 -1
@@ -1147,7 +1147,6 @@ static struct fb_ops stifb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, };
drivers/video/tcx.c +0 -1
@@ -52,7 +52,6 @@ static struct fb_ops tcx_ops = { .fb_imageblit = cfb_imageblit, .fb_mmap = tcx_mmap, .fb_ioctl = tcx_ioctl, - .fb_cursor = soft_cursor, };/* THC definitions */
drivers/video/tdfxfb.c +0 -1
@@ -184,7 +184,6 @@ static struct fb_ops tdfxfb_ops = { .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit,#endif - .fb_cursor = soft_cursor, };/*
drivers/video/tgafb.c +0 -1
@@ -63,7 +63,6 @@ static struct fb_ops tgafb_ops = { .fb_fillrect = tgafb_fillrect, .fb_copyarea = tgafb_copyarea, .fb_imageblit = tgafb_imageblit, - .fb_cursor = soft_cursor, };
drivers/video/tridentfb.c +0 -1
@@ -1282,7 +1282,6 @@ static struct fb_ops tridentfb_ops = { .fb_fillrect = tridentfb_fillrect, .fb_copyarea= tridentfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, };module_init (tridentfb_init);
drivers/video/tx3912fb.c +0 -1
@@ -89,7 +89,6 @@ static struct fb_ops tx3912fb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, };static int tx3912fb_check_var (struct fb_var_screeninfo *var,struct fb_info *info)
drivers/video/valkyriefb.c +0 -1
@@ -135,7 +135,6 @@ static struct fb_ops valkyriefb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, };/* Sets the video mode according to info->var */
drivers/video/vesafb.c +0 -1
@@ -179,7 +179,6 @@ static struct fb_ops vesafb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, };static int __init vesafb_setup (char *options)
drivers/video/vfb.c +0 -1
@@ -90,7 +90,6 @@ static struct fb_ops vfb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, .fb_mmap = vfb_mmap, };
drivers/video/vga16fb.c +0 -1
@@ -1326,7 +1326,6 @@ static struct fb_ops vga16fb_ops = { .fb_fillrect = vga16fb_fillrect, .fb_copyarea = vga16fb_copyarea, .fb_imageblit = vga16fb_imageblit, - .fb_cursor = soft_cursor, };#ifndef MODULE
drivers/video/w100fb.c +0 -1
@@ -473,7 +473,6 @@ static struct fb_ops w100fb_ops = { .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, - .fb_cursor = soft_cursor, };
Quoted 4 lines · Jon Smirl
Quoted 1 line · Geert Uytterhoeven
This patch corrupts some comments in
drivers/video/amifb.c.This should fix it. I touched up a few other places with unintended
Thx!
Quoted 2 lines
changes. I don't think all of the fbdev files have been authored using the same codepage.
The original ones were ISO-8859-1 or -15 (anyone who puts EURO-signs in GPLed source code? :-). But these days the preferred encoding is UTF-8.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
Are there still issues with this patch?
Signature · 9 lines
Jon Smirl [email protected] ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
Quoted 1 line · Jon Smirl
Are there still issues with this patch?
Maybe. A few drivers will set the fb_cursor field to either soft_cursor or the driver-specific cursor function, depending on the kernel boot options or setting of the var.accel flag.
The changes required are probably minor.
Tony
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
Quoted 6 lines · Antonino A. Daplas
Quoted 1 line · Jon Smirl
Are there still issues with this patch?
Maybe. A few drivers will set the
fb_cursorfield to eithersoft_cursoror the driver-specific cursor function, depending on the kernel boot options or setting of the var.accel flag.
I think there were three driver implementing hardware cursors. I tried to keep them working, they only needed minor touchups.
If they had fallbacks to the software cursor I removed those and returned an error instead. Instead fbconsole will get the error and switch to software cursor. If HW cursors are going to work from user space they can't contain SW cursor fallbacks.
The patch should move softcursor.c into the fbconsole subdirectory but I can't figure out how to do that with git yet.
Quoted 8 lines
The changes required are probably minor.
Tony
Signature · 9 lines
Jon Smirl [email protected] ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
Quoted 12 lines · Antonino A. Daplas
Quoted 6 lines · Jon Smirl
Quoted 1 line
Are there still issues with this patch?
Maybe. A few drivers will set the
fb_cursorfield to eithersoft_cursoror the driver-specific cursor function, depending on the kernel boot options or setting of the var.accel flag.I think there were three driver implementing hardware cursors. I tried to keep them working, they only needed minor touchups.
Quoted 12 lines
If they had fallbacks to the software cursor I removed those and returned an error instead. Instead fbconsole will get the error and switch to software cursor. If HW cursors are going to work from user space they can't contain SW cursor fallbacks.
The patch should move
softcursor.cinto the fbconsole subdirectory but I can't figure out how to do that with git yet.Quoted 4 lines
The changes required are probably minor.
Tony
I agree we should not fall back to the software cursor when the hardware cursor fails. Do we really want to eliminate the cursor from the device interface if it is not a hardware cursor? Shouldn't the cursor always work? That is the question.
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
Quoted 4 lines · James Simmons
I agree we should not fall back to the software cursor when the hardware cursor fails. Do we really want to eliminate the cursor from the device interface if it is not a hardware cursor? Shouldn't the cursor always work? That is the question.
I don't think there really is a choice here. Fbdev has to implement the hardware cursor. The software one is application specific. fbconsole and X implement it completely differently. I don't think there is a way to implement a general software cursor.
fbdev provides hardware or nothing
if no hardware cursor, cursor is up to app fbconsole and X then provide two different fallback schemes.
For example I don't think we have enough info to implement X's software cursor in the fbdev driver. We would need some way to know when X is updating the screen via paint or buffer swaps. Wouldn't that be a total mess for fbdev to track and a new API would be needed.
We just never noticed the problem before since only one client (fbconsole) was using the cursor. Current X is programming the hardware cursor from user space.
After this change it would probably be cleaner to just eliminate the softcursor module and compile softcursor into fbconsole. softcursor.c would be moved to the fbconsole subdir if you can figure out how to tell git to do a mv. But we can always save these changes for later.
Signature · 9 lines
Jon Smirl [email protected] ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
Quoted 5 lines
For example I don't think we have enough info to implement X's software cursor in the fbdev driver. We would need some way to know when X is updating the screen via paint or buffer swaps. Wouldn't that be a total mess for fbdev to track and a new API would be needed.
I was pondering this and you are right. For the software cursor you
need to blend the cursor image with what data is in the framebuffer at that location. If we have a concurrent thread that updates that area of the framebuffer then we would have to notify the cursor of the change to update that region of the screen with proper data. There is no clean way to do this.
Now I was thinking instead of a massive move of the the software
cursor we add a flag FBINFO_HWACCEL_CURSOR to tell us if we are using a hardware cursor. This way for the sysfs interface you can test to see if it is a hardware cursor and only allow userland to access a hardware cursor. Here is a patch for that. People please try it out.
drivers/video/aty/mach64_cursor.c +1 -1
@@ -219,8 +219,8 @@ info->sprite.buf_align =16 ;/* and 64 lines tall. */ info->sprite.flags =FB_PIXMAP_IO ; + info->flags |=FBINFO_HWACCEL_CURSOR ; info->fbops->fb_cursor = atyfb_cursor; -return 0 ; }
drivers/video/i810/i810_main.c +2 -2
@@ -1375,7 +1375,6 @@decode_var (&info->var, par);i810_load_regs (par);i810_init_cursor (par); -encode_fix (&info->fix, info);if (info->var.accel_flags && !(par->dev_flags &LOCKUP )) {
@@ -1387,6 +1386,7 @@ info->pixmap.scan_align =1 ; info->flags =FBINFO_DEFAULT |FBINFO_HWACCEL_YPAN ; } + info->flags |=FBINFO_HWACCEL_CURSOR ;return 0 ; }
@@ -1420,7 +1420,7 @@if (!(par->dev_flags &USE_HWCUR ) || !info->var.accel_flags || par->dev_flags &LOCKUP ) -return soft_cursor (info, cursor); +return -ENXIO ;if (cursor->image.width >64 || cursor->image.height >64 )return -ENXIO ;
drivers/video/intelfb/intelfbdrv.c +5 -19
@@ -117,14 +117,10 @@#include <linux/slab.h> #include <linux/delay.h> #include <linux/fb.h> -#include <linux/console.h> -#include <linux/selection.h> #include <linux/ioport.h> #include <linux/init.h> #include <linux/pci.h> #include <linux/vmalloc.h> -#include <linux/kd.h> -#include <linux/vt_kern.h> #include <linux/pagemap.h> #include <linux/version.h>
@@ -242,7 +238,7 @@static char *mode =NULL ;module_param (accel, bool,S_IRUGO ); -MODULE_PARM_DESC (accel,"Enable console acceleration" ); +MODULE_PARM_DESC (accel,"Enable hardware acceleration" );module_param (vram, int,S_IRUGO );MODULE_PARM_DESC (vram,"System RAM to allocate to framebuffer in MiB" );module_param (voffset, int,S_IRUGO );
@@ -498,7 +494,7 @@ {struct fb_info *info;struct intelfb_info *dinfo; -int i, j, err, dvo; +int i, err, dvo;int aperture_size, stolen_size;struct agp_kern_info gtt_info;int agp_memtype;
@@ -841,13 +837,6 @@if (bailearly ==5 )bailout (dinfo); -for (i =0 ; i <16 ; i++) { - j = color_table[i]; - dinfo->palette[i].red = default_red[j]; - dinfo->palette[i].green = default_grn[j]; - dinfo->palette[i].blue = default_blu[j]; - } -if (bailearly ==6 )bailout (dinfo);
@@ -1328,9 +1317,10 @@if (ACCEL (dinfo, info)) { info->flags =FBINFO_DEFAULT |FBINFO_HWACCEL_YPAN |FBINFO_HWACCEL_COPYAREA |FBINFO_HWACCEL_FILLRECT | -FBINFO_HWACCEL_IMAGEBLIT ; +FBINFO_HWACCEL_IMAGEBLIT |FBINFO_HWACCEL_CURSOR ; }else { - info->flags =FBINFO_DEFAULT |FBINFO_HWACCEL_YPAN ; + info->flags =FBINFO_DEFAULT |FBINFO_HWACCEL_YPAN | +FBINFO_HWACCEL_CURSOR ; }kfree (hw);return 0 ;
@@ -1359,10 +1349,6 @@ green >>=8 ; blue >>=8 ; - dinfo->palette[regno].red = red; - dinfo->palette[regno].green = green; - dinfo->palette[regno].blue = blue; -intelfbhw_setcolreg (dinfo, regno, red, green, blue, transp); }
drivers/video/intelfb/intelfb.h +0 -1
@@ -234,7 +234,6 @@/* palette */ u32 pseudo_palette[17 ]; -struct {u8 red, green, blue, pad; } palette[256 ];/* chip info */ int pci_chipset;
drivers/video/intelfb/intelfbhw.c +0 -4
@@ -29,14 +29,10 @@#include <linux/slab.h> #include <linux/delay.h> #include <linux/fb.h> -#include <linux/console.h> -#include <linux/selection.h> #include <linux/ioport.h> #include <linux/init.h> #include <linux/pci.h> #include <linux/vmalloc.h> -#include <linux/kd.h> -#include <linux/vt_kern.h> #include <linux/pagemap.h> #include <linux/version.h>
drivers/video/nvidia/nvidia.c +1 -0
@@ -1300,6 +1300,7 @@ | FBINFO_HWACCEL_IMAGEBLIT |FBINFO_HWACCEL_FILLRECT |FBINFO_HWACCEL_COPYAREA + |FBINFO_HWACCEL_CURSOR |FBINFO_HWACCEL_YPAN ; fb_videomode_to_modelist(info->monspecs.modedb,
drivers/video/riva/fbdev.c +2 -1
@@ -1704,7 +1704,8 @@ | FBINFO_HWACCEL_YPAN |FBINFO_HWACCEL_COPYAREA |FBINFO_HWACCEL_FILLRECT - |FBINFO_HWACCEL_IMAGEBLIT ; + |FBINFO_HWACCEL_IMAGEBLIT + |FBINFO_HWACCEL_CURSOR ;/* Accel seems to not work properly on NV30 yet...*/ if ((par->riva.Architecture ==NV_ARCH_30 ) || noaccel) {
include/linux/fb.h +1 -0
@@ -702,6 +702,7 @@#define FBINFO_HWACCEL_XPAN 0x1000/* optional */ #define FBINFO_HWACCEL_YPAN 0x2000/* optional */ #define FBINFO_HWACCEL_YWRAP 0x4000/* optional */ +#define FBINFO_HWACCEL_CURSOR 0x8000/* optional */ #define FBINFO_MISC_USEREVENT 0x10000/* event request from userspace */
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
Quoted 5 lines · James Simmons
Now I was thinking instead of a massive move of the the software
cursor we add a flagFBINFO_HWACCEL_CURSORto tell us if we are using a hardware cursor. This way for the sysfs interface you can test to see if it is a hardware cursor and only allow userland to access a hardware cursor. Here is a patch for that. People please try it out.
Your code will work, but it is conceptually what we want to do? Software cursors are application specific. The soft cursor implemented in fbdev really belongs to fbconsole. If we get another in-kernel user with a different update pattern (maybe they use the GPU) they will want a different soft cursor. Shouldn't we just move the current soft cursor into fbconsole? Given that software cursors are application specific fbdev should not contain one.
Signature · 9 lines
Jon Smirl [email protected] ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
Quoted 7 lines
Quoted 6 lines
Now I was thinking instead of a massive move of the the software
cursor we add a flagFBINFO_HWACCEL_CURSORto tell us if we are using a hardware cursor. This way for the sysfs interface you can test to see if it is a hardware cursor and only allow userland to access a hardware cursor. Here is a patch for that. People please try it out.
Quoted 7 lines
Your code will work, but it is conceptually what we want to do? Software cursors are application specific. The soft cursor implemented in fbdev really belongs to fbconsole. If we get another in-kernel user with a different update pattern (maybe they use the GPU) they will want a different soft cursor. Shouldn't we just move the current soft cursor into fbconsole? Given that software cursors are application specific fbdev should not contain one.
The only reason I'm against that is then when the developer with the different update pattern will create a new fbconsole. We could end up with several fbconsoles. I really like to keep it down to one. So I rather deal with several cursor implementation instead of several fbconsoles. Also remember that the software cursor is generically wrapped around the the imageblit function. Since imageblit is independent of the update pattern we will be okay.
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
Quoted 15 lines · James Simmons
Quoted 7 lines
Quoted 6 lines
Now I was thinking instead of a massive move of the the software
cursor we add a flagFBINFO_HWACCEL_CURSORto tell us if we are using a hardware cursor. This way for the sysfs interface you can test to see if it is a hardware cursor and only allow userland to access a hardware cursor. Here is a patch for that. People please try it out.Quoted 7 lines
Your code will work, but it is conceptually what we want to do? Software cursors are application specific. The soft cursor implemented in fbdev really belongs to fbconsole. If we get another in-kernel user with a different update pattern (maybe they use the GPU) they will want a different soft cursor. Shouldn't we just move the current soft cursor into fbconsole? Given that software cursors are application specific fbdev should not contain one.
Quoted 7 lines
The only reason I'm against that is then when the developer with the different update pattern will create a new fbconsole. We could end up with several fbconsoles. I really like to keep it down to one. So I rather deal with several cursor implementation instead of several fbconsoles. Also remember that the software cursor is generically wrapped around the the imageblit function. Since imageblit is independent of the update pattern we will be okay.
To address your concern, leave softcursor as an fbdev module. But we do need to remove all of those .fb_cursor = softcursor from all of the fbdev modules. As long as those are there we can only have one softcursor implementation.
Then any in-kernel user does this:
/* First try the hardware cursor */
if (info->fbops->fb_cursor)
err = info->fbops->fb_cursor(info, &cursor);
/* if that doesn't exist or didn't work, use the software one */
if (err)
soft_cursor(info, &cursor);I want to remove the fallback to softcursor logic from fbdev, I don't care if the softcursor modules stays part of fbdev, it's the fallback logic that doesn't belong in the drivers. There is no need for all of the drivers to reference softcursor.
Signature · 9 lines
Jon Smirl [email protected] ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
Quoted 5 lines
To address your concern, leave softcursor as an fbdev module. But we do need to remove all of those .fb_cursor = softcursor from all of the fbdev modules. As long as those are there we can only have one softcursor implementation.
Does this patch work for you? It reports to userland that no cursor is avaiable if the fbdev driver is using the software cursor.
drivers/video/aty/mach64_cursor.c +1 -1
@@ -219,8 +219,8 @@ info->sprite.buf_align =16 ;/* and 64 lines tall. */ info->sprite.flags =FB_PIXMAP_IO ; + info->flags |=FBINFO_HWACCEL_CURSOR ; info->fbops->fb_cursor = atyfb_cursor; -return 0 ; }
drivers/video/fbsysfs.c +8 -2
@@ -311,13 +311,19 @@static ssize_t store_cursor (struct class_device *class_device,const char * buf,size_t count) { -// struct fb_info *fb_info = (struct fb_info *)class_get_devdata(class_device); +struct fb_info *fb_info = (struct fb_info *)class_get_devdata (class_device); + +if (!(fb_info->flags &FBINFO_HWACCEL_CURSOR )) +return -ENXIO ;return 0 ; }static ssize_t show_cursor (struct class_device *class_device,char *buf) { -// struct fb_info *fb_info = (struct fb_info *)class_get_devdata(class_device); +struct fb_info *fb_info = (struct fb_info *)class_get_devdata (class_device); + +if (!(fb_info->flags &FBINFO_HWACCEL_CURSOR )) +return -ENXIO ;return 0 ; }
drivers/video/i810/i810.h +0 -1
@@ -201,7 +201,6 @@#define HAS_ACCELERATION 2#define ALWAYS_SYNC 4#define LOCKUP 8 -#define USE_HWCUR 16struct gtt_data {struct agp_memory *i810_fb_memory;
drivers/video/i810/i810_main.c +3 -4
@@ -1375,7 +1375,6 @@decode_var (&info->var, par);i810_load_regs (par);i810_init_cursor (par); -encode_fix (&info->fix, info);if (info->var.accel_flags && !(par->dev_flags &LOCKUP )) {
@@ -1387,6 +1386,7 @@ info->pixmap.scan_align =1 ; info->flags =FBINFO_DEFAULT |FBINFO_HWACCEL_YPAN ; } + info->flags |=FBINFO_HWACCEL_CURSOR ;return 0 ; }
@@ -1418,9 +1418,8 @@struct i810fb_par *par = (struct i810fb_par *)info->par;u8 __iomem *mmio = par->mmio_start_virtual; -if (!(par->dev_flags &USE_HWCUR ) || !info->var.accel_flags || - par->dev_flags &LOCKUP ) -return soft_cursor (info, cursor); +if (!par->dev_flags &LOCKUP ) +return -ENXIO ;if (cursor->image.width >64 || cursor->image.height >64 )return -ENXIO ;
drivers/video/intelfb/intelfbdrv.c +5 -19
@@ -117,14 +117,10 @@#include <linux/slab.h> #include <linux/delay.h> #include <linux/fb.h> -#include <linux/console.h> -#include <linux/selection.h> #include <linux/ioport.h> #include <linux/init.h> #include <linux/pci.h> #include <linux/vmalloc.h> -#include <linux/kd.h> -#include <linux/vt_kern.h> #include <linux/pagemap.h> #include <linux/version.h>
@@ -242,7 +238,7 @@static char *mode =NULL ;module_param (accel, bool,S_IRUGO ); -MODULE_PARM_DESC (accel,"Enable console acceleration" ); +MODULE_PARM_DESC (accel,"Enable hardware acceleration" );module_param (vram, int,S_IRUGO );MODULE_PARM_DESC (vram,"System RAM to allocate to framebuffer in MiB" );module_param (voffset, int,S_IRUGO );
@@ -498,7 +494,7 @@ {struct fb_info *info;struct intelfb_info *dinfo; -int i, j, err, dvo; +int i, err, dvo;int aperture_size, stolen_size;struct agp_kern_info gtt_info;int agp_memtype;
@@ -841,13 +837,6 @@if (bailearly ==5 )bailout (dinfo); -for (i =0 ; i <16 ; i++) { - j = color_table[i]; - dinfo->palette[i].red = default_red[j]; - dinfo->palette[i].green = default_grn[j]; - dinfo->palette[i].blue = default_blu[j]; - } -if (bailearly ==6 )bailout (dinfo);
@@ -1328,9 +1317,10 @@if (ACCEL (dinfo, info)) { info->flags =FBINFO_DEFAULT |FBINFO_HWACCEL_YPAN |FBINFO_HWACCEL_COPYAREA |FBINFO_HWACCEL_FILLRECT | -FBINFO_HWACCEL_IMAGEBLIT ; +FBINFO_HWACCEL_IMAGEBLIT |FBINFO_HWACCEL_CURSOR ; }else { - info->flags =FBINFO_DEFAULT |FBINFO_HWACCEL_YPAN ; + info->flags =FBINFO_DEFAULT |FBINFO_HWACCEL_YPAN | +FBINFO_HWACCEL_CURSOR ; }kfree (hw);return 0 ;
@@ -1359,10 +1349,6 @@ green >>=8 ; blue >>=8 ; - dinfo->palette[regno].red = red; - dinfo->palette[regno].green = green; - dinfo->palette[regno].blue = blue; -intelfbhw_setcolreg (dinfo, regno, red, green, blue, transp); }
drivers/video/intelfb/intelfb.h +0 -1
@@ -234,7 +234,6 @@/* palette */ u32 pseudo_palette[17 ]; -struct {u8 red, green, blue, pad; } palette[256 ];/* chip info */ int pci_chipset;
drivers/video/intelfb/intelfbhw.c +0 -4
@@ -29,14 +29,10 @@#include <linux/slab.h> #include <linux/delay.h> #include <linux/fb.h> -#include <linux/console.h> -#include <linux/selection.h> #include <linux/ioport.h> #include <linux/init.h> #include <linux/pci.h> #include <linux/vmalloc.h> -#include <linux/kd.h> -#include <linux/vt_kern.h> #include <linux/pagemap.h> #include <linux/version.h>
drivers/video/nvidia/nvidia.c +1 -0
@@ -1300,6 +1300,7 @@ | FBINFO_HWACCEL_IMAGEBLIT |FBINFO_HWACCEL_FILLRECT |FBINFO_HWACCEL_COPYAREA + |FBINFO_HWACCEL_CURSOR |FBINFO_HWACCEL_YPAN ; fb_videomode_to_modelist(info->monspecs.modedb,
drivers/video/riva/fbdev.c +2 -1
@@ -1704,7 +1704,8 @@ | FBINFO_HWACCEL_YPAN |FBINFO_HWACCEL_COPYAREA |FBINFO_HWACCEL_FILLRECT - |FBINFO_HWACCEL_IMAGEBLIT ; + |FBINFO_HWACCEL_IMAGEBLIT + |FBINFO_HWACCEL_CURSOR ;/* Accel seems to not work properly on NV30 yet...*/ if ((par->riva.Architecture ==NV_ARCH_30 ) || noaccel) {
include/linux/fb.h +1 -0
@@ -702,6 +702,7 @@#define FBINFO_HWACCEL_XPAN 0x1000/* optional */ #define FBINFO_HWACCEL_YPAN 0x2000/* optional */ #define FBINFO_HWACCEL_YWRAP 0x4000/* optional */ +#define FBINFO_HWACCEL_CURSOR 0x8000/* required */ #define FBINFO_MISC_USEREVENT 0x10000/* event request from userspace */
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
Why are you trying to preserve all of the ".fb_cursor = soft_cursor," assignments in the drivers? What purpose do they serve that can't be handled by a simple test like this:
Then any in-kernel user does this:
/* First try the hardware cursor */
if (info->fbops->fb_cursor)
err = info->fbops->fb_cursor(info, &cursor);
/* if that doesn't exist or didn't work, use the software one */
if (err)
soft_cursor(info, &cursor);Signature · 9 lines
Jon Smirl [email protected] ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
Quoted 5 lines
Why are you trying to preserve all of the ".fb_cursor =
soft_cursor," assignments in the drivers? What purpose do they serve that can't be handled by a simple test like this:
Quoted 7 lines
Then any in-kernel user does this:
/* First try the hardware cursor */ if (info->fbops->fb_cursor) err = info->fbops->fb_cursor(info, &cursor); /* if that doesn't exist or didn't work, use the software one */ if (err) soft_cursor(info, &cursor);
I don't want to make a patch that touches all the drivers. Th epatch I posted is a nice simple patch. If there are no other arguments against it I like to submit it to Andrew.
drivers/video/aty/mach64_cursor.c +1 -1
@@ -219,8 +219,8 @@ info->sprite.buf_align =16 ;/* and 64 lines tall. */ info->sprite.flags =FB_PIXMAP_IO ; + info->flags |=FBINFO_HWACCEL_CURSOR ; info->fbops->fb_cursor = atyfb_cursor; -return 0 ; }
drivers/video/fbsysfs.c +8 -2
@@ -311,13 +311,19 @@static ssize_t store_cursor (struct class_device *class_device,const char * buf,size_t count) { -// struct fb_info *fb_info = (struct fb_info *)class_get_devdata(class_device); +struct fb_info *fb_info = (struct fb_info *)class_get_devdata (class_device); + +if (!(fb_info->flags &FBINFO_HWACCEL_CURSOR )) +return -ENXIO ;return 0 ; }static ssize_t show_cursor (struct class_device *class_device,char *buf) { -// struct fb_info *fb_info = (struct fb_info *)class_get_devdata(class_device); +struct fb_info *fb_info = (struct fb_info *)class_get_devdata (class_device); + +if (!(fb_info->flags &FBINFO_HWACCEL_CURSOR )) +return -ENXIO ;return 0 ; }
drivers/video/i810/i810.h +0 -1
@@ -201,7 +201,6 @@#define HAS_ACCELERATION 2#define ALWAYS_SYNC 4#define LOCKUP 8 -#define USE_HWCUR 16struct gtt_data {struct agp_memory *i810_fb_memory;
drivers/video/i810/i810_main.c +3 -4
@@ -1375,7 +1375,6 @@decode_var (&info->var, par);i810_load_regs (par);i810_init_cursor (par); -encode_fix (&info->fix, info);if (info->var.accel_flags && !(par->dev_flags &LOCKUP )) {
@@ -1387,6 +1386,7 @@ info->pixmap.scan_align =1 ; info->flags =FBINFO_DEFAULT |FBINFO_HWACCEL_YPAN ; } + info->flags |=FBINFO_HWACCEL_CURSOR ;return 0 ; }
@@ -1418,9 +1418,8 @@struct i810fb_par *par = (struct i810fb_par *)info->par;u8 __iomem *mmio = par->mmio_start_virtual; -if (!(par->dev_flags &USE_HWCUR ) || !info->var.accel_flags || - par->dev_flags &LOCKUP ) -return soft_cursor (info, cursor); +if (!par->dev_flags &LOCKUP ) +return -ENXIO ;if (cursor->image.width >64 || cursor->image.height >64 )return -ENXIO ;
drivers/video/intelfb/intelfbdrv.c +5 -19
@@ -117,14 +117,10 @@#include <linux/slab.h> #include <linux/delay.h> #include <linux/fb.h> -#include <linux/console.h> -#include <linux/selection.h> #include <linux/ioport.h> #include <linux/init.h> #include <linux/pci.h> #include <linux/vmalloc.h> -#include <linux/kd.h> -#include <linux/vt_kern.h> #include <linux/pagemap.h> #include <linux/version.h>
@@ -242,7 +238,7 @@static char *mode =NULL ;module_param (accel, bool,S_IRUGO ); -MODULE_PARM_DESC (accel,"Enable console acceleration" ); +MODULE_PARM_DESC (accel,"Enable hardware acceleration" );module_param (vram, int,S_IRUGO );MODULE_PARM_DESC (vram,"System RAM to allocate to framebuffer in MiB" );module_param (voffset, int,S_IRUGO );
@@ -498,7 +494,7 @@ {struct fb_info *info;struct intelfb_info *dinfo; -int i, j, err, dvo; +int i, err, dvo;int aperture_size, stolen_size;struct agp_kern_info gtt_info;int agp_memtype;
@@ -841,13 +837,6 @@if (bailearly ==5 )bailout (dinfo); -for (i =0 ; i <16 ; i++) { - j = color_table[i]; - dinfo->palette[i].red = default_red[j]; - dinfo->palette[i].green = default_grn[j]; - dinfo->palette[i].blue = default_blu[j]; - } -if (bailearly ==6 )bailout (dinfo);
@@ -1328,9 +1317,10 @@if (ACCEL (dinfo, info)) { info->flags =FBINFO_DEFAULT |FBINFO_HWACCEL_YPAN |FBINFO_HWACCEL_COPYAREA |FBINFO_HWACCEL_FILLRECT | -FBINFO_HWACCEL_IMAGEBLIT ; +FBINFO_HWACCEL_IMAGEBLIT |FBINFO_HWACCEL_CURSOR ; }else { - info->flags =FBINFO_DEFAULT |FBINFO_HWACCEL_YPAN ; + info->flags =FBINFO_DEFAULT |FBINFO_HWACCEL_YPAN | +FBINFO_HWACCEL_CURSOR ; }kfree (hw);return 0 ;
@@ -1359,10 +1349,6 @@ green >>=8 ; blue >>=8 ; - dinfo->palette[regno].red = red; - dinfo->palette[regno].green = green; - dinfo->palette[regno].blue = blue; -intelfbhw_setcolreg (dinfo, regno, red, green, blue, transp); }
drivers/video/intelfb/intelfb.h +0 -1
@@ -234,7 +234,6 @@/* palette */ u32 pseudo_palette[17 ]; -struct {u8 red, green, blue, pad; } palette[256 ];/* chip info */ int pci_chipset;
drivers/video/intelfb/intelfbhw.c +0 -4
@@ -29,14 +29,10 @@#include <linux/slab.h> #include <linux/delay.h> #include <linux/fb.h> -#include <linux/console.h> -#include <linux/selection.h> #include <linux/ioport.h> #include <linux/init.h> #include <linux/pci.h> #include <linux/vmalloc.h> -#include <linux/kd.h> -#include <linux/vt_kern.h> #include <linux/pagemap.h> #include <linux/version.h>
drivers/video/nvidia/nvidia.c +1 -0
@@ -1300,6 +1300,7 @@ | FBINFO_HWACCEL_IMAGEBLIT |FBINFO_HWACCEL_FILLRECT |FBINFO_HWACCEL_COPYAREA + |FBINFO_HWACCEL_CURSOR |FBINFO_HWACCEL_YPAN ; fb_videomode_to_modelist(info->monspecs.modedb,
drivers/video/riva/fbdev.c +2 -1
@@ -1704,7 +1704,8 @@ | FBINFO_HWACCEL_YPAN |FBINFO_HWACCEL_COPYAREA |FBINFO_HWACCEL_FILLRECT - |FBINFO_HWACCEL_IMAGEBLIT ; + |FBINFO_HWACCEL_IMAGEBLIT + |FBINFO_HWACCEL_CURSOR ;/* Accel seems to not work properly on NV30 yet...*/ if ((par->riva.Architecture ==NV_ARCH_30 ) || noaccel) {
include/linux/fb.h +1 -0
@@ -702,6 +702,7 @@#define FBINFO_HWACCEL_XPAN 0x1000/* optional */ #define FBINFO_HWACCEL_YPAN 0x2000/* optional */ #define FBINFO_HWACCEL_YWRAP 0x4000/* optional */ +#define FBINFO_HWACCEL_CURSOR 0x8000/* required */ #define FBINFO_MISC_USEREVENT 0x10000/* event request from userspace */
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
James,
In the intelfb driver, the hw cursor is decoupled from the graphic
hw acceleration. So, this code is incorrect
@@ -1328,9 +1317,10 @@
if (ACCEL(dinfo, info)) {
info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN |
FBINFO_HWACCEL_COPYAREA | FBINFO_HWACCEL_FILLRECT |
- FBINFO_HWACCEL_IMAGEBLIT;
+ FBINFO_HWACCEL_IMAGEBLIT | FBINFO_HWACCEL_CURSOR;
} else {
- info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN;
+ info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN | + FBINFO_HWACCEL_CURSOR;
}
kfree(hw);
return 0;should be something like this. I can come with a good patch if you want (now it's just a mail hack)
if (ACCEL(dinfo, info)) {
info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN |
FBINFO_HWACCEL_COPYAREA | FBINFO_HWACCEL_FILLRECT |
FBINFO_HWACCEL_IMAGEBLIT;
} else {
info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN;
}+ if (dinfo->hwcursor)
+ info->flags |= FBINFO_HWACCEL_CURSOR;
Regards
Sylvain
Quoted 237 lines · James Simmons
Quoted 4 lines
Why are you trying to preserve all of the ".fb_cursor =
soft_cursor," assignments in the drivers? What purpose do they serve that can't be handled by a simple test like this:Quoted 9 lines
Then any in-kernel user does this:
/* First try the hardware cursor */ if (info->fbops->fb_cursor) err = info->fbops->fb_cursor(info, &cursor); /* if that doesn't exist or didn't work, use the software one */ if (err) soft_cursor(info, &cursor);I don't want to make a patch that touches all the drivers. Th epatch I posted is a nice simple patch. If there are no other arguments against it I like to submit it to Andrew.
diff -urN -X
/home/jsimmons/dontdifflinus-2.6/drivers/video/aty/mach64_cursor.cfbdev-2.6/drivers/video/aty/mach64_cursor.cdrivers/video/aty/mach64_cursor.c +1
-1@@ -219,8 +219,8 @@ info->sprite.buf_align =16 ;/* and 64 lines tall. */ info->sprite.flags =FB_PIXMAP_IO ; + info->flags |=FBINFO_HWACCEL_CURSOR ; info->fbops->fb_cursor = atyfb_cursor; -return 0 ; }diff -urN -X
/home/jsimmons/dontdifflinus-2.6/drivers/video/fbsysfs.cfbdev-2.6/drivers/video/fbsysfs.cdrivers/video/fbsysfs.c +8
-2@@ -311,13 +311,19 @@static ssize_t store_cursor (struct class_device *class_device,const char * buf,size_t count) { -// struct fb_info *fb_info = (struct fb_info *)class_get_devdata(class_device); +struct fb_info *fb_info = (struct fb_info *)class_get_devdata (class_device); + +if (!(fb_info->flags &FBINFO_HWACCEL_CURSOR )) +return -ENXIO ;return 0 ; }static ssize_t show_cursor (struct class_device *class_device,char *buf) { -// struct fb_info *fb_info = (struct fb_info *)class_get_devdata(class_device); +struct fb_info *fb_info = (struct fb_info *)class_get_devdata (class_device); + +if (!(fb_info->flags &FBINFO_HWACCEL_CURSOR )) +return -ENXIO ;return 0 ; }diff -urN -X
/home/jsimmons/dontdifflinus-2.6/drivers/video/i810/i810.hfbdev-2.6/drivers/video/i810/i810.hdrivers/video/i810/i810.h +0
-1@@ -201,7 +201,6 @@#define HAS_ACCELERATION 2#define ALWAYS_SYNC 4#define LOCKUP 8 -#define USE_HWCUR 16struct gtt_data {struct agp_memory *i810_fb_memory;diff -urN -X
/home/jsimmons/dontdifflinus-2.6/drivers/video/i810/i810_main.cfbdev-2.6/drivers/video/i810/i810_main.cdrivers/video/i810/i810_main.c +3
-4@@ -1375,7 +1375,6 @@decode_var (&info->var, par);i810_load_regs (par);i810_init_cursor (par); -encode_fix (&info->fix, info);if (info->var.accel_flags && !(par->dev_flags &LOCKUP )) {@@ -1387,6 +1386,7 @@ info->pixmap.scan_align =1 ; info->flags =FBINFO_DEFAULT |FBINFO_HWACCEL_YPAN ; } + info->flags |=FBINFO_HWACCEL_CURSOR ;return 0 ; }@@ -1418,9 +1418,8 @@struct i810fb_par *par = (struct i810fb_par *)info->par;u8 __iomem *mmio = par->mmio_start_virtual; -if (!(par->dev_flags &USE_HWCUR ) || !info->var.accel_flags || - par->dev_flags &LOCKUP ) -return soft_cursor (info, cursor); +if (!par->dev_flags &LOCKUP ) +return -ENXIO ;if (cursor->image.width >64 || cursor->image.height >64 )return -ENXIO ;diff -urN -X
/home/jsimmons/dontdifflinus-2.6/drivers/video/intelfb/intelfbdrv.cfbdev-2.6/drivers/video/intelfb/intelfbdrv.cdrivers/video/intelfb/intelfbdrv.c +5
-19@@ -117,14 +117,10 @@#include <linux/slab.h> #include <linux/delay.h> #include <linux/fb.h> -#include <linux/console.h> -#include <linux/selection.h> #include <linux/ioport.h> #include <linux/init.h> #include <linux/pci.h> #include <linux/vmalloc.h> -#include <linux/kd.h> -#include <linux/vt_kern.h> #include <linux/pagemap.h> #include <linux/version.h> @@ -242,7 +238,7 @@static char *mode =NULL ;module_param (accel, bool,S_IRUGO ); -MODULE_PARM_DESC (accel,"Enable console acceleration" ); +MODULE_PARM_DESC (accel,"Enable hardware acceleration" );module_param (vram, int,S_IRUGO );MODULE_PARM_DESC (vram,"System RAM to allocate to framebuffer in MiB" );module_param (voffset, int,S_IRUGO );@@ -498,7 +494,7 @@ {struct fb_info *info;struct intelfb_info *dinfo; -int i, j, err, dvo; +int i, err, dvo;int aperture_size, stolen_size;struct agp_kern_info gtt_info;int agp_memtype;@@ -841,13 +837,6 @@if (bailearly ==5 )bailout (dinfo); -for (i =0 ; i <16 ; i++) { - j = color_table[i]; - dinfo->palette[i].red = default_red[j]; - dinfo->palette[i].green = default_grn[j]; - dinfo->palette[i].blue = default_blu[j]; - } -if (bailearly ==6 )bailout (dinfo);@@ -1328,9 +1317,10 @@if (ACCEL (dinfo, info)) { info->flags =FBINFO_DEFAULT |FBINFO_HWACCEL_YPAN |FBINFO_HWACCEL_COPYAREA |FBINFO_HWACCEL_FILLRECT | -FBINFO_HWACCEL_IMAGEBLIT ; +FBINFO_HWACCEL_IMAGEBLIT |FBINFO_HWACCEL_CURSOR ; }else { - info->flags =FBINFO_DEFAULT |FBINFO_HWACCEL_YPAN ; + info->flags =FBINFO_DEFAULT |FBINFO_HWACCEL_YPAN | +FBINFO_HWACCEL_CURSOR ; }kfree (hw);return 0 ;@@ -1359,10 +1349,6 @@ green >>=8 ; blue >>=8 ; - dinfo->palette[regno].red = red; - dinfo->palette[regno].green = green; - dinfo->palette[regno].blue = blue; -intelfbhw_setcolreg (dinfo, regno, red, green, blue, transp); }diff -urN -X
/home/jsimmons/dontdifflinus-2.6/drivers/video/intelfb/intelfb.hfbdev-2.6/drivers/video/intelfb/intelfb.hdrivers/video/intelfb/intelfb.h +0
-1@@ -234,7 +234,6 @@/* palette */ u32 pseudo_palette[17 ]; -struct {u8 red, green, blue, pad; } palette[256 ];/* chip info */ int pci_chipset;diff -urN -X
/home/jsimmons/dontdifflinus-2.6/drivers/video/intelfb/intelfbhw.cfbdev-2.6/drivers/video/intelfb/intelfbhw.cdrivers/video/intelfb/intelfbhw.c +0
-4@@ -29,14 +29,10 @@#include <linux/slab.h> #include <linux/delay.h> #include <linux/fb.h> -#include <linux/console.h> -#include <linux/selection.h> #include <linux/ioport.h> #include <linux/init.h> #include <linux/pci.h> #include <linux/vmalloc.h> -#include <linux/kd.h> -#include <linux/vt_kern.h> #include <linux/pagemap.h> #include <linux/version.h> diff -urN -X
/home/jsimmons/dontdifflinus-2.6/drivers/video/nvidia/nvidia.cfbdev-2.6/drivers/video/nvidia/nvidia.cdrivers/video/nvidia/nvidia.c +1
-0@@ -1300,6 +1300,7 @@ | FBINFO_HWACCEL_IMAGEBLIT |FBINFO_HWACCEL_FILLRECT |FBINFO_HWACCEL_COPYAREA + |FBINFO_HWACCEL_CURSOR |FBINFO_HWACCEL_YPAN ; fb_videomode_to_modelist(info->monspecs.modedb,diff -urN -X
/home/jsimmons/dontdifflinus-2.6/drivers/video/riva/fbdev.cfbdev-2.6/drivers/video/riva/fbdev.cdrivers/video/riva/fbdev.c +2
-1@@ -1704,7 +1704,8 @@ | FBINFO_HWACCEL_YPAN |FBINFO_HWACCEL_COPYAREA |FBINFO_HWACCEL_FILLRECT - |FBINFO_HWACCEL_IMAGEBLIT ; + |FBINFO_HWACCEL_IMAGEBLIT + |FBINFO_HWACCEL_CURSOR ;/* Accel seems to not work properly on NV30 yet...*/ if ((par->riva.Architecture ==NV_ARCH_30 ) || noaccel) {diff -urN -X
/home/jsimmons/dontdifflinus-2.6/include/linux/fb.hfbdev-2.6/include/linux/fb.hinclude/linux/fb.h +1
-1@@ -702,6 +702,7 @@#define FBINFO_HWACCEL_XPAN 0x1000/* optional */ #define FBINFO_HWACCEL_YPAN 0x2000/* optional */ #define FBINFO_HWACCEL_YWRAP 0x4000/* optional */ +#define FBINFO_HWACCEL_CURSOR 0x8000/* required */ #define FBINFO_MISC_USEREVENT 0x10000/* event request from userspace */ -------------------------------------------------------
Quoted 11 lines
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Linux-fbdev-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
Quoted 3 lines · James Simmons
I don't want to make a patch that touches all the drivers. Th epatch I posted is a nice simple patch. If there are no other arguments against it I like to submit it to Andrew.
But we agreed that having the drivers fallback to the softcursor is the wrong general thing to do since it only works for fbconsole. Why do we want to keep code in place when we agree that it is not needed? All it does is add clutter to the driver code.
You don't need to make the patch, I already made it for you.
Signature · 9 lines
Jon Smirl [email protected] ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
Another way to think of this, let's make another member variable .fb_hwcursor. When the driver has a hardware cusor is sets .fb_hwcursor. If you want to use the software cursor use the exisiting .fb_cursor.
If you think about it every driver is going to have the exact same assignment .fb_cursor = soft_cursor. If every driver is going to have exactly the same assignment, why do we need the variable?
It's the existence of the hardware cursor that varies from driver to driver, that's the one we need the variable for.
Signature · 9 lines
Jon Smirl [email protected] ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
Yes please send me a proper patch.
Quoted 275 lines · Sylvain Meyer
James,
In the intelfb driver, the hw cursor is decoupled from the graphic
hw acceleration. So, this code is incorrectdrivers/video/intelfb/intelfbdrv.c +3
-2@@ -1328,9 +1317,10 @@if (ACCEL (dinfo, info)) { info->flags =FBINFO_DEFAULT |FBINFO_HWACCEL_YPAN |FBINFO_HWACCEL_COPYAREA |FBINFO_HWACCEL_FILLRECT | -FBINFO_HWACCEL_IMAGEBLIT ; +FBINFO_HWACCEL_IMAGEBLIT |FBINFO_HWACCEL_CURSOR ; }else { - info->flags =FBINFO_DEFAULT |FBINFO_HWACCEL_YPAN ; + info->flags =FBINFO_DEFAULT |FBINFO_HWACCEL_YPAN | +FBINFO_HWACCEL_CURSOR ; }kfree (hw);return 0 ;should be something like this. I can come with a good patch if you want (now it's just a mail hack)
drivers/video/intelfb/intelfbdrv.c +0
-0if (ACCEL (dinfo, info)) { info->flags =FBINFO_DEFAULT |FBINFO_HWACCEL_YPAN | FBINFO_HWACCEL_COPYAREA | FBINFO_HWACCEL_FILLRECT |FBINFO_HWACCEL_IMAGEBLIT; } else { info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN;drivers/video/i810/i810_main.c +2
-0} +if (dinfo->hwcursor) + info->flags |=FBINFO_HWACCEL_CURSOR ;Regards
SylvainQuoted 238 lines · James Simmons
Quoted 4 lines
Why are you trying to preserve all of the ".fb_cursor =
soft_cursor," assignments in the drivers? What purpose do they serve that can't be handled by a simple test like this:Quoted 9 lines
Then any in-kernel user does this:
/* First try the hardware cursor */ if (info->fbops->fb_cursor) err = info->fbops->fb_cursor(info, &cursor); /* if that doesn't exist or didn't work, use the software one */ if (err) soft_cursor(info, &cursor);I don't want to make a patch that touches all the drivers. Th epatch I posted is a nice simple patch. If there are no other arguments against it I like to submit it to Andrew.
diff -urN -X
/home/jsimmons/dontdifflinus-2.6/drivers/video/aty/mach64_cursor.cfbdev-2.6/drivers/video/aty/mach64_cursor.cdrivers/video/aty/mach64_cursor.c +1
-1@@ -219,8 +219,8 @@ info->sprite.buf_align =16 ;/* and 64 lines tall. */ info->sprite.flags =FB_PIXMAP_IO ; + info->flags |=FBINFO_HWACCEL_CURSOR ; info->fbops->fb_cursor = atyfb_cursor; -return 0 ; }diff -urN -X
/home/jsimmons/dontdifflinus-2.6/drivers/video/fbsysfs.cfbdev-2.6/drivers/video/fbsysfs.cdrivers/video/fbsysfs.c +8
-2@@ -311,13 +311,19 @@static ssize_t store_cursor (struct class_device *class_device,const char * buf,size_t count) { -// struct fb_info *fb_info = (struct fb_info *)class_get_devdata(class_device); +struct fb_info *fb_info = (struct fb_info *)class_get_devdata (class_device); + +if (!(fb_info->flags &FBINFO_HWACCEL_CURSOR )) +return -ENXIO ;return 0 ; }static ssize_t show_cursor (struct class_device *class_device,char *buf) { -// struct fb_info *fb_info = (struct fb_info *)class_get_devdata(class_device); +struct fb_info *fb_info = (struct fb_info *)class_get_devdata (class_device); + +if (!(fb_info->flags &FBINFO_HWACCEL_CURSOR )) +return -ENXIO ;return 0 ; }diff -urN -X
/home/jsimmons/dontdifflinus-2.6/drivers/video/i810/i810.hfbdev-2.6/drivers/video/i810/i810.hdrivers/video/i810/i810.h +0
-1@@ -201,7 +201,6 @@#define HAS_ACCELERATION 2#define ALWAYS_SYNC 4#define LOCKUP 8 -#define USE_HWCUR 16struct gtt_data {struct agp_memory *i810_fb_memory;diff -urN -X
/home/jsimmons/dontdifflinus-2.6/drivers/video/i810/i810_main.cfbdev-2.6/drivers/video/i810/i810_main.cdrivers/video/i810/i810_main.c +3
-4@@ -1375,7 +1375,6 @@decode_var (&info->var, par);i810_load_regs (par);i810_init_cursor (par); -encode_fix (&info->fix, info);if (info->var.accel_flags && !(par->dev_flags &LOCKUP )) {@@ -1387,6 +1386,7 @@ info->pixmap.scan_align =1 ; info->flags =FBINFO_DEFAULT |FBINFO_HWACCEL_YPAN ; } + info->flags |=FBINFO_HWACCEL_CURSOR ;return 0 ; }@@ -1418,9 +1418,8 @@struct i810fb_par *par = (struct i810fb_par *)info->par;u8 __iomem *mmio = par->mmio_start_virtual; -if (!(par->dev_flags &USE_HWCUR ) || !info->var.accel_flags || - par->dev_flags &LOCKUP ) -return soft_cursor (info, cursor); +if (!par->dev_flags &LOCKUP ) +return -ENXIO ;if (cursor->image.width >64 || cursor->image.height >64 )return -ENXIO ;diff -urN -X
/home/jsimmons/dontdifflinus-2.6/drivers/video/intelfb/intelfbdrv.cfbdev-2.6/drivers/video/intelfb/intelfbdrv.cdrivers/video/intelfb/intelfbdrv.c +5
-19@@ -117,14 +117,10 @@#include <linux/slab.h> #include <linux/delay.h> #include <linux/fb.h> -#include <linux/console.h> -#include <linux/selection.h> #include <linux/ioport.h> #include <linux/init.h> #include <linux/pci.h> #include <linux/vmalloc.h> -#include <linux/kd.h> -#include <linux/vt_kern.h> #include <linux/pagemap.h> #include <linux/version.h> @@ -242,7 +238,7 @@static char *mode =NULL ;module_param (accel, bool,S_IRUGO ); -MODULE_PARM_DESC (accel,"Enable console acceleration" ); +MODULE_PARM_DESC (accel,"Enable hardware acceleration" );module_param (vram, int,S_IRUGO );MODULE_PARM_DESC (vram,"System RAM to allocate to framebuffer in MiB" );module_param (voffset, int,S_IRUGO );@@ -498,7 +494,7 @@ {struct fb_info *info;struct intelfb_info *dinfo; -int i, j, err, dvo; +int i, err, dvo;int aperture_size, stolen_size;struct agp_kern_info gtt_info;int agp_memtype;@@ -841,13 +837,6 @@if (bailearly ==5 )bailout (dinfo); -for (i =0 ; i <16 ; i++) { - j = color_table[i]; - dinfo->palette[i].red = default_red[j]; - dinfo->palette[i].green = default_grn[j]; - dinfo->palette[i].blue = default_blu[j]; - } -if (bailearly ==6 )bailout (dinfo);@@ -1328,9 +1317,10 @@if (ACCEL (dinfo, info)) { info->flags =FBINFO_DEFAULT |FBINFO_HWACCEL_YPAN |FBINFO_HWACCEL_COPYAREA |FBINFO_HWACCEL_FILLRECT | -FBINFO_HWACCEL_IMAGEBLIT ; +FBINFO_HWACCEL_IMAGEBLIT |FBINFO_HWACCEL_CURSOR ; }else { - info->flags =FBINFO_DEFAULT |FBINFO_HWACCEL_YPAN ; + info->flags =FBINFO_DEFAULT |FBINFO_HWACCEL_YPAN | +FBINFO_HWACCEL_CURSOR ; }kfree (hw);return 0 ;@@ -1359,10 +1349,6 @@ green >>=8 ; blue >>=8 ; - dinfo->palette[regno].red = red; - dinfo->palette[regno].green = green; - dinfo->palette[regno].blue = blue; -intelfbhw_setcolreg (dinfo, regno, red, green, blue, transp); }diff -urN -X
/home/jsimmons/dontdifflinus-2.6/drivers/video/intelfb/intelfb.hfbdev-2.6/drivers/video/intelfb/intelfb.hdrivers/video/intelfb/intelfb.h +0
-1@@ -234,7 +234,6 @@/* palette */ u32 pseudo_palette[17 ]; -struct {u8 red, green, blue, pad; } palette[256 ];/* chip info */ int pci_chipset;diff -urN -X
/home/jsimmons/dontdifflinus-2.6/drivers/video/intelfb/intelfbhw.cfbdev-2.6/drivers/video/intelfb/intelfbhw.cdrivers/video/intelfb/intelfbhw.c +0
-4@@ -29,14 +29,10 @@#include <linux/slab.h> #include <linux/delay.h> #include <linux/fb.h> -#include <linux/console.h> -#include <linux/selection.h> #include <linux/ioport.h> #include <linux/init.h> #include <linux/pci.h> #include <linux/vmalloc.h> -#include <linux/kd.h> -#include <linux/vt_kern.h> #include <linux/pagemap.h> #include <linux/version.h> diff -urN -X
/home/jsimmons/dontdifflinus-2.6/drivers/video/nvidia/nvidia.cfbdev-2.6/drivers/video/nvidia/nvidia.cdrivers/video/nvidia/nvidia.c +1
-0@@ -1300,6 +1300,7 @@ | FBINFO_HWACCEL_IMAGEBLIT |FBINFO_HWACCEL_FILLRECT |FBINFO_HWACCEL_COPYAREA + |FBINFO_HWACCEL_CURSOR |FBINFO_HWACCEL_YPAN ; fb_videomode_to_modelist(info->monspecs.modedb,diff -urN -X
/home/jsimmons/dontdifflinus-2.6/drivers/video/riva/fbdev.cfbdev-2.6/drivers/video/riva/fbdev.cdrivers/video/riva/fbdev.c +2
-1@@ -1704,7 +1704,8 @@ | FBINFO_HWACCEL_YPAN |FBINFO_HWACCEL_COPYAREA |FBINFO_HWACCEL_FILLRECT - |FBINFO_HWACCEL_IMAGEBLIT ; + |FBINFO_HWACCEL_IMAGEBLIT + |FBINFO_HWACCEL_CURSOR ;/* Accel seems to not work properly on NV30 yet...*/ if ((par->riva.Architecture ==NV_ARCH_30 ) || noaccel) {diff -urN -X
/home/jsimmons/dontdifflinus-2.6/include/linux/fb.hfbdev-2.6/include/linux/fb.hinclude/linux/fb.h +1
-0@@ -702,6 +702,7 @@#define FBINFO_HWACCEL_XPAN 0x1000/* optional */ #define FBINFO_HWACCEL_YPAN 0x2000/* optional */ #define FBINFO_HWACCEL_YWRAP 0x4000/* optional */ +#define FBINFO_HWACCEL_CURSOR 0x8000/* required */ #define FBINFO_MISC_USEREVENT 0x10000/* event request from userspace */
Quoted 16 lines
Quoted 12 lines
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Linux-fbdev-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
Quoted 11 lines · Jon Smirl
Another way to think of this, let's make another member variable .fb_hwcursor. When the driver has a hardware cusor is sets .fb_hwcursor. If you want to use the software cursor use the exisiting .fb_cursor.
If you think about it every driver is going to have the exact same assignment .fb_cursor =
soft_cursor. If every driver is going to have exactly the same assignment, why do we need the variable?It's the existence of the hardware cursor that varies from driver to driver, that's the one we need the variable for.
Is this resolved? I tend to agree with Jon. Let's just remove all references to soft_cursor from all drivers, and let fbcon_cursor() fall back to soft_cursor when xxxfb_cursor() is absent. It is a lot cleaner and saner this way, and although it touches all drivers, it is a singe logical change, so it's acceptable.
Also, I think it might be preferable to have 2 cursor hooks, one is fbcon-specific, and the other is for use only in userspace, which needs to be more comprehensive. Or if a single but comprehensive cursor API is preferred, then we just adapt fbcon_cursor to use the more powerful cursor API.
So, anyone want to propose a cursor API for fbdev, that is both usable by fbcon and userspace?
Tony
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
This not currently resolved.
From user space we can have two interfaces
1) the current ioctl one
2) the new stuff in sysfs. If the hardware cursor is there you get a sysfs attribute named cursor. write x,y to it to move the cursor around. I'll add the sysfs support as soon as we decide on the interface.
I'm still at OLS. Missed seeing both of you at KS. fbdev was discussed and Linus went with Benh's proposal to move the modesetting API to user space. Obviously this will have a lot of impact on fbdev.
Quoted 36 lines · Antonino A. Daplas
Quoted 11 lines · Jon Smirl
Another way to think of this, let's make another member variable .fb_hwcursor. When the driver has a hardware cusor is sets .fb_hwcursor. If you want to use the software cursor use the exisiting .fb_cursor.
If you think about it every driver is going to have the exact same assignment .fb_cursor =
soft_cursor. If every driver is going to have exactly the same assignment, why do we need the variable?It's the existence of the hardware cursor that varies from driver to driver, that's the one we need the variable for.
Is this resolved? I tend to agree with Jon. Let's just remove all references to
soft_cursorfrom all drivers, and letfbcon_cursor()fall back
tosoft_cursorwhenxxxfb_cursor()is absent. It is a lot cleaner and saner
this way, and although it touches all drivers, it is a singe logical change,
so it's acceptable.Also, I think it might be preferable to have 2 cursor hooks, one is fbcon-specific, and the other is for use only in userspace, which needs to be more comprehensive. Or if a single but comprehensive cursor API is preferred, then we just adapt
fbcon_cursorto use the more powerful cursor API.So, anyone want to propose a cursor API for fbdev, that is both usable by fbcon and userspace?
Tony
Signature · 2 lines
Jon Smirl [email protected]
Quoted 2 lines
1) the current ioctl one
Defunct.
Quoted 3 lines
2) the new stuff in sysfs. If the hardware cursor is there you get a sysfs attribute named cursor. write x,y to it to move the cursor around. I'll add the sysfs support as soon as we decide on the interface.
I was playing with that a bit.
Quoted 3 lines
I'm still at OLS. Missed seeing both of you at KS. fbdev was discussed and Linus went with Benh's proposal to move the modesetting API to user space. Obviously this will have a lot of impact on fbdev.
I don't have any money to go to such events :-( Looks like fbdev is going away completly :-< We will need embedded graphics libraries to boot a machine in the future. I seen this coming and thats why my motivation for development keeps dropping. I suggest they make a big diff to remove the whole system.
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
Quoted 15 lines · James Simmons
Quoted 2 lines
1) the current ioctl one
Defunct.
Quoted 3 lines
2) the new stuff in sysfs. If the hardware cursor is there you get a sysfs attribute named cursor. write x,y to it to move the cursor around. I'll add the sysfs support as soon as we decide on the interface.
I was playing with that a bit.
Quoted 3 lines
I'm still at OLS. Missed seeing both of you at KS. fbdev was discussed and Linus went with Benh's proposal to move the modesetting API to user space. Obviously this will have a lot of impact on fbdev.
Quoted 5 lines
I don't have any money to go to such events :-( Looks like fbdev is going away completly :-< We will need embedded graphics libraries to boot a machine in the future. I seen this coming and thats why my motivation for development keeps dropping. I suggest they make a big diff to remove the whole system.
It is a long way from Linus telling BenH to go ahead and having a replacement system in the kernel. My bet is that userspace mode setting only happens for a couple of chips. I don't see a lot of people jumping up to replace the existing system. I was pushing to keep fbdev the way it is but without either of the maintainers there to defend fbdev it is a hard sell.
If you write a paper for OLS, get it accepted and present it; the sponsors will probably pay your airfare. Hotels can be had for $40/night. Work on Ted to get an invite to Kernel Summit and then give him four months notice that you need airfare and you'll probably get it.
Signature · 9 lines
Jon Smirl [email protected] ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click