diff options
author | Timur Tabi <timur@freescale.com> | 2012-10-16 18:33:46 -0400 |
---|---|---|
committer | Timur Tabi <timur@freescale.com> | 2012-11-26 14:41:19 -0500 |
commit | 5cc2a36fe8aad05457f15d5908a980b67e0e945d (patch) | |
tree | ece117ec07e7e9bc7670e1a1fcece522ac34ccc5 /drivers/video/fsl-diu-fb.c | |
parent | f74de500a1e8d82f29b59b2b8f0ce87cf3d5ea54 (diff) |
drivers/video: fsl-diu-fb: improve message displays
Add some debug and error messages that are useful during debugging.
Signed-off-by: Timur Tabi <timur@freescale.com>
Diffstat (limited to 'drivers/video/fsl-diu-fb.c')
-rw-r--r-- | drivers/video/fsl-diu-fb.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c index f388c3a065d2..6e32ba83aa5b 100644 --- a/drivers/video/fsl-diu-fb.c +++ b/drivers/video/fsl-diu-fb.c | |||
@@ -430,6 +430,22 @@ static struct mfb_info mfb_template[] = { | |||
430 | }, | 430 | }, |
431 | }; | 431 | }; |
432 | 432 | ||
433 | #ifdef DEBUG | ||
434 | static void __attribute__ ((unused)) fsl_diu_dump(struct diu __iomem *hw) | ||
435 | { | ||
436 | mb(); | ||
437 | pr_debug("DIU: desc=%08x,%08x,%08x, gamma=%08x pallete=%08x " | ||
438 | "cursor=%08x curs_pos=%08x diu_mode=%08x bgnd=%08x " | ||
439 | "disp_size=%08x hsyn_para=%08x vsyn_para=%08x syn_pol=%08x " | ||
440 | "thresholds=%08x int_mask=%08x plut=%08x\n", | ||
441 | hw->desc[0], hw->desc[1], hw->desc[2], hw->gamma, | ||
442 | hw->pallete, hw->cursor, hw->curs_pos, hw->diu_mode, | ||
443 | hw->bgnd, hw->disp_size, hw->hsyn_para, hw->vsyn_para, | ||
444 | hw->syn_pol, hw->thresholds, hw->int_mask, hw->plut); | ||
445 | rmb(); | ||
446 | } | ||
447 | #endif | ||
448 | |||
433 | /** | 449 | /** |
434 | * fsl_diu_name_to_port - convert a port name to a monitor port enum | 450 | * fsl_diu_name_to_port - convert a port name to a monitor port enum |
435 | * | 451 | * |
@@ -1108,6 +1124,12 @@ static int fsl_diu_ioctl(struct fb_info *info, unsigned int cmd, | |||
1108 | 1124 | ||
1109 | if (!arg) | 1125 | if (!arg) |
1110 | return -EINVAL; | 1126 | return -EINVAL; |
1127 | |||
1128 | dev_dbg(info->dev, "ioctl %08x (dir=%s%s type=%u nr=%u size=%u)\n", cmd, | ||
1129 | _IOC_DIR(cmd) & _IOC_READ ? "R" : "", | ||
1130 | _IOC_DIR(cmd) & _IOC_WRITE ? "W" : "", | ||
1131 | _IOC_TYPE(cmd), _IOC_NR(cmd), _IOC_SIZE(cmd)); | ||
1132 | |||
1111 | switch (cmd) { | 1133 | switch (cmd) { |
1112 | case MFB_SET_PIXFMT_OLD: | 1134 | case MFB_SET_PIXFMT_OLD: |
1113 | dev_warn(info->dev, | 1135 | dev_warn(info->dev, |
@@ -1754,6 +1776,9 @@ static int __init fsl_diu_init(void) | |||
1754 | coherence_data_size = be32_to_cpup(prop) * 13; | 1776 | coherence_data_size = be32_to_cpup(prop) * 13; |
1755 | coherence_data_size /= 8; | 1777 | coherence_data_size /= 8; |
1756 | 1778 | ||
1779 | pr_debug("fsl-diu-fb: coherence data size is %zu bytes\n", | ||
1780 | coherence_data_size); | ||
1781 | |||
1757 | prop = of_get_property(np, "d-cache-line-size", NULL); | 1782 | prop = of_get_property(np, "d-cache-line-size", NULL); |
1758 | if (prop == NULL) { | 1783 | if (prop == NULL) { |
1759 | pr_err("fsl-diu-fb: missing 'd-cache-line-size' property' " | 1784 | pr_err("fsl-diu-fb: missing 'd-cache-line-size' property' " |
@@ -1763,10 +1788,17 @@ static int __init fsl_diu_init(void) | |||
1763 | } | 1788 | } |
1764 | d_cache_line_size = be32_to_cpup(prop); | 1789 | d_cache_line_size = be32_to_cpup(prop); |
1765 | 1790 | ||
1791 | pr_debug("fsl-diu-fb: cache lines size is %u bytes\n", | ||
1792 | d_cache_line_size); | ||
1793 | |||
1766 | of_node_put(np); | 1794 | of_node_put(np); |
1767 | coherence_data = vmalloc(coherence_data_size); | 1795 | coherence_data = vmalloc(coherence_data_size); |
1768 | if (!coherence_data) | 1796 | if (!coherence_data) { |
1797 | pr_err("fsl-diu-fb: could not allocate coherence data " | ||
1798 | "(size=%zu)\n", coherence_data_size); | ||
1769 | return -ENOMEM; | 1799 | return -ENOMEM; |
1800 | } | ||
1801 | |||
1770 | #endif | 1802 | #endif |
1771 | 1803 | ||
1772 | ret = platform_driver_register(&fsl_diu_driver); | 1804 | ret = platform_driver_register(&fsl_diu_driver); |