From: ChiHun Won Date: Fri, 15 Feb 2019 08:10:27 +0000 (+0900) Subject: [RAMEN9610-12373] fbdev: dpu20: added dqe sfr dump X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=930b547d0d84808db0bd14df6ce509631b98afd9;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [RAMEN9610-12373] fbdev: dpu20: added dqe sfr dump Change-Id: Ic86eafb0bb8022f59047e34ea177120494b8848f Signed-off-by: ChiHun Won --- diff --git a/drivers/video/fbdev/exynos/dpu20/dqe_drv.c b/drivers/video/fbdev/exynos/dpu20/dqe_drv.c index dc2651e2c1b3..dbb39ed82086 100644 --- a/drivers/video/fbdev/exynos/dpu20/dqe_drv.c +++ b/drivers/video/fbdev/exynos/dpu20/dqe_drv.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "dqe.h" #include "decon.h" @@ -49,6 +50,29 @@ const s32 bypass_hsc_tune[35] = { 0,0,0,0,0,0,0,1,15,1,0,1,0,0,0,0,0,0,0,5,-10,0,10,30,170,230,240,155,70,32,1,10,64,51,204 }; +static void dqe_dump(void) +{ + int acquired = console_trylock(); + struct decon_device *decon = get_decon_drvdata(0); + + if (IS_DECON_OFF_STATE(decon)) { + decon_info("%s: DECON%d is disabled, state(%d)\n", + __func__, decon->id, decon->state); + return; + } + + decon_info("\n=== DQE SFR DUMP ===\n"); + print_hex_dump(KERN_ERR, "", DUMP_PREFIX_ADDRESS, 32, 4, + decon->res.regs + DQE_BASE , 0x600, false); + + decon_info("\n=== DQE SHADOW SFR DUMP ===\n"); + print_hex_dump(KERN_ERR, "", DUMP_PREFIX_ADDRESS, 32, 4, + decon->res.regs + SHADOW_DQE_OFFSET, 0x600, false); + + if (acquired) + console_unlock(); +} + static void dqe_load_context(void) { int i, j; @@ -1072,6 +1096,25 @@ static DEVICE_ATTR(aosp_colors, 0660, decon_dqe_aosp_color_show, decon_dqe_aosp_colors_store); +static ssize_t decon_dqe_dump_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + int val = 0; + ssize_t count = 0; + + dqe_info("%s\n", __func__); + + dqe_dump(); + + count = snprintf(buf, PAGE_SIZE, "dump = %d\n", val); + + return count; +} + +static DEVICE_ATTR(dump, 0440, + decon_dqe_dump_show, + NULL); + static struct attribute *dqe_attrs[] = { &dev_attr_gamma.attr, &dev_attr_cgc.attr, @@ -1081,6 +1124,7 @@ static struct attribute *dqe_attrs[] = { &dev_attr_tune_mode2.attr, &dev_attr_tune_onoff.attr, &dev_attr_aosp_colors.attr, + &dev_attr_dump.attr, NULL, }; ATTRIBUTE_GROUPS(dqe);