Re: [PATCH] drm/hisilicon: Use drm_crtc_mask()
Hi Am 11.01.21 um 04:30 schrieb Tian Tao: Use drm_crtc_mask() where appropriate. Signed-off-by: Tian Tao Looks like the right thing to do. Acked-by: Thomas Zimmermann Best regards Thomas --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c index c76f996..1c5f2fa 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c @@ -96,6 +96,7 @@ int hibmc_vdac_init(struct hibmc_drm_private *priv) struct drm_device *dev = &priv->dev; struct hibmc_connector *hibmc_connector = &priv->connector; struct drm_encoder *encoder = &priv->encoder; + struct drm_crtc *crtc = &priv->crtc; struct drm_connector *connector = &hibmc_connector->base; int ret; @@ -105,7 +106,7 @@ int hibmc_vdac_init(struct hibmc_drm_private *priv) return ret; } - encoder->possible_crtcs = 0x1; + encoder->possible_crtcs = drm_crtc_mask(crtc); ret = drm_simple_encoder_init(dev, encoder, DRM_MODE_ENCODER_DAC); if (ret) { drm_err(dev, "failed to init encoder: %d\n", ret); -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Felix Imendörffer OpenPGP_signature Description: OpenPGP digital signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/ast: Disable fast reset after DRAM initial
Hi Am 11.01.21 um 07:43 schrieb KuoHsiang Chou: [Bug][AST2500] When AST2500 acts as stand-alone VGA so that DRAM and DVO initialization have to be achieved by VGA driver with P2A (PCI to AHB) enabling. However, HW suggests disable Fast reset mode after DRAM initializaton, because fast reset mode is mainly designed for ARM ICE debugger. Once Fast reset is checked as enabling, WDT (Watch Dog Timer) should be first enabled to avoid system deadlock before disable fast reset mode. Signed-off-by: KuoHsiang Chou --- drivers/gpu/drm/ast/ast_drv.h | 1 + drivers/gpu/drm/ast/ast_main.c | 4 ++ drivers/gpu/drm/ast/ast_post.c | 72 ++ 3 files changed, 51 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h index da6dfb677540..8bdd1482370d 100644 --- a/drivers/gpu/drm/ast/ast_drv.h +++ b/drivers/gpu/drm/ast/ast_drv.h @@ -320,6 +320,7 @@ bool ast_is_vga_enabled(struct drm_device *dev); void ast_post_gpu(struct drm_device *dev); u32 ast_mindwm(struct ast_private *ast, u32 r); void ast_moutdwm(struct ast_private *ast, u32 r, u32 v); +void patch_ahb_ast2500(struct ast_private *ast); The function name should be named ast_patch_ahb_2500() because it's not static. /* ast dp501 */ void ast_set_dp501_video_output(struct drm_device *dev, u8 mode); bool ast_backup_fw(struct drm_device *dev, u8 *addr, u32 size); diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c index 3775fe26f792..3c072c6589a2 100644 --- a/drivers/gpu/drm/ast/ast_main.c +++ b/drivers/gpu/drm/ast/ast_main.c @@ -96,6 +96,10 @@ static void ast_detect_config_mode(struct drm_device *dev, u32 *scu_rev) jregd0 = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd0, 0xff); jregd1 = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd1, 0xff); if (!(jregd0 & 0x80) || !(jregd1 & 0x10)) { + /* Patch AST2500 */ + if (((dev->pdev->revision & 0xF0) == 0x40) && ((jregd0 & 0xC0) == 0)) The field dev->pdev is considered deprecated. Instead, you can get the CP device from dev->dev like this struct pci_dev *pdev = to_pci_dev(dev->dev); It's the same instance, but dev->pdev will removed soon. + patch_ahb_ast2500(ast); + /* Double check it's actually working */ data = ast_read32(ast, 0xf004); if (data != 0x) { diff --git a/drivers/gpu/drm/ast/ast_post.c b/drivers/gpu/drm/ast/ast_post.c index 8902c2f84bf9..2d121c5b2233 100644 --- a/drivers/gpu/drm/ast/ast_post.c +++ b/drivers/gpu/drm/ast/ast_post.c @@ -2026,6 +2026,33 @@ static bool ast_dram_init_2500(struct ast_private *ast) return true; } +void patch_ahb_ast2500(struct ast_private *ast) +{ + u32 data; + +patch_ahb_lock: + /* Clear bus lock condition */ + ast_moutdwm(ast, 0x1e60, 0xAEED1A03); + ast_moutdwm(ast, 0x1e600084, 0x0001); + ast_moutdwm(ast, 0x1e600088, 0x); + ast_moutdwm(ast, 0x1e6e2000, 0x1688A8A8); + data = ast_mindwm(ast, 0x1e6e2070); + if (data & 0x0800) {/* check fast reset */ + + ast_moutdwm(ast, 0x1E785004, 0x0010); + ast_moutdwm(ast, 0x1E785008, 0x4755); + ast_moutdwm(ast, 0x1E78500c, 0x0033); + udelay(1000); + } + ast_moutdwm(ast, 0x1e6e2000, 0x1688A8A8); + do { + data = ast_mindwm(ast, 0x1e6e2000); + if (data == 0x) + goto patch_ahb_lock; + } while (data != 1); + ast_moutdwm(ast, 0x1e6e207c, 0x0800); /* clear fast reset */ +} + void ast_post_chip_2500(struct drm_device *dev) { struct ast_private *ast = to_ast_private(dev); @@ -2033,39 +2060,32 @@ void ast_post_chip_2500(struct drm_device *dev) u8 reg; reg = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd0, 0xff); - if ((reg & 0x80) == 0) {/* vga only */ + if ((reg & 0xC0) == 0) {/* vga only */ /* Clear bus lock condition */ - ast_moutdwm(ast, 0x1e60, 0xAEED1A03); - ast_moutdwm(ast, 0x1e600084, 0x0001); - ast_moutdwm(ast, 0x1e600088, 0x); - ast_moutdwm(ast, 0x1e6e2000, 0x1688A8A8); - ast_write32(ast, 0xf004, 0x1e6e); - ast_write32(ast, 0xf000, 0x1); - ast_write32(ast, 0x12000, 0x1688a8a8); - while (ast_read32(ast, 0x12000) != 0x1) - ; - - ast_write32(ast, 0x1, 0xfc600309); - while (ast_read32(ast, 0x1) != 0x1) - ; + patch_ahb_ast2500(ast); + + /* Disable watchdog */ + ast_moutdwm(ast, 0x1E78502C, 0x); + ast_moutdwm(ast, 0x1E78504C, 0x); + /* Reset USB por
[PATCH] drm/ast: Disable fast reset after DRAM initial
[Bug][AST2500] When AST2500 acts as stand-alone VGA so that DRAM and DVO initialization have to be achieved by VGA driver with P2A (PCI to AHB) enabling. However, HW suggests disable Fast reset mode after DRAM initializaton, because fast reset mode is mainly designed for ARM ICE debugger. Once Fast reset is checked as enabling, WDT (Watch Dog Timer) should be first enabled to avoid system deadlock before disable fast reset mode. Signed-off-by: KuoHsiang Chou --- drivers/gpu/drm/ast/ast_drv.h | 1 + drivers/gpu/drm/ast/ast_main.c | 4 ++ drivers/gpu/drm/ast/ast_post.c | 72 ++ 3 files changed, 51 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h index da6dfb677540..8bdd1482370d 100644 --- a/drivers/gpu/drm/ast/ast_drv.h +++ b/drivers/gpu/drm/ast/ast_drv.h @@ -320,6 +320,7 @@ bool ast_is_vga_enabled(struct drm_device *dev); void ast_post_gpu(struct drm_device *dev); u32 ast_mindwm(struct ast_private *ast, u32 r); void ast_moutdwm(struct ast_private *ast, u32 r, u32 v); +void patch_ahb_ast2500(struct ast_private *ast); /* ast dp501 */ void ast_set_dp501_video_output(struct drm_device *dev, u8 mode); bool ast_backup_fw(struct drm_device *dev, u8 *addr, u32 size); diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c index 3775fe26f792..3c072c6589a2 100644 --- a/drivers/gpu/drm/ast/ast_main.c +++ b/drivers/gpu/drm/ast/ast_main.c @@ -96,6 +96,10 @@ static void ast_detect_config_mode(struct drm_device *dev, u32 *scu_rev) jregd0 = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd0, 0xff); jregd1 = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd1, 0xff); if (!(jregd0 & 0x80) || !(jregd1 & 0x10)) { + /* Patch AST2500 */ + if (((dev->pdev->revision & 0xF0) == 0x40) && ((jregd0 & 0xC0) == 0)) + patch_ahb_ast2500(ast); + /* Double check it's actually working */ data = ast_read32(ast, 0xf004); if (data != 0x) { diff --git a/drivers/gpu/drm/ast/ast_post.c b/drivers/gpu/drm/ast/ast_post.c index 8902c2f84bf9..2d121c5b2233 100644 --- a/drivers/gpu/drm/ast/ast_post.c +++ b/drivers/gpu/drm/ast/ast_post.c @@ -2026,6 +2026,33 @@ static bool ast_dram_init_2500(struct ast_private *ast) return true; } +void patch_ahb_ast2500(struct ast_private *ast) +{ + u32 data; + +patch_ahb_lock: + /* Clear bus lock condition */ + ast_moutdwm(ast, 0x1e60, 0xAEED1A03); + ast_moutdwm(ast, 0x1e600084, 0x0001); + ast_moutdwm(ast, 0x1e600088, 0x); + ast_moutdwm(ast, 0x1e6e2000, 0x1688A8A8); + data = ast_mindwm(ast, 0x1e6e2070); + if (data & 0x0800) {/* check fast reset */ + + ast_moutdwm(ast, 0x1E785004, 0x0010); + ast_moutdwm(ast, 0x1E785008, 0x4755); + ast_moutdwm(ast, 0x1E78500c, 0x0033); + udelay(1000); + } + ast_moutdwm(ast, 0x1e6e2000, 0x1688A8A8); + do { + data = ast_mindwm(ast, 0x1e6e2000); + if (data == 0x) + goto patch_ahb_lock; + } while (data != 1); + ast_moutdwm(ast, 0x1e6e207c, 0x0800); /* clear fast reset */ +} + void ast_post_chip_2500(struct drm_device *dev) { struct ast_private *ast = to_ast_private(dev); @@ -2033,39 +2060,32 @@ void ast_post_chip_2500(struct drm_device *dev) u8 reg; reg = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd0, 0xff); - if ((reg & 0x80) == 0) {/* vga only */ + if ((reg & 0xC0) == 0) {/* vga only */ /* Clear bus lock condition */ - ast_moutdwm(ast, 0x1e60, 0xAEED1A03); - ast_moutdwm(ast, 0x1e600084, 0x0001); - ast_moutdwm(ast, 0x1e600088, 0x); - ast_moutdwm(ast, 0x1e6e2000, 0x1688A8A8); - ast_write32(ast, 0xf004, 0x1e6e); - ast_write32(ast, 0xf000, 0x1); - ast_write32(ast, 0x12000, 0x1688a8a8); - while (ast_read32(ast, 0x12000) != 0x1) - ; - - ast_write32(ast, 0x1, 0xfc600309); - while (ast_read32(ast, 0x1) != 0x1) - ; + patch_ahb_ast2500(ast); + + /* Disable watchdog */ + ast_moutdwm(ast, 0x1E78502C, 0x); + ast_moutdwm(ast, 0x1E78504C, 0x); + /* Reset USB port */ + ast_moutdwm(ast, 0x1E6E2090, 0x2000); /* add at V1.2 */ + ast_moutdwm(ast, 0x1E6E2094, 0x4000); /* add at V1.2 */ + if (ast_mindwm(ast, 0x1E6E2070) & 0x0080) { /* add at V1.2 */ + ast_moutdwm(ast, 0x1E6E207C, 0x0080); /* add at
[PATCH 2/2] drm/aspeed: Use dt matching for default register values
There are minor differences in the values for the threshold value and the scan line size between families of ASPEED SoC. Additionally the SCU register for the output control differs between families. This adds device tree matching to parameterise these values, allowing us to add support for the AST2400 now, and in the future the AST2600. Signed-off-by: Joel Stanley --- drivers/gpu/drm/aspeed/aspeed_gfx.h | 7 ++-- drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c | 10 +++-- drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 48 +++- 3 files changed, 49 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx.h b/drivers/gpu/drm/aspeed/aspeed_gfx.h index f1e7e56abc02..c81d214688f2 100644 --- a/drivers/gpu/drm/aspeed/aspeed_gfx.h +++ b/drivers/gpu/drm/aspeed/aspeed_gfx.h @@ -11,6 +11,10 @@ struct aspeed_gfx { struct reset_control*rst; struct regmap *scu; + u32 dac_reg; + u32 throd_val; + u32 scan_line_max; + struct drm_simple_display_pipe pipe; struct drm_connectorconnector; }; @@ -100,6 +104,3 @@ int aspeed_gfx_create_output(struct drm_device *drm); /* CRT_THROD */ #define CRT_THROD_LOW(x) (x) #define CRT_THROD_HIGH(x) ((x) << 8) - -/* Default Threshold Seting */ -#define G5_CRT_THROD_VAL (CRT_THROD_LOW(0x24) | CRT_THROD_HIGH(0x3C)) diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c b/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c index e54686c31a90..4e8126edacbd 100644 --- a/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c +++ b/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c @@ -60,7 +60,8 @@ static void aspeed_gfx_enable_controller(struct aspeed_gfx *priv) u32 ctrl2 = readl(priv->base + CRT_CTRL2); /* SCU2C: set DAC source for display output to Graphics CRT (GFX) */ - regmap_update_bits(priv->scu, 0x2c, BIT(16), BIT(16)); + regmap_update_bits(priv->scu, priv->dac_reg, BIT(16), BIT(16)); + writel(ctrl1 | CRT_CTRL_EN, priv->base + CRT_CTRL1); writel(ctrl2 | CRT_CTRL_DAC_EN, priv->base + CRT_CTRL2); @@ -74,7 +75,7 @@ static void aspeed_gfx_disable_controller(struct aspeed_gfx *priv) writel(ctrl1 & ~CRT_CTRL_EN, priv->base + CRT_CTRL1); writel(ctrl2 & ~CRT_CTRL_DAC_EN, priv->base + CRT_CTRL2); - regmap_update_bits(priv->scu, 0x2c, BIT(16), 0); + regmap_update_bits(priv->scu, priv->dac_reg, BIT(16), 0); } static void aspeed_gfx_crtc_mode_set_nofb(struct aspeed_gfx *priv) @@ -127,7 +128,8 @@ static void aspeed_gfx_crtc_mode_set_nofb(struct aspeed_gfx *priv) * Terminal Count: memory size of one scan line */ d_offset = m->hdisplay * bpp / 8; - t_count = (m->hdisplay * bpp + 127) / 128; + t_count = DIV_ROUND_UP(m->hdisplay * bpp, priv->scan_line_max); + writel(CRT_DISP_OFFSET(d_offset) | CRT_TERM_COUNT(t_count), priv->base + CRT_OFFSET); @@ -135,7 +137,7 @@ static void aspeed_gfx_crtc_mode_set_nofb(struct aspeed_gfx *priv) * Threshold: FIFO thresholds of refill and stop (16 byte chunks * per line, rounded up) */ - writel(G5_CRT_THROD_VAL, priv->base + CRT_THROD); + writel(priv->throd_val, priv->base + CRT_THROD); } static void aspeed_gfx_pipe_enable(struct drm_simple_display_pipe *pipe, diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c index 8ada7e944147..de0f0bf82c6b 100644 --- a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c +++ b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -57,6 +58,31 @@ * which is available under NDA from ASPEED. */ +struct aspeed_gfx_config { + u32 dac_reg;/* DAC register in SCU */ + u32 throd_val; /* Default Threshold Seting */ + u32 scan_line_max; /* Max memory size of one scan line */ +}; + +static const struct aspeed_gfx_config ast2400_config = { + .dac_reg = 0x2c, + .throd_val = CRT_THROD_LOW(0x1e) | CRT_THROD_HIGH(0x12), + .scan_line_max = 64, +}; + +static const struct aspeed_gfx_config ast2500_config = { + .dac_reg = 0x2c, + .throd_val = CRT_THROD_LOW(0x24) | CRT_THROD_HIGH(0x3c), + .scan_line_max = 128, +}; + +static const struct of_device_id aspeed_gfx_match[] = { + { .compatible = "aspeed,ast2400-gfx", .data = &ast2400_config }, + { .compatible = "aspeed,ast2500-gfx", .data = &ast2500_config }, + { }, +}; +MODULE_DEVICE_TABLE(of, aspeed_gfx_of_table); + static const struct drm_mode_config_funcs aspeed_gfx_mode_config_funcs = { .fb_create = drm_gem_fb_create, .atomic_check = drm_atomic_helper_check, @@ -97,13 +123,13 @@ static irqreturn_t aspeed_gfx_irq_handler(int irq, void *data)
[PATCH 1/2] drm/aspeed: Look up syscon by phandle
This scales better to multiple families of SoC. The lookup by compatible can be removed in a future change. Signed-off-by: Joel Stanley --- drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c index 457ec04950f7..8ada7e944147 100644 --- a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c +++ b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c @@ -103,6 +103,7 @@ static int aspeed_gfx_load(struct drm_device *drm) { struct platform_device *pdev = to_platform_device(drm->dev); struct aspeed_gfx *priv = to_aspeed_gfx(drm); + struct device_node *np = pdev->dev.of_node; struct resource *res; int ret; @@ -111,10 +112,13 @@ static int aspeed_gfx_load(struct drm_device *drm) if (IS_ERR(priv->base)) return PTR_ERR(priv->base); - priv->scu = syscon_regmap_lookup_by_compatible("aspeed,ast2500-scu"); + priv->scu = syscon_regmap_lookup_by_phandle(np, "syscon"); if (IS_ERR(priv->scu)) { - dev_err(&pdev->dev, "failed to find SCU regmap\n"); - return PTR_ERR(priv->scu); + priv->scu = syscon_regmap_lookup_by_compatible("aspeed,aspeed-scu"); + if (IS_ERR(priv->scu)) { + dev_err(&pdev->dev, "failed to find SCU regmap\n"); + return PTR_ERR(priv->scu); + } } ret = of_reserved_mem_device_init(drm->dev); -- 2.29.2 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 0/2] drm: aspeed: Support more chip families
The out of tree vendor driver was recently updated to support the ast2400 and ast2600. These patches begin to add that support to the mainline driver. With these two cleanups it should be easier to support different families of BMC system on chip with this driver. I will merge them through drm-misc once they have been reviewed. Joel Stanley (2): drm/aspeed: Look up syscon by phandle drm/aspeed: Use dt matching for default register values drivers/gpu/drm/aspeed/aspeed_gfx.h | 7 +-- drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c | 10 ++-- drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 58 +++- 3 files changed, 56 insertions(+), 19 deletions(-) -- 2.29.2 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
linux-next: build warnings after merge of the amdgpu tree
Hi all, After merging the amdgpu tree, today's linux-next build (htmldocs) produced these warnings: drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:340: warning: Incorrect use of kernel-doc format: * @active_vblank_irq_count drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:379: warning: Function parameter or member 'active_vblank_irq_count' not described in 'amdgpu_display_manager' Introduced by commit 71338cb4a7c2 ("drm/amd/display: enable idle optimizations for linux (MALL stutter)") -- Cheers, Stephen Rothwell pgpErDLRPfxQF.pgp Description: OpenPGP digital signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 211033] [bisected][regression] amdgpu: *ERROR* Restoring old state failed with -12
https://bugzilla.kernel.org/show_bug.cgi?id=211033 --- Comment #10 from Artur Bac (arturbac...@gmail.com) --- 5.10.6 works ok again with 2 monitors and Sapphire Nitro+ Radeon RX 5700 XT here is dmesg output of drm on 5.10.6 [3.471791] systemd[1]: Starting Load Kernel Module drm... [3.482194] systemd[1]: modprobe@drm.service: Succeeded. [3.482336] systemd[1]: Finished Load Kernel Module drm. [3.562351] [drm] amdgpu kernel modesetting enabled. [3.563495] [drm] initializing kernel modesetting (NAVI10 0x1002:0x731F 0x1DA2:0xE409 0xC1). [3.563505] [drm] register mmio base: 0xFCC0 [3.563506] [drm] register mmio size: 524288 [3.564808] [drm] add ip block number 0 [3.564810] [drm] add ip block number 1 [3.564811] [drm] add ip block number 2 [3.564812] [drm] add ip block number 3 [3.564813] [drm] add ip block number 4 [3.564814] [drm] add ip block number 5 [3.564815] [drm] add ip block number 6 [3.564816] [drm] add ip block number 7 [3.564817] [drm] add ip block number 8 [3.564818] [drm] add ip block number 9 [3.564848] [drm] VCN decode is enabled in VM mode [3.564849] [drm] VCN encode is enabled in VM mode [3.564850] [drm] JPEG decode is enabled in VM mode [3.564865] [drm] vm size is 262144 GB, 4 levels, block size is 9-bit, fragment size is 9-bit [3.564878] [drm] Detected VRAM RAM=8176M, BAR=256M [3.564879] [drm] RAM width 256bits GDDR6 [3.564935] [drm] amdgpu: 8176M of VRAM memory ready [3.564937] [drm] amdgpu: 8176M of GTT memory ready. [3.564938] [drm] GART: num cpu pages 131072, num gpu pages 131072 [3.565069] [drm] PCIE GART of 512M enabled (table at 0x00800090). [3.588344] [drm] Found VCN firmware Version ENC: 1.10 DEC: 5 VEP: 0 Revision: 13 [3.588351] [drm] PSP loading VCN firmware [4.166778] [drm] reserve 0x90 from 0x81fe40 for PSP TMR [4.412518] [drm] Display Core initialized with v3.2.104! [4.625413] [drm] kiq ring mec 2 pipe 1 q 0 [4.634394] [drm] VCN decode and encode initialized successfully(under DPG Mode). [4.634532] [drm] JPEG decode initialized successfully. [4.639105] [drm] fb mappable at 0xE0B0A000 [4.639107] [drm] vram apper at 0xE000 [4.639108] [drm] size 33177600 [4.639110] [drm] fb depth is 24 [4.639111] [drm]pitch is 15360 [4.639171] fbcon: amdgpudrmfb (fb0) is primary device [4.791132] amdgpu :0f:00.0: [drm] fb0: amdgpudrmfb frame buffer device [4.816294] [drm] Initialized amdgpu 3.40.0 20150101 for :0f:00.0 on minor 0 -- You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: linux-next: build failure after merge of the drm tree
Hi all, On Fri, 8 Jan 2021 12:25:40 +1100 Stephen Rothwell wrote: > > On Fri, 8 Jan 2021 11:55:18 +1100 Stephen Rothwell > wrote: > > > > After merging the drm tree, today's linux-next build (x86_64 allmodconfig) > > failed like this: > > > > error: the following would cause module name conflict: > > drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.ko > > drivers/gpu/drm/panel/panel-dsi-cm.ko > > > > Maybe caused by commit > > > > cf64148abcfd ("drm/panel: Move OMAP's DSI command mode panel driver") > > > > I have used the drm tree from next-20210107 for today. > > This has affected the drm-misc tree as well (since it merged in the drm > tree). > > I have used the drm-misc tree from next-20210107 for today. And now the drm-intel tree. I have used the drm-intel tree from next-20210108 for today. -- Cheers, Stephen Rothwell pgpVFD8Ke_A3z.pgp Description: OpenPGP digital signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v1] drm/panel: simple: add SGD GKTW70SDAD1SD
On Sun, Jan 10, 2021 at 5:09 PM Oliver Graute wrote: > here the schematics and my dts. The board is using a LVDS connector for > the display. The schematics shows the GKTW70SDAD1SD panel in the J4 connector, not the LVDS J7 connector. > https://www.variscite.de/wp-content/uploads/2017/12/VAR-6ULCustomboard-Schematics.pdf > https://lore.kernel.org/linux-arm-kernel/1610144511-19018-3-git-send-email-oliver.gra...@gmail.com/ As I mentioned earlier you should remove the display timings from the dts when using the compatible string for the panel. power-supply = <®_touch_3v3> is not correct, as the reg_touch_3v3 does not power the LCD. Another hint is to use the PLL5_VIDEO as the clock source for the lcdif controller as done in the imx6ul evk dtsi. It would also help if you could share the complete boot log. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 208947] amdgpu DisplayPort won't recognize all display modes after 5.9 merges
https://bugzilla.kernel.org/show_bug.cgi?id=208947 --- Comment #21 from JerryD (jvdeli...@charter.net) --- Created attachment 294599 --> https://bugzilla.kernel.org/attachment.cgi?id=294599&action=edit dmesg from 5.10.5 kernel I bummped up to the 5.10.5 kernel. The laptop suspends on lid close and comes back when opened. However, there are two call traces from issues ocurring, so I would not consider this resolved, however the kenel is recovering from it. The actual bug is probably in the amdgpu driver, but leave that to the experts. -- You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[drm:dm_plane_helper_prepare_fb [amdgpu]] *ERROR* Failed to pin framebuffer with error -12
Hi folks, today I joined to testing Kernel 5.11 and saw that the kernel log was flooded with BUG messages: BUG: sleeping function called from invalid context at mm/vmalloc.c:1756 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 266, name: kswapd0 INFO: lockdep is turned off. CPU: 15 PID: 266 Comm: kswapd0 Tainted: GW- --- 5.11.0-0.rc2.20210108gitf5e6c330254a.119.fc34.x86_64 #1 Hardware name: System manufacturer System Product Name/ROG STRIX X570-I GAMING, BIOS 2802 10/21/2020 Call Trace: dump_stack+0x8b/0xb0 ___might_sleep.cold+0xb6/0xc6 vm_unmap_aliases+0x21/0x40 change_page_attr_set_clr+0x9e/0x190 set_memory_wb+0x2f/0x80 ttm_pool_free_page+0x28/0x90 [ttm] ttm_pool_shrink+0x45/0xb0 [ttm] ttm_pool_shrinker_scan+0xa/0x20 [ttm] do_shrink_slab+0x177/0x3a0 shrink_slab+0x9c/0x290 shrink_node+0x2e6/0x700 balance_pgdat+0x2f5/0x650 kswapd+0x21d/0x4d0 ? do_wait_intr_irq+0xd0/0xd0 ? balance_pgdat+0x650/0x650 kthread+0x13a/0x150 ? __kthread_bind_mask+0x60/0x60 ret_from_fork+0x22/0x30 But the most unpleasant thing is that after a while the monitor turns off and does not go on again until the restart. This is accompanied by an entry in the kernel log: amdgpu :0b:00.0: amdgpu: ff7d8b94 pin failed [drm:dm_plane_helper_prepare_fb [amdgpu]] *ERROR* Failed to pin framebuffer with error -12 $ grep "Failed to pin framebuffer with error" -Rn . ./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:5816: DRM_ERROR("Failed to pin framebuffer with error %d\n", r); $ git blame -L 5811,5821 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c Blaming lines: 0% (11/9167), done. 5d43be0ccbc2f (Christian König 2017-10-26 18:06:23 +0200 5811) domain = AMDGPU_GEM_DOMAIN_VRAM; e7b07ceef2a65 (Harry Wentland 2017-08-10 13:29:07 -0400 5812) 7b7c6c81b3a37 (Junwei Zhang2018-06-25 12:51:14 +0800 5813) r = amdgpu_bo_pin(rbo, domain); e7b07ceef2a65 (Harry Wentland 2017-08-10 13:29:07 -0400 5814) if (unlikely(r != 0)) { 30b7c6147d18d (Harry Wentland 2017-10-26 15:35:14 -0400 5815) if (r != -ERESTARTSYS) 30b7c6147d18d (Harry Wentland 2017-10-26 15:35:14 -0400 5816) DRM_ERROR("Failed to pin framebuffer with error %d\n", r); 0f257b09531b4 (Chunming Zhou 2019-05-07 19:45:31 +0800 5817) ttm_eu_backoff_reservation(&ticket, &list); e7b07ceef2a65 (Harry Wentland 2017-08-10 13:29:07 -0400 5818) return r; e7b07ceef2a65 (Harry Wentland 2017-08-10 13:29:07 -0400 5819) } e7b07ceef2a65 (Harry Wentland 2017-08-10 13:29:07 -0400 5820) bb812f1ea87dd (Junwei Zhang2018-06-25 13:32:24 +0800 5821) r = amdgpu_ttm_alloc_gart(&rbo->tbo); Who knows how to fix it? Full kernel logs is here: [1] https://pastebin.com/fLasjDHX [2] https://pastebin.com/g3wR2r9e -- Best Regards, Mike Gavrilov. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 209987] Memory leak in amdgpu_dm_update_connector_after_detect
https://bugzilla.kernel.org/show_bug.cgi?id=209987 --- Comment #10 from youling...@gmail.com --- I can't stand memory leak, i will revert "Revert "drm/amd/display: Fix memory leaks in S3 resume"" revert 5efc1f4b454c6179d35e7b0c3eda0ad5763a00fc in today linux 5.11-rc3. i use rc kernel every week. -- You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v1] drm/panel: simple: add SGD GKTW70SDAD1SD
Hi Oliver, On Sun, Jan 10, 2021 at 12:35 PM Oliver Graute wrote: > the first two errors are gone. But I still get this: > > [ 42.387107] mxsfb 21c8000.lcdif: Cannot connect bridge: -517 > > The panel is still off perhaps I miss something else. Some suggestions: - Take a look at arch/arm/boot/dts/imx6ul-14x14-evk.dtsi as a reference as it has display functional - Use imx_v6_v7_defconfig to make sure all the required drivers are selected - If it still does not work, share the dts and schematics ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH V4 3/3] drm/vkms: Add information about module options
Update vkms documentation to contain usage of `modinfo` command and steps to load vkms with module options enabled. Signed-off-by: Sumera Priyadarsini --- Documentation/gpu/vkms.rst | 10 ++ 1 file changed, 10 insertions(+) diff --git a/Documentation/gpu/vkms.rst b/Documentation/gpu/vkms.rst index 9e030c74a82e..45fe02f643a8 100644 --- a/Documentation/gpu/vkms.rst +++ b/Documentation/gpu/vkms.rst @@ -35,6 +35,16 @@ Now, to load the driver, use:: On running the lsmod command now, the VKMS driver will appear listed. You can also observe the driver being loaded in the dmesg logs. +You can use the `modinfo` command to see module options for vkms:: + + modinfo vkms + +Module options are helpful when testing, and enabling modules +can be done while loading vkms. For example, to load vkms with cursor enabled, +use:: + + sudo modprobe vkms enable_cursor=1 + To disable the driver, use :: sudo modprobe -r vkms -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH V4 2/3] drm/vkms: Add support for writeback module
Add enable_writeback feature to vkms_config as a module. Signed-off-by: Sumera Priyadarsini --- drivers/gpu/drm/vkms/vkms_drv.c| 5 + drivers/gpu/drm/vkms/vkms_drv.h| 1 + drivers/gpu/drm/vkms/vkms_output.c | 9 ++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c index 6b33975a5cb2..708f7f54001d 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.c +++ b/drivers/gpu/drm/vkms/vkms_drv.c @@ -40,6 +40,10 @@ static bool enable_cursor = true; module_param_named(enable_cursor, enable_cursor, bool, 0444); MODULE_PARM_DESC(enable_cursor, "Enable/Disable cursor support"); +static bool enable_writeback = true; +module_param_named(enable_writeback, enable_writeback, bool, 0444); +MODULE_PARM_DESC(enable_writeback, "Enable/Disable writeback connector support"); + DEFINE_DRM_GEM_FOPS(vkms_driver_fops); static void vkms_release(struct drm_device *dev) @@ -189,6 +193,7 @@ static int __init vkms_init(void) default_config = config; config->cursor = enable_cursor; + config->writeback = enable_writeback; return vkms_create(config); } diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h index 6a27bd8875f2..b9b4e2bc11c0 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.h +++ b/drivers/gpu/drm/vkms/vkms_drv.h @@ -83,6 +83,7 @@ struct vkms_output { struct vkms_device; struct vkms_config { + bool writeback; bool cursor; /* only set when instantiated */ struct vkms_device *dev; diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c index 8f3ffb28b9d1..f5f6f15c362c 100644 --- a/drivers/gpu/drm/vkms/vkms_output.c +++ b/drivers/gpu/drm/vkms/vkms_output.c @@ -41,6 +41,7 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index) struct drm_crtc *crtc = &output->crtc; struct drm_plane *primary, *cursor = NULL; int ret; + int writeback; primary = vkms_plane_init(vkmsdev, DRM_PLANE_TYPE_PRIMARY, index); if (IS_ERR(primary)) @@ -80,9 +81,11 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index) goto err_attach; } - ret = vkms_enable_writeback_connector(vkmsdev); - if (ret) - DRM_ERROR("Failed to init writeback connector\n"); + if (vkmsdev->config->writeback) { + writeback = vkms_enable_writeback_connector(vkmsdev); + if (writeback) + DRM_ERROR("Failed to init writeback connector\n"); + } drm_mode_config_reset(dev); -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH V4 1/3] drm/vkms: Add vkms_config type
Currently, data for the device instance is held by vkms_device. Add a separate type, vkms_config to contain configuration details for the device and various modes to be later used by configfs. This config data stays constant once the device is created. Accordingly, add vkms_create and vkms_destroy to initialize/destroy device through configfs. Currently, they are being called from vkms_init and vkms_exit, but will be evoked from configfs later on. When configfs is added, device configuration will be tracked by configfs and only vkms device lifetime will be handled by vkms_init and vkms_exit functions. Modify usage of enable_cursor feature to reflect the changes in relevant files. Co-developed-by: Daniel Vetter Signed-off-by: Daniel Vetter Signed-off-by: Sumera Priyadarsini --- drivers/gpu/drm/vkms/vkms_drv.c| 40 -- drivers/gpu/drm/vkms/vkms_drv.h| 12 +++-- drivers/gpu/drm/vkms/vkms_output.c | 4 +-- 3 files changed, 44 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c index aef29393b811..6b33975a5cb2 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.c +++ b/drivers/gpu/drm/vkms/vkms_drv.c @@ -34,9 +34,9 @@ #define DRIVER_MAJOR 1 #define DRIVER_MINOR 0 -static struct vkms_device *vkms_device; +static struct vkms_config *default_config; -bool enable_cursor = true; +static bool enable_cursor = true; module_param_named(enable_cursor, enable_cursor, bool, 0444); MODULE_PARM_DESC(enable_cursor, "Enable/Disable cursor support"); @@ -122,10 +122,11 @@ static int vkms_modeset_init(struct vkms_device *vkmsdev) return vkms_output_init(vkmsdev, 0); } -static int __init vkms_init(void) +static int vkms_create(struct vkms_config *config) { int ret; struct platform_device *pdev; + struct vkms_device *vkms_device; pdev = platform_device_register_simple(DRIVER_NAME, -1, NULL, 0); if (IS_ERR(pdev)) @@ -143,6 +144,8 @@ static int __init vkms_init(void) goto out_devres; } vkms_device->platform = pdev; + vkms_device->config = config; + config->dev = vkms_device; ret = dma_coerce_mask_and_coherent(vkms_device->drm.dev, DMA_BIT_MASK(64)); @@ -179,21 +182,42 @@ static int __init vkms_init(void) return ret; } -static void __exit vkms_exit(void) +static int __init vkms_init(void) +{ + struct vkms_config *config = kmalloc(sizeof(*config), GFP_KERNEL); + + default_config = config; + + config->cursor = enable_cursor; + + return vkms_create(config); +} + +static void vkms_destroy(struct vkms_config *config) { struct platform_device *pdev; - if (!vkms_device) { + if (!config->dev) { DRM_INFO("vkms_device is NULL.\n"); return; } - pdev = vkms_device->platform; + pdev = config->dev->platform; - drm_dev_unregister(&vkms_device->drm); - drm_atomic_helper_shutdown(&vkms_device->drm); + drm_dev_unregister(&config->dev->drm); + drm_atomic_helper_shutdown(&config->dev->drm); devres_release_group(&pdev->dev, NULL); platform_device_unregister(pdev); + + config->dev = NULL; +} + +static void __exit vkms_exit(void) +{ + if (default_config->dev) + vkms_destroy(default_config); + + kfree(default_config); } module_init(vkms_init); diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h index 5ed91ff08cb3..6a27bd8875f2 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.h +++ b/drivers/gpu/drm/vkms/vkms_drv.h @@ -19,8 +19,6 @@ #define XRES_MAX 8192 #define YRES_MAX 8192 -extern bool enable_cursor; - struct vkms_composer { struct drm_framebuffer fb; struct drm_rect src, dst; @@ -82,10 +80,19 @@ struct vkms_output { spinlock_t composer_lock; }; +struct vkms_device; + +struct vkms_config { + bool cursor; + /* only set when instantiated */ + struct vkms_device *dev; +}; + struct vkms_device { struct drm_device drm; struct platform_device *platform; struct vkms_output output; + const struct vkms_config *config; }; #define drm_crtc_to_vkms_output(target) \ @@ -124,3 +131,4 @@ void vkms_set_composer(struct vkms_output *out, bool enabled); int vkms_enable_writeback_connector(struct vkms_device *vkmsdev); #endif /* _VKMS_DRV_H_ */ + diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c index 4a1848b0318f..8f3ffb28b9d1 100644 --- a/drivers/gpu/drm/vkms/vkms_output.c +++ b/drivers/gpu/drm/vkms/vkms_output.c @@ -46,7 +46,7 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index) if (IS_ERR(primary)) return PTR_ERR(primary); - if (enable_cursor) { + if (vkmsdev->config->cursor) { cursor = vkms_plane_init(vkmsdev, DRM_PLAN
[PATCH V4 0/3] Decouple config data for configfs
This patchset aims to lay down some prep work before configfs can be implemented for the vkms driver. The first patch in the series adds a new type vkms_config to track device configuration. The second and third patch add module testing support for writeback operations. The first patch is developed by Daniel Vetter. Daniel Vetter (1): drm/vkms: Add vkms_config type Sumera Priyadarsini (3): drm/vkms: Add vkms_config type drm/vkms: Add support for writeback module drm/vkms: Add information about module options Documentation/gpu/vkms.rst | 10 +++ drivers/gpu/drm/vkms/vkms_drv.c| 45 -- drivers/gpu/drm/vkms/vkms_drv.h| 13 +++-- drivers/gpu/drm/vkms/vkms_output.c | 13 + 4 files changed, 66 insertions(+), 15 deletions(-) --- Changes in v2: - add Co-developed-by tag Changes in v3: - correct usage of Co-developed by tag(Melissa) - add enable_writeback_feature(Melissa) - modify commit message(Melissa) Changes in v4: - split previous patch into patchset(Melissa) - fix checkpatch issue(Melissa) - update docs(Daniel) -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/fourcc: fix Amlogic format modifier masks
The comment says the layout and options use 8 bits, and the shift uses 8 bits. However the mask is 0xf, ie. 0b (4 bits). This could be surprising when introducing new layouts or options that take more than 4 bits, as this would silently drop the high bits. Make the masks consistent with the comment and the shift. Found when writing a drm_info patch [1]. [1]: https://github.com/ascent12/drm_info/pull/67 Signed-off-by: Simon Ser Fixes: d6528ec88309 ("drm/fourcc: Add modifier definitions for describing Amlogic Video Framebuffer Compression") Cc: Neil Armstrong Cc: Sam Ravnborg Cc: Kevin Hilman Cc: Daniel Vetter --- include/uapi/drm/drm_fourcc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index 723c8e23ca87..5f42a14481bd 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/drm/drm_fourcc.h @@ -1036,9 +1036,9 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier) * Not all combinations are valid, and different SoCs may support different * combinations of layout and options. */ -#define __fourcc_mod_amlogic_layout_mask 0xf +#define __fourcc_mod_amlogic_layout_mask 0xff #define __fourcc_mod_amlogic_options_shift 8 -#define __fourcc_mod_amlogic_options_mask 0xf +#define __fourcc_mod_amlogic_options_mask 0xff #define DRM_FORMAT_MOD_AMLOGIC_FBC(__layout, __options) \ fourcc_mod_code(AMLOGIC, \ -- 2.30.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v8] backlight: lms283gf05: Convert to GPIO descriptors
This converts the lms283gf05 backlight driver to use GPIO descriptors and switches the single PXA Palm Z2 device over to defining these. Since the platform data was only used to convey GPIO information we can delete the platform data header. Notice that we define the proper active low semantics in the board file GPIO descriptor table (active low) and assert the reset line by bringing it to "1" (asserted). Cc: Marek Vasut Cc: Daniel Mack Cc: Haojian Zhuang Cc: Robert Jarzmik Reviewed-by: Daniel Thompson Signed-off-by: Linus Walleij --- ChangeLog v7->v8: - Rebase onto v5.11-rc1 - I wonder why this never seems to get merged...? ChangeLog v6->v7: - Rebase onto v5.10-rc1 ChangeLog v5->v6: - Rebase onto v5.9-rc1 ChangeLog v4->v5: - Rebase on v5.8-rc1 - Collected Daniel's Reviewed-by tag. ChangeLog v3->v4: - Check IS_ERR() on the returned GPIO descriptor. - Unconditionally set consumer name since the API tolerates NULL. ChangeLog v2->v3: - Fix a use-before-allocated bug discovered by compile tests. - Remove unused ret variable as autobuilders complained. ChangeLog v1->v2: - Bring up the GPIO de-asserted in probe() Marek: I saw this was written by you, are you regularly testing the Z2 device? --- arch/arm/mach-pxa/z2.c | 12 +--- drivers/video/backlight/lms283gf05.c | 43 +++- include/linux/spi/lms283gf05.h | 16 --- 3 files changed, 25 insertions(+), 46 deletions(-) delete mode 100644 include/linux/spi/lms283gf05.h diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c index 21fd76bb09cd..89eb5243c85f 100644 --- a/arch/arm/mach-pxa/z2.c +++ b/arch/arm/mach-pxa/z2.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -578,8 +577,13 @@ static struct pxa2xx_spi_chip lms283_chip_info = { .gpio_cs= GPIO88_ZIPITZ2_LCD_CS, }; -static const struct lms283gf05_pdata lms283_pdata = { - .reset_gpio = GPIO19_ZIPITZ2_LCD_RESET, +static struct gpiod_lookup_table lms283_gpio_table = { + .dev_id = "spi2.0", /* SPI bus 2 chip select 0 */ + .table = { + GPIO_LOOKUP("gpio-pxa", GPIO19_ZIPITZ2_LCD_RESET, + "reset", GPIO_ACTIVE_LOW), + { }, + }, }; static struct spi_board_info spi_board_info[] __initdata = { @@ -595,7 +599,6 @@ static struct spi_board_info spi_board_info[] __initdata = { { .modalias = "lms283gf05", .controller_data= &lms283_chip_info, - .platform_data = &lms283_pdata, .max_speed_hz = 40, .bus_num= 2, .chip_select= 0, @@ -615,6 +618,7 @@ static void __init z2_spi_init(void) { pxa2xx_set_spi_info(1, &pxa_ssp1_master_info); pxa2xx_set_spi_info(2, &pxa_ssp2_master_info); + gpiod_add_lookup_table(&lms283_gpio_table); spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); } #else diff --git a/drivers/video/backlight/lms283gf05.c b/drivers/video/backlight/lms283gf05.c index 0e45685bcc1c..36856962ed83 100644 --- a/drivers/video/backlight/lms283gf05.c +++ b/drivers/video/backlight/lms283gf05.c @@ -9,16 +9,16 @@ #include #include #include -#include +#include #include #include -#include #include struct lms283gf05_state { struct spi_device *spi; struct lcd_device *ld; + struct gpio_desc*reset; }; struct lms283gf05_seq { @@ -90,13 +90,13 @@ static const struct lms283gf05_seq disp_pdwnseq[] = { }; -static void lms283gf05_reset(unsigned long gpio, bool inverted) +static void lms283gf05_reset(struct gpio_desc *gpiod) { - gpio_set_value(gpio, !inverted); + gpiod_set_value(gpiod, 0); /* De-asserted */ mdelay(100); - gpio_set_value(gpio, inverted); + gpiod_set_value(gpiod, 1); /* Asserted */ mdelay(20); - gpio_set_value(gpio, !inverted); + gpiod_set_value(gpiod, 0); /* De-asserted */ mdelay(20); } @@ -125,18 +125,15 @@ static int lms283gf05_power_set(struct lcd_device *ld, int power) { struct lms283gf05_state *st = lcd_get_data(ld); struct spi_device *spi = st->spi; - struct lms283gf05_pdata *pdata = dev_get_platdata(&spi->dev); if (power <= FB_BLANK_NORMAL) { - if (pdata) - lms283gf05_reset(pdata->reset_gpio, - pdata->reset_inverted); + if (st->reset) + lms283gf05_reset(st->reset); lms283gf05_toggle(spi, disp_initseq, ARRAY_SIZE(disp_initseq)); } else { lms283gf05_toggle(spi, disp_pdwnseq, ARRAY_SIZE(disp_pdwnseq)); - if (pdata) - gpio_set_value(pdata->reset_gpio, - pdata->reset_inverted); + if (st->reset) + gpiod_set_value(st->