summaryrefslogtreecommitdiff
path: root/cesar
diff options
context:
space:
mode:
authorNicolas Schodet2011-03-07 13:23:45 +0100
committerNicolas Schodet2011-03-08 15:01:39 +0100
commit70802b74d7874bc32eccaf3458de8ef68a78ea6f (patch)
treee6c37a03c607ecef84cc552603cfc25a41a7a41e /cesar
parent418f7bd036ae5c7a757c84cb4a718005bb54b05d (diff)
cesar/hal/phy: dump last used tonemap, refs #2347
Diffstat (limited to 'cesar')
-rw-r--r--cesar/hal/phy/src/phy.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/cesar/hal/phy/src/phy.c b/cesar/hal/phy/src/phy.c
index 8142d33a48..8df816968c 100644
--- a/cesar/hal/phy/src/phy.c
+++ b/cesar/hal/phy/src/phy.c
@@ -110,6 +110,8 @@ struct phy_debug_t
{
/** Recorded date at fatal error. */
u32 fatal_date;
+ /** Last used tonemap. */
+ blk_t *last_tonemap;
};
typedef struct phy_debug_t phy_debug_t;
@@ -366,6 +368,24 @@ phy_fatal_dump (dbg_dump_callback_t dump_cb, void *dump_cb_user)
pbdma_status),
BF_GET (PHY_PBDMA_STATUS_ERROR__CHANDATA_SIZE_FORBIDDEN,
pbdma_status));
+ /* Dump last used tonemap. */
+ blk_t *last_tonemap = phy_debug.last_tonemap;
+ if (last_tonemap && last_tonemap != INVALID_PTR
+ && last_tonemap->next && last_tonemap->next != INVALID_PTR)
+ {
+ dbg_dump_printf (dump_cb, dump_cb_user, "last tonemap: 0x%08x\n ",
+ (u32) last_tonemap);
+ const u32 *p = (u32 *) last_tonemap->data;
+ uint i;
+ for (i = 0; i < PHY_TONEMAP_WORDS; i++)
+ {
+ dbg_dump_printf (dump_cb, dump_cb_user, "0x%08x%s", *p++,
+ i == PHY_TONEMAP_WORDS - 1 ? "\n"
+ : ((i + 1) % 8 ? ", " : ",\n "));
+ if (i == BLK_SIZE / sizeof (u32))
+ p = (u32 *) last_tonemap->next->data;
+ }
+ }
}
#endif /* DEBUG */
@@ -866,6 +886,7 @@ phy_set_tonemap (phy_t *ctx, blk_t *tonemap)
dbg_claim_ptr (tonemap->next->data);
dbg_claim (ARCH_DMA_VALID (tonemap->next->data));
PHY_TRACE (SET_TONEMAP, tonemap);
+ dbg_do (phy_debug.last_tonemap = tonemap);
/* Send new tonemap. */
dbg_claim (PHY_TONEMAP_WORDS > BLK_SIZE / 4
&& PHY_TONEMAP_WORDS < 2 * BLK_SIZE / 4);