Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.
notro edited this page Mar 25, 2013 · 9 revisions

FBTFT has dynamic debug support. This is enabled when loading the driver or through sysfs when the driver is loaded.

modprobe itdb28fb debug=1
echo "5" > /sys/module/itdb28fb/parameters/debug

Debug output can be turned on for individual functions setting bits. There is 7 shorthand debug levels 1-7.

Here is the macros from fbtft.h

/* shorthand debug levels */
#define DEBUG_LEVEL_1               DEBUG_REQUEST_GPIOS
#define DEBUG_LEVEL_2               (DEBUG_LEVEL_1 | DEBUG_DRIVER_INIT_FUNCTIONS | DEBUG_TIME_FIRST_UPDATE)
#define DEBUG_LEVEL_3               (DEBUG_LEVEL_2 | DEBUG_RESET | DEBUG_INIT_DISPLAY | DEBUG_BLANK | DEBUG_FREE_GPIOS | DEBUG_VERIFY_GPIOS)
#define DEBUG_LEVEL_4               (DEBUG_LEVEL_2 | DEBUG_FB_READ | DEBUG_FB_WRITE | DEBUG_FB_FILLRECT | DEBUG_FB_COPYAREA | DEBUG_FB_IMAGEBLIT | DEBUG_FB_BLANK)
#define DEBUG_LEVEL_5               (DEBUG_LEVEL_3 | DEBUG_UPDATE_DISPLAY)
#define DEBUG_LEVEL_6               (DEBUG_LEVEL_4 | DEBUG_LEVEL_5)
#define DEBUG_LEVEL_7               0xFFFFFFFF

#define DEBUG_DRIVER_INIT_FUNCTIONS (1<<3)
#define DEBUG_TIME_FIRST_UPDATE     (1<<4)
#define DEBUG_TIME_EACH_UPDATE      (1<<5)
#define DEBUG_DEFERRED_IO           (1<<6)
#define DEBUG_FBTFT_INIT_FUNCTIONS  (1<<7)

/* fbops */
#define DEBUG_FB_READ               (1<<8)   /* not in use */
#define DEBUG_FB_WRITE              (1<<9)
#define DEBUG_FB_FILLRECT           (1<<10)
#define DEBUG_FB_COPYAREA           (1<<11)
#define DEBUG_FB_IMAGEBLIT          (1<<12)
#define DEBUG_FB_SETCOLREG          (1<<13)
#define DEBUG_FB_BLANK              (1<<14)

/* fbtftops */
#define DEBUG_READ                  (1<<18)  /* not in use */
#define DEBUG_WRITE                 (1<<19)
#define DEBUG_WRITE_VMEM            (1<<20)
#define DEBUG_WRITE_DATA_COMMAND    (1<<21)
#define DEBUG_SET_ADDR_WIN          (1<<22)
#define DEBUG_RESET                 (1<<23)
#define DEBUG_MKDIRTY               (1<<24)  /* not in use */
#define DEBUG_UPDATE_DISPLAY        (1<<25)
#define DEBUG_INIT_DISPLAY          (1<<26)
#define DEBUG_BLANK                 (1<<27)
#define DEBUG_REQUEST_GPIOS         (1<<28)
#define DEBUG_FREE_GPIOS            (1<<29)
#define DEBUG_REQUEST_GPIOS_MATCH   (1<<30)
#define DEBUG_VERIFY_GPIOS          (1<<31)

With Bash shell it's easy to set the individual bits:

# DEBUG_LEVEL_1, DEBUG_FB_BLANK, DEBUG_BLANK
modprobe itdb28fb debug=$((1 | 2**14 | 2**27))

# DEBUG_FB_SETCOLREG
echo $((2**13)) > /sys/module/itdb28fb/parameters/debug

When the value is set through sysfs, fbtft_deferred_io has to run for the change to take effect in the fbtft module. This happens when video memory is updated. Can be triggered with:

echo "0" > /dev/fb1

Clone this wiki locally