01 Jun, 2007
1 commit
-
Move the forward declaration of fb_class from drivers/video/console/fbcon.h to
, together with the other forward declarations related to
drivers/video/fbmem.c.This kills the following sparse warning:
| drivers/video/fbmem.c:1363:14: warning: symbol 'fb_class' was not declared. Should it be static?Signed-off-by: Geert Uytterhoeven
Signed-off-by: Antonino Daplas
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
10 May, 2007
1 commit
-
Provide framebuffer page protection flags and definitions of
fb_readl/fb_writel for AVR32.Signed-off-by: Haavard Skinnemoen
Cc: "Antonino A. Daplas"
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
09 May, 2007
8 commits
-
Check if the mode can properly display the screen. This will be needed by
drivers where the capability is not constant with each mode. The function
fb_set_var() will query fbcon the requirement, then it will query the driver
(via a new hook fb_get_caps()) its capability. If the driver's capability
cannot handle fbcon's requirement, then fb_set_var() will fail.For example, if a particular driver supports 2 modes where:
mode1 = can only display 8x16 bitmaps
mode2 = can display any bitmapthen if current mode = mode2 and current font = 12x22
fbset /* mode1 cannot handle 12x22 */
fbset will failSigned-off-by: Antonino Daplas
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add a tile method, fb_get_tilemax(), that returns the maximum length of
the tile map (or font map). This is needed by s3fb which can only handle
256 characters.Signed-off-by: Antonino Daplas
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
A few drivers are not capable of blitting rectangles of any dimension.
vga16fb can only blit 8-pixel wide rectangles, while s3fb (in tileblitting
mode) can only blit 8x16 rectangles. For example, loading a 12x22 font in
vga16fb will result in a corrupt display.Advertise this limitation/capability in info->pixmap.blit_x and blit_y. These
fields are 32-bit arrays (font max is 32x32 only), ie, if bit 7 is set, then
width/height of 7+1 is supported.Signed-off-by: Antonino Daplas
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
The functions fb_read() and fb_write in fbmem.c assume that the framebuffer
is in IO memory. However, we have 3 drivers (hecubafb, arcfb, and vfb)
where the framebuffer is allocated from system RAM (via vmalloc). Using
__raw_read/__raw_write (fb_readl/fb_writel) for these drivers is
illegal, especially in other platforms.Create file read and write methods for these types of drivers. These are
named fb_sys_read() and fb_sys_write().Signed-off-by: Antonino Daplas
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
It is unnecessary to pass struct file to fb_read() and fb_write() in struct
fb_ops. For consistency with the other methods, pass struct fb_info instead.Signed-off-by: Antonino Daplas
Acked-by: Paul Mundt
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
The generic drawing functions (cfbimgblt, cfbcopyarea, cfbfillrect) assume
that the framebuffer is in IO memory. However, we have 3 drivers (hecubafb,
arcfb, and vfb) where the framebuffer is allocated from system RAM (via
vmalloc). Using _raw_read/write and family for these drivers (as used in
the cfb* functions) is illegal, especially in other platforms.Create 3 new drawing functions, based almost entirely from the original
except that the framebuffer memory is assumed to be in system RAM.
These are named as sysimgblt, syscopyarea, and sysfillrect.Signed-off-by: Antonino Daplas
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
There are cases when we do not want to wait on the delay for automatically
updating the "real" framebuffer, this implements a simple ->fsync() hook
for explicitly flushing the deferred I/O work. The ->page_mkwrite()
handler will rearm the work queue normally.(akpm: nuke unneeded ifdefs, forward-delcare struct dentry)
Signed-off-by: Paul Mundt
Cc: Jaya Kumar
Acked-by: Antonino Daplas
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
This implements deferred IO support in fbdev. Deferred IO is a way to delay
and repurpose IO. This implementation is done using mm's page_mkwrite and
page_mkclean hooks in order to detect, delay and then rewrite IO. This
functionality is used by hecubafb.[adaplas]
This is useful for graphics hardware with no directly addressable/mappable
framebuffer. Implementing this will allow the "framebuffer" to be accesible
from user space via mmap().Signed-off-by: Jaya Kumar
Signed-off-by: Antonino Daplas
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
20 Feb, 2007
2 commits
-
fb_info->bl_mutex is badly thought out and the backlight class doesn't
need it if the framebuffer/backlight register/unregister order is
consistent, particularly after the backlight locking fixes.Fix the drivers to use the order:
backlight_device_register()
register_framebuffer()
unregister_framebuffer()
backlight_device_unregister()and turn bl_mutex into a lock for the bl_curve data only.
Signed-off-by: Richard Purdie
-
The backlight class wants notification whenever the console is blanked
but doesn't get this when hardware blanking fails and software blanking
is used. Changing FB_EVENT_BLANK to report both would be a behaviour
change which could confuse the console layer so add a new event for
software blanking and have the backlight class listen for both.Signed-off-by: Richard Purdie
13 Feb, 2007
2 commits
-
fbdev modedb: make more input and output pointer parameters const
Signed-off-by: Geert Uytterhoeven
Cc: James Simmons
Cc: Benjamin Herrenschmidt
Cc: Paul Mackerras
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add a driver for S3 Trio / S3 Virge. Driver is tested with most versions
of S3 Trio and with S3 Virge/DX, on i386.(akpm: We kind-of have support for this hardware already, but...
virgefb.c
- amiga/zorro specific,
- broken (according to Kconfig),
- uses obsolete/nonexistent interface (struct display_switch)
- recent Adrian Bunk's patch removes this driverS3triofb.c
- ppc/openfirmware specific
- minimal functionality
- broken (according to Kconfig),
- uses obsolete/nonexistent interface (struct display_switch)
)Signed-off-by: Ondrej Zajicek
Cc: James Simmons
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
14 Dec, 2006
1 commit
-
Remove references to non-existent fbmon_valid_timings()
Signed-off-by: Geert Uytterhoeven
Cc: James Simmons
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
09 Dec, 2006
1 commit
-
- Mark the default colormaps read-only, as nobody should be allowed to
modify them- Additionally mark color values as __read_mostly since they will only be
modified (very seldom) by fb_invert_cmaps()- Add named C99-initializers in fb_cmap structs and use the ARRAY_SIZE()
macroSigned-off-by: Helge Deller
Acked-by: James Simmons
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
02 Dec, 2006
1 commit
-
Converts from using struct "class_device" to "struct device" making
everything show up properly in /sys/devices/ with symlinks from the
/sys/class directory.Signed-off-by: Greg Kroah-Hartman
03 Oct, 2006
2 commits
-
Check the return value of device_create_file(). If return is 'fail', remove
attributes by calling device_remove_file().Signed-off-by: Antonino Daplas
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Adds functionality to read the EDID information over the DDC bus in a generic
way. This code is based on the DDC implementation in the radeon driver.[adaplas]
- separate from fbmon.c and place in new file fb_ddc.c
- remove dependency to CONFIG_I2C and CONFIG_I2C_ALGOBIT, otherwise, feature
will not compile if i2c support is compiled as a module
- feature is selectable only by drivers needing it. It must have a
'select FB_DDC if xxx' in Kconfig
- change printk's to dev_*, the i2c people prefers itSigned-off-by: Dennis Munsie
Signed-off-by: Antonino Daplas
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
15 Aug, 2006
1 commit
-
linux/backlight.h pulls in header files (eg. ioport.h) that break
compilation of userspace programs. To solve the problem, only include
backlight.h in fb.h if compiling kernel stuff.Signed-off-by: Michal Januszewski
Cc: "Antonino A. Daplas"
Signed-off-by: Andrew Morton
Signed-off-by: Greg Kroah-Hartman
01 Aug, 2006
1 commit
-
The backlight and lcd subsystems can be notified by the framebuffer layer
of blanking events. However, these subsystems, as a whole, can function
independently from the framebuffer layer. But in order to enable to the
lcd and backlight subsystems, the framebuffer has to be compiled also,
effectively sucking in a huge amount of unneeded code.To prevent dependency problems, separate out the framebuffer notification
mechanism from the framebuffer layer and permanently link it to the kernel.Signed-off-by: Antonino Daplas
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
11 Jul, 2006
1 commit
-
MAX_NR_CONSOLES, fg_console, want_console and last_console are more of a
function of the VT layer than the TTY one. Moving these to vt.h and vt_kern.h
allows all of the framebuffer and VT console drivers to remove their
dependency on tty.h.[akpm@osdl.org: fix alpha build]
Signed-off-by: Jon Smirl
Signed-off-by: Antonino Daplas
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
01 Jul, 2006
1 commit
-
Signed-off-by: Adrian Bunk
27 Jun, 2006
3 commits
-
Also fixes up all files that #include it.
Signed-off-by: Greg Kroah-Hartman
-
The control for binding/unbinding is moved from fbcon to the console layer.
Thus the fbcon sysfs attributes, attach and detach, are also gone.1. Add a notifier event that tells fbcon if a framebuffer driver has been
unregistered. If no registered driver remains, fbcon will unregister
itself from the console layer.2. Replaced calls to give_up_console() with unregister_con_driver().
3. Still use take_over_console() instead of register_con_driver() to
maintain compatibility4. Respect the parameter first_fb_vc and last_fb_vc instead of using 0 and
MAX_NR_CONSOLES - 1. These parameters are settable by the user.5. When fbcon is completely unbound from the console layer, fbcon will
also release (iow, decrement module reference counts to zero) all fbdev
drivers. In other words, a bind or unbind request from the console layer
will propagate down to the framebuffer drivers.6. If fbcon is not bound to the console, it will ignore all notifier
events (except driver registration and unregistration) and all sysfs
requests.Signed-off-by: Antonino Daplas
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
In order for this feature to work, an interface will be needed. The most
appropriate is sysfs. However, the framebuffer console has no sysfs entry
yet. This will create a sysfs class device entry for fbcon under
/sys/class/graphics.Add a class_device entry 'fbcon' under class 'graphics'. Console-specific
attributes which where previously under class/graphics/fb[x] are moved to
class/graphics/fbcon. These attributes, 'con_rotate' and 'con_rotate_all',
are also renamed to 'rotate' and 'rotate_all' respectively.Signed-off-by: Antonino Daplas
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
26 Jun, 2006
1 commit
-
This patch contains a total rewrite of the backlight infrastructure for
portable Apple computers. Backward compatibility is retained. A sysfs
interface allows userland to control the brightness with more steps than
before. Userland is allowed to upload a brightness curve for different
monitors, similar to Mac OS X.[akpm@osdl.org: add needed exports]
Signed-off-by: Michael Hanselmann
Acked-by: Benjamin Herrenschmidt
Cc: Richard Purdie
Cc: "Antonino A. Daplas"
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
01 Apr, 2006
1 commit
-
The monochrome->color expansion routine that handles bitmaps which have
(widths % 8) != 0 (slow_imageblit) produces corrupt characters in big-endian.
This is caused by a bogus bit test in slow_imageblit().Fix.
This patch may deserve to go to the stable tree. The code has already been
well tested in little-endian machines. It's only in big-endian where there is
uncertainty and Herbert confirmed that this is the correct way to go.It should not introduce regressions.
Signed-off-by: Antonino Daplas
Acked-by: Herbert Poetzl
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
29 Mar, 2006
1 commit
-
Fix a lot of typos. Eyeballed by jmc@ in OpenBSD.
Signed-off-by: Alexey Dobriyan
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
15 Jan, 2006
2 commits
-
No need for a file argument. If we'd really need it it's in vma->vm_file
already. gbefb and sgivwfb used to set vma->vm_file to the file argument, but
the kernel alrady did that.Signed-off-by: Christoph Hellwig
Signed-off-by: Antonino Daplas
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
The ioctl and file arguments to ->fb_mmap are totally unused and there's not
reason a driver should need them.Also update the ->fb_compat_ioctl prototype to be the same as ->fb_mmap.
Signed-off-by: Antonino Daplas
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
13 Dec, 2005
3 commits
-
The drawing function cfbfillrect does not work correctly when access is not
unsigned-long aligned. It manifests as extra lines of pixels that are not
complete drawn. Reversing the shift operator solves the problem, so I would
presume that this bug would manifest only on little endian machines. The
function cfbcopyarea may also have this bug.Aligned access should present no problems.
Signed-off-by: Antonino Daplas
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Every framebuffer driver relies on the assumption that the set_par()
function of the driver is called before drawing functions and other
functions dependent on the hardware state are executed.Whenever you switch from X to a framebuffer console for the very first
time, there is a chance that a broken X system has _not_ set the mode to
KD_GRAPHICS, thus the vt and framebuffer code executes a screen redraw and
several other functions before a set_par() is executed. This is believed
to be not a bug of linux but a bug of X/xdm. At least some X releases used
by SuSE and Debian show this behaviour.There was a 2nd case, but that has been fixed by Antonino Daplas on
10-dec-2005.This patch allows drivers to set a flag to inform fbcon_switch() that they
prefer a set_par() call on every console switch, working around the
problems caused by the broken X releases.The flag will be used by the next release of cyblafb and might help other
drivers that assume a hardware state different to the one used by X.As the default behaviour does not change, this patch should be acceptable
to everybody.Signed-off-by: Knut Petersen
Acked-by: "Antonino A. Daplas"
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add hooks to save and restore the graphics state. These hooks are called in
fbcon_blank() when entering/leaving KD_GRAPHICS mode. This is needed by
savagefb at least so it can cooperate with savage_dri and by cyblafb.State save/restoration can be full or partial.
Signed-off-by: Antonino Daplas
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
09 Nov, 2005
3 commits
-
Add ability to set rotation via sysfs. The attributes are located in
/sys/class/graphics/fb[n] and accepts 0 - unrotated; 1 - clockwise; 2 - upside
down; 3 - counterclockwise.The attributes are:
con_rotate (r/w) - set rotation of the active console
con_rotate_all (w) - set rotation of all consoles
rotate (r/w) - set rotation of the framebuffer, if supported.
Currently, none of the drivers support this.This is probably temporary, since con_rotate and con_rotate_all are
console-specific and has no business being under the fb device. However,
until the console layer acquires it's own sysfs class, these attributes will
temporarily reside here.Signed-off-by: Antonino Daplas
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add support for rotating and positioning of the logo. Rotation and position
depends on 'int rotate' parameter added to fb_prepare_logo() and
fb_show_logo().Signed-off-by: Antonino Daplas
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
This patch series implements generic code to rotate the console at 90, 180,
and 270 degrees. The implementation is completely done in the framebuffer
console level, thus no changes to the framebuffer layer or to the drivers
are needed.Console rotation is required by some Sharp-based devices where the natural
orientation of the display is not at 0 degrees. Also, users that have
displays that can pivot will benefit by having a console in portrait mode
if they so desire.The choice to implement the code in the console layer rather than in the
framebuffer layer is due to the following reasons:- it's fast
- it does not require driver changes
- it can coexist with devices that can rotate the display at the hardware level
- it complements graphics applications that can do display rotationThe changes to core fbcon are minimal-- recognition of the console
rotation angle so it can swap directions, origins and axes (xres vs yres,
xpanstep vs ypanstep, xoffset vs yoffset, etc) and storage of the rotation
angle per display. The bulk of the code that does the actual drawing to the
screen are placed in separate files. Each angle of rotation has separate
methods (bmove, clear, putcs, cursor, update_start which is derived from
update_var, and clear_margins). To mimimize processing time, the fontdata
are pre-rotated at each console switch (only if the font or the angle has
changed).The option can be compiled out (CONFIG_FRAMEBUFFER_CONSOLE_ROTATION = n) if
rotation is not needed.Choosing the rotation angle can be done in several ways:
1. boot option fbcon=rotate:n, where
n = 0 - normal
n = 1 - 90 degrees (clockwise)
n = 2 - 180 degrees (upside down)
n = 3 - 270 degrees (counterclockwise)2. echo n > /sys/class/graphics/fb[num]/con_rotate
where n is the same as described above. It sets the angle of rotation
of the current console3 echo n > /sys/class/graphics/fb[num]/con_rotate_all
where n is the same as described above. Globally sets the angle of
rotation.GOTCHAS:
The option, especially at angles of 90 and 270 degrees, will exercise
the least used code of drivers. Namely, at these angles, panning is done
in the x-axis, so it can reveal bugs in the driver if xpanstep is set
incorrectly. A workaround is to set xpanstep = 0.Secondly, at these angles, the framebuffer memory access can be
unaligned if (fontheight * bpp) % 32 ~= 0 which can reveal bugs in the drivers
imageblit, fillrect and copyarea functions. (I think cfbfillrect may have
this buglet). A workaround is to use a standard 8x16 font.Speed:
The scrolling speed difference between 0 and 180 degrees is minimal,
somewhere areound 1-2%. At 90 or 270 degress, speed drops down to a vicinity
of 30-40%. This is understandable because the blit direction is across the
framebuffer "direction." Scrolling will be helped at these angles if xpanstep
is not equal to zero, use of 8x16 fonts, and setting xres_virtual >= xres * 2.Note: The code is tested on little-endian only, so I don't know if it will
work in big-endian. Please let me know, it will take only less than a minute
of your time.This patch prepares fbcon for console rotation and contains the following
changes:- add rotate field in struct fbcon_ops to keep fbcon's current rotation
angle- add con_rotate field in struct display to store per-display rotation angle
- create a private copy of the current var to fbcon. This will prevent
fbcon from directly manipulating info->var, especially the fields xoffset,
yoffset and vmode.- add ability to swap pertinent axes (xres, yres; xpanstep, ypanstep; etc)
depending on the rotation angle- change global update_var() (function that sets the screen start address)
as an fbcon method update_start. This is required because the axes, start
offset, and/or direction can be reversed depending on the rotation angle.- add fbcon method rotate_font() which will rotate each character bitmap to
the correct angle of rotation.- add fbcon boot option 'rotate' to select the angle of rotation at bootime.
Currently does nothing until all patches are applied.Signed-off-by: Antonino Daplas
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
07 Nov, 2005
3 commits
-
Add new helper, fb_find_best_display(), which will search the modelist for the
best mode for the attached display. This requires an EDID block that is
converted to struct fb_monspecs and a private modelist. The search will be
done in this manner:- if 1st detailed timing is preferred, use that
- else if dimensions of the display are known, use that to estimate xres and
- else if modelist has detailed timings, use the first detailed timing
- else, use the very first entry from the modelistSigned-off-by: Antonino Daplas
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Currently the fb_find_nearest_mode() function finds a mode with screen
resolution closest to that described by the 'var' argument and with some
arbitrary refresh rate (eg. in the following sequence of refresh rates: 70 60
53 85 75, 53 is selected).This patch fixes the function so that it looks for the closest mode as far as
both resolution and refresh rate are concerned. The function's first argument
is changed to fb_videomode so that the refresh rate can be specified by the
caller, as fb_var_screeninfo doesn't have any fields that could directly hold
this data.Signed-off-by: Michal Januszewski
Signed-off-by: Antonino Daplas
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
According to Jon Smirl, filling in the field fb_cursor with soft_cursor for
drivers that do not support hardware cursors is redundant. The soft_cursor
function is usable by all drivers because it is just a wrapper around
fb_imageblit. And because soft_cursor is an fbcon-specific hook, the file is
moved to the console directory.Thus, drivers that do not support hardware cursors can leave the fb_cursor
field blank. For drivers that do, they can fill up this field with their own
version.The end result is a smaller code size. And if the framebuffer console is not
loaded, module/kernel size is also reduced because the soft_cursor module will
also not be loaded.Signed-off-by: Antonino Daplas
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds