drm/kmb: Work around for higher system clock
Subsystems (2)
Anitha Chrisanthus
maintainerPATCH v3 1/7 drm/kmb: Work around for higher system clock
Use a different value for system clock offset in the ppl/llp ratio calculations for clocks higher than 500 Mhz.
--- drivers/gpu/drm/kmb/kmb_dsi.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/gpu/drm/kmb/kmb_dsi.c +10 -1
@@ -482,6 +482,10 @@ static u32 mipi_tx_fg_section_cfg(struct kmb_dsi *kmb_dsi,return 0 ; } +#define CLK_DIFF_LOW 50 +#define CLK_DIFF_HI 60 +#define SYSCLK_500 500 +static void mipi_tx_fg_cfg_regs (struct kmb_dsi *kmb_dsi,u8 frame_gen,struct mipi_tx_frame_timing_cfg *fg_cfg) {
@@ -492,7 +496,12 @@ static void mipi_tx_fg_cfg_regs(struct kmb_dsi *kmb_dsi, u8 frame_gen,/* 500 Mhz system clock minus 50 to account for the difference in * MIPI clock speed in RTL tests */ - sysclk = kmb_dsi->sys_clk_mhz -50 ; +if (kmb_dsi->sys_clk_mhz ==SYSCLK_500 ) { + sysclk = kmb_dsi->sys_clk_mhz -CLK_DIFF_LOW ; + }else { +/* 700 Mhz clk*/ + sysclk = kmb_dsi->sys_clk_mhz -CLK_DIFF_HI ; + }/* PPL-Pixel Packing Layer, LLP-Low Level Protocol * Frame genartor timing parameters are clocked on the system clock,
Signature · 1 line
2.25.1
Anitha Chrisanthus
maintainerPATCH v3 2/7 drm/kmb: Limit supported mode to 1080p
KMB only supports single resolution(1080p), this commit checks for 1920x1080x60 or 1920x1080x59 in crtc_mode_valid.
Also, modes with vfp < 4 are not supported in KMB display. This change prunes display modes with vfp < 4.
v2: added vfp check
--- drivers/gpu/drm/kmb/kmb_crtc.c | 34 ++++++++++++++++++++++++++++++++++ drivers/gpu/drm/kmb/kmb_drv.h | 13 ++++++++++--- 2 files changed, 44 insertions(+), 3 deletions(-)
drivers/gpu/drm/kmb/kmb_crtc.c +34 -0
@@ -185,11 +185,45 @@ static void kmb_crtc_atomic_flush(struct drm_crtc *crtc,spin_unlock_irq (&crtc->dev->event_lock); } +static enum drm_mode_status +kmb_crtc_mode_valid (struct drm_crtc *crtc, +const struct drm_display_mode *mode) +{ +int refresh; +struct drm_device *dev = crtc->dev; +int vfp = mode->vsync_start - mode->vdisplay; + +if (mode->vdisplay <KMB_CRTC_MAX_HEIGHT ) { +drm_dbg (dev,"height = %d less than %d" , + mode->vdisplay,KMB_CRTC_MAX_HEIGHT ); +return MODE_BAD_VVALUE ; + } +if (mode->hdisplay <KMB_CRTC_MAX_WIDTH ) { +drm_dbg (dev,"width = %d less than %d" , + mode->hdisplay,KMB_CRTC_MAX_WIDTH ); +return MODE_BAD_HVALUE ; + } + refresh =drm_mode_vrefresh (mode); +if (refresh <KMB_MIN_VREFRESH || refresh >KMB_MAX_VREFRESH ) { +drm_dbg (dev,"refresh = %d less than %d or greater than %d" , + refresh,KMB_MIN_VREFRESH ,KMB_MAX_VREFRESH ); +return MODE_BAD ; + } + +if (vfp <KMB_CRTC_MIN_VFP ) { +drm_dbg (dev,"vfp = %d less than %d" , vfp,KMB_CRTC_MIN_VFP ); +return MODE_BAD ; + } + +return MODE_OK ; +} +static const struct drm_crtc_helper_funcs kmb_crtc_helper_funcs = { .atomic_begin = kmb_crtc_atomic_begin, .atomic_enable = kmb_crtc_atomic_enable, .atomic_disable = kmb_crtc_atomic_disable, .atomic_flush = kmb_crtc_atomic_flush, + .mode_valid = kmb_crtc_mode_valid, };int kmb_setup_crtc (struct drm_device *drm)
drivers/gpu/drm/kmb/kmb_drv.h +10 -3
@@ -18,13 +18,20 @@#define DRIVER_DATE "20210223"#define DRIVER_MAJOR 1 -#define DRIVER_MINOR 1 - +#define DRIVER_MINOR 2 + +/* Platform definitions */ +#define KMB_CRTC_MIN_VFP 4 +#define KMB_CRTC_MAX_WIDTH 1920/* max width in pixels */ +#define KMB_CRTC_MAX_HEIGHT 1080/* max height in pixels */ +#define KMB_CRTC_MIN_WIDTH 1920 +#define KMB_CRTC_MIN_HEIGHT 1080#define KMB_FB_MAX_WIDTH 1920#define KMB_FB_MAX_HEIGHT 1080#define KMB_FB_MIN_WIDTH 1#define KMB_FB_MIN_HEIGHT 1 - +#define KMB_MIN_VREFRESH 59/*vertical refresh in Hz */ +#define KMB_MAX_VREFRESH 60/*vertical refresh in Hz */ #define KMB_LCD_DEFAULT_CLK 200000000#define KMB_SYS_CLK_MHZ 500
Signature · 1 line
2.25.1
Re: [PATCH v3 2/7] drm/kmb: Limit supported mode to 1080p
Quoted 10 lines · Anitha Chrisanthus
KMB only supports single resolution(1080p), this commit checks for 1920x1080x60 or 1920x1080x59 in
crtc_mode_valid.
Also, modes with vfp < 4 are not supported in KMB display. This change prunes display modes with vfp < 4.v2: added vfp check
Fixes 7f7b96a8a0a1 ("drm/kmb: Add support for KeemBay Display")Signed-off-by Anitha Chrisanthus <[email protected]>Signed-off-by Edmund Dea <[email protected]>
This looks wrong. I assume it Edmund also did some development work so you should also add:
One nit below. With these nits fixed:
Sam
Quoted 60 lines
--- drivers/gpu/drm/kmb/kmb_crtc.c | 34 ++++++++++++++++++++++++++++++++++ drivers/gpu/drm/kmb/kmb_drv.h | 13 ++++++++++--- 2 files changed, 44 insertions(+), 3 deletions(-)drivers/gpu/drm/kmb/kmb_crtc.c +34
-0@@ -185,11 +185,45 @@ static void kmb_crtc_atomic_flush(struct drm_crtc *crtc,spin_unlock_irq (&crtc->dev->event_lock); } +static enum drm_mode_status +kmb_crtc_mode_valid (struct drm_crtc *crtc, +const struct drm_display_mode *mode) +{ +int refresh; +struct drm_device *dev = crtc->dev; +int vfp = mode->vsync_start - mode->vdisplay; + +if (mode->vdisplay <KMB_CRTC_MAX_HEIGHT ) { +drm_dbg (dev,"height = %d less than %d" , + mode->vdisplay,KMB_CRTC_MAX_HEIGHT ); +return MODE_BAD_VVALUE ; + } +if (mode->hdisplay <KMB_CRTC_MAX_WIDTH ) { +drm_dbg (dev,"width = %d less than %d" , + mode->hdisplay,KMB_CRTC_MAX_WIDTH ); +return MODE_BAD_HVALUE ; + } + refresh =drm_mode_vrefresh (mode); +if (refresh <KMB_MIN_VREFRESH || refresh >KMB_MAX_VREFRESH ) { +drm_dbg (dev,"refresh = %d less than %d or greater than %d" , + refresh,KMB_MIN_VREFRESH ,KMB_MAX_VREFRESH ); +return MODE_BAD ; + } + +if (vfp <KMB_CRTC_MIN_VFP ) { +drm_dbg (dev,"vfp = %d less than %d" , vfp,KMB_CRTC_MIN_VFP ); +return MODE_BAD ; + } + +return MODE_OK ; +} +static const struct drm_crtc_helper_funcs kmb_crtc_helper_funcs = { .atomic_begin = kmb_crtc_atomic_begin, .atomic_enable = kmb_crtc_atomic_enable, .atomic_disable = kmb_crtc_atomic_disable, .atomic_flush = kmb_crtc_atomic_flush, + .mode_valid = kmb_crtc_mode_valid, };int kmb_setup_crtc (struct drm_device *drm)drivers/gpu/drm/kmb/kmb_drv.h +0
-0
drivers/gpu/drm/kmb/kmb_drv.h line 21
Quoted 6 lines
drivers/gpu/drm/kmb/kmb_drv.h +1
-2@@ -18,13 +18,20 @@#define DRIVER_DATE "20210223"#define DRIVER_MAJOR 1 -#define DRIVER_MINOR 1 - +#define DRIVER_MINOR 2
This change looks un-related.
Quoted 19 lines
drivers/gpu/drm/kmb/kmb_drv.h +9
-1+ +/* Platform definitions */ +#define KMB_CRTC_MIN_VFP 4 +#define KMB_CRTC_MAX_WIDTH 1920/* max width in pixels */ +#define KMB_CRTC_MAX_HEIGHT 1080/* max height in pixels */ +#define KMB_CRTC_MIN_WIDTH 1920 +#define KMB_CRTC_MIN_HEIGHT 1080#define KMB_FB_MAX_WIDTH 1920#define KMB_FB_MAX_HEIGHT 1080#define KMB_FB_MIN_WIDTH 1#define KMB_FB_MIN_HEIGHT 1 - +#define KMB_MIN_VREFRESH 59/*vertical refresh in Hz */ +#define KMB_MAX_VREFRESH 60/*vertical refresh in Hz */ #define KMB_LCD_DEFAULT_CLK 200000000#define KMB_SYS_CLK_MHZ 500Signature · 1 line
2.25.1
Anitha Chrisanthus
maintainerPATCH v3 3/7 drm/kmb: Remove clearing DPHY regs
In reply to Anitha ChrisanthusFrom: Edmund Dea <[email protected]>
Don't clear the shared DPHY registers common to MIPI Rx and MIPI Tx during DSI initialization since this was causing MIPI Rx reset. Rest of the writes are bitwise, so will not affect Mipi Rx side.
--- drivers/gpu/drm/kmb/kmb_dsi.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/gpu/drm/kmb/kmb_dsi.c +0 -5
@@ -1393,11 +1393,6 @@ int kmb_dsi_mode_set(struct kmb_dsi *kmb_dsi, struct drm_display_mode *mode, mipi_tx_init_cfg.lane_rate_mbps = data_rate; } -kmb_write_mipi (kmb_dsi,DPHY_ENABLE ,0 ); -kmb_write_mipi (kmb_dsi,DPHY_INIT_CTRL0 ,0 ); -kmb_write_mipi (kmb_dsi,DPHY_INIT_CTRL1 ,0 ); -kmb_write_mipi (kmb_dsi,DPHY_INIT_CTRL2 ,0 ); -/* Initialize mipi controller */ mipi_tx_init_cntrl (kmb_dsi, &mipi_tx_init_cfg);
Signature · 1 line
2.25.1
Re: [PATCH v3 3/7] drm/kmb: Remove clearing DPHY regs
Quoted 9 lines · Anitha Chrisanthus
From: Edmund Dea <[email protected]>
Don't clear the shared DPHY registers common to MIPI Rx and MIPI Tx during DSI initialization since this was causing MIPI Rx reset. Rest of the writes are bitwise, so will not affect Mipi Rx side.
Fixes 98521f4d4b4c ("drm/kmb: Mipi DSI part of the display driver")Signed-off-by Anitha Chrisanthus <[email protected]>Signed-off-by Edmund Dea <[email protected]>
As Edmund is author, he should be listed first. The s-o-b lines expressed the order.
With this fixed.
Quoted 22 lines
--- drivers/gpu/drm/kmb/kmb_dsi.c | 5 ----- 1 file changed, 5 deletions(-)drivers/gpu/drm/kmb/kmb_dsi.c +0
-5@@ -1393,11 +1393,6 @@ int kmb_dsi_mode_set(struct kmb_dsi *kmb_dsi, struct drm_display_mode *mode, mipi_tx_init_cfg.lane_rate_mbps = data_rate; } -kmb_write_mipi (kmb_dsi,DPHY_ENABLE ,0 ); -kmb_write_mipi (kmb_dsi,DPHY_INIT_CTRL0 ,0 ); -kmb_write_mipi (kmb_dsi,DPHY_INIT_CTRL1 ,0 ); -kmb_write_mipi (kmb_dsi,DPHY_INIT_CTRL2 ,0 ); -/* Initialize mipi controller */ mipi_tx_init_cntrl (kmb_dsi, &mipi_tx_init_cfg);Signature · 1 line
2.25.1
Anitha Chrisanthus
maintainerPATCH v3 4/7 drm/kmb: Disable change of plane parameters
In reply to Anitha ChrisanthusFrom: Edmund Dea <[email protected]>
Due to HW limitations, KMB cannot change height, width, or pixel format after initial plane configuration.
v2: removed memset disp_cfg as it is already zero.
--- drivers/gpu/drm/kmb/kmb_drv.h | 1 + drivers/gpu/drm/kmb/kmb_plane.c | 43 ++++++++++++++++++++++++++++++++- drivers/gpu/drm/kmb/kmb_plane.h | 6 +++++ 3 files changed, 49 insertions(+), 1 deletion(-)
drivers/gpu/drm/kmb/kmb_drv.h +1 -0
@@ -57,6 +57,7 @@ struct kmb_drm_private {spinlock_t irq_lock;int irq_lcd;int sys_clk_mhz; +struct disp_cfg init_disp_cfg[KMB_MAX_PLANES ];struct layer_status plane_status[KMB_MAX_PLANES ];int kmb_under_flow;int kmb_flush_done;
drivers/gpu/drm/kmb/kmb_plane.c +42 -1
86 lines not on this page · raw message
drivers/gpu/drm/kmb/kmb_plane.h +6 -0
@@ -63,6 +63,12 @@ struct layer_status { u32 ctrl; }; +struct disp_cfg { +unsigned int width; +unsigned int height; +unsigned int format; +}; +struct kmb_plane *kmb_plane_init (struct drm_device *drm);void kmb_plane_destroy (struct drm_plane *plane);#endif /* __KMB_PLANE_H__ */
Signature · 1 line
2.25.1
Re: [PATCH v3 4/7] drm/kmb: Disable change of plane parameters
Hi Anitha,
Quoted 10 lines · Anitha Chrisanthus
From: Edmund Dea <[email protected]>
Due to HW limitations, KMB cannot change height, width, or pixel format after initial plane configuration.
v2: removed memset
disp_cfgas it is already zero.Fixes 7f7b96a8a0a1 ("drm/kmb: Add support for KeemBay Display")Signed-off-by Edmund Dea <[email protected]>Signed-off-by Anitha Chrisanthus <[email protected]>
Looks fine and the s-o-b order is OK.
Sam
Anitha Chrisanthus
maintainerPATCH v3 5/7 drm/kmb: Corrected typo in handle_lcd_irq
In reply to Anitha ChrisanthusCheck for Overflow bits for layer3 in the irq handler.
--- drivers/gpu/drm/kmb/kmb_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/kmb/kmb_drv.c +1 -1
@@ -380,7 +380,7 @@ static irqreturn_t handle_lcd_irq(struct drm_device *dev)if (val &LAYER3_DMA_FIFO_UNDERFLOW )drm_dbg (&kmb->drm,"LAYER3:GL1 DMA UNDERFLOW val = 0x%lx" , val); -if (val &LAYER3_DMA_FIFO_UNDERFLOW ) +if (val &LAYER3_DMA_FIFO_OVERFLOW )drm_dbg (&kmb->drm,"LAYER3:GL1 DMA OVERFLOW val = 0x%lx" , val); }
Signature · 1 line
2.25.1
Re: [PATCH v3 5/7] drm/kmb: Corrected typo in handle_lcd_irq
Hi Anitha,
Quoted 4 lines · Anitha Chrisanthus
Check for Overflow bits for layer3 in the irq handler.
Fixes 7f7b96a8a0a1 ("drm/kmb: Add support for KeemBay Display")Signed-off-by Anitha Chrisanthus <[email protected]>
Obvious fix,
Anitha Chrisanthus
maintainerPATCH v3 6/7 drm/kmb: Enable ADV bridge after modeset
In reply to Anitha ChrisanthusOn KMB, ADV bridge must be programmed and powered on prior to MIPI DSI HW initialization.
--- drivers/gpu/drm/kmb/kmb_dsi.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/kmb/kmb_dsi.c +1 -0
@@ -1341,6 +1341,7 @@ static void connect_lcd_to_mipi(struct kmb_dsi *kmb_dsi)return ; } +drm_bridge_chain_enable (adv_bridge);/* DISABLE MIPI->CIF CONNECTION */ regmap_write (msscam,MSS_MIPI_CIF_CFG ,0 );
Signature · 1 line
2.25.1
Re: [PATCH v3 6/7] drm/kmb: Enable ADV bridge after modeset
Hi Anitha,
Quoted 15 lines · Anitha Chrisanthus
On KMB, ADV bridge must be programmed and powered on prior to MIPI DSI HW initialization.
Fixes 98521f4d4b4c ("drm/kmb: Mipi DSI part of the display driver")Signed-off-by Anitha Chrisanthus <[email protected]>--- drivers/gpu/drm/kmb/kmb_dsi.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/kmb/kmb_dsi.c +0
-0
drivers/gpu/drm/kmb/kmb_dsi.c static void connect_lcd_to_mipi(struct kmb_dsi *kmb_dsi) · line 1344
Quoted 4 lines
drivers/gpu/drm/kmb/kmb_dsi.c +1
-0@@ -1341,6 +1341,7 @@ static void connect_lcd_to_mipi(struct kmb_dsi *kmb_dsi)return ; } +drm_bridge_chain_enable (adv_bridge);
Do not use drm_bridge_chain_enable(). If you really need to do this hack use the atomic variant. The one you use here is about to be deleted.
That said - I expect this to be a workaround for some design issue. One bridge driver should not need to power on another bridge, the infrastructure should take care.
I know we did not make kmb_dsi a proper bridge, but this may be the time to do it so we avoid such a workaround and the driver will then be able to use the bridge infrastructure as it is supposed to do.
Sam
Quoted 5 lines
drivers/gpu/drm/kmb/kmb_dsi.c +0
-0/* DISABLE MIPI->CIF CONNECTION */ regmap_write (msscam,MSS_MIPI_CIF_CFG ,0 );Signature · 1 line
2.25.1
Anitha Chrisanthus
maintainerPATCH v3 7/7 drm/kmb: Enable support for framebuffer console
In reply to Anitha ChrisanthusEnable support for fbcon (framebuffer console).
The user can initialize fbcon by loading kmb-drm with the parameter console=1.
v2: added missing static clk_enable
--- drivers/gpu/drm/kmb/kmb_drv.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/gpu/drm/kmb/kmb_drv.c +11 -0
@@ -5,6 +5,7 @@#include <linux/clk.h> #include <linux/module.h> +#include <linux/moduleparam.h> #include <linux/of_graph.h> #include <linux/of_platform.h> #include <linux/of_reserved_mem.h>
@@ -15,6 +16,7 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_drv.h> +#include <drm/drm_fb_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_probe_helper.h>
@@ -24,6 +26,12 @@#include "kmb_dsi.h" #include "kmb_regs.h" +/* Module Parameters */ +static bool console; +module_param (console, bool,0400 ); +MODULE_PARM_DESC (console, +"Enable framebuffer console support (0=disable [default], 1=on)" ); +static int kmb_display_clk_enable (struct kmb_drm_private *kmb) {int ret =0 ;
@@ -559,6 +567,9 @@ static int kmb_probe(struct platform_device *pdev)if (ret) goto err_register; +if (console) +drm_fbdev_generic_setup (&kmb->drm,32 ); +return 0 ; err_register:
Signature · 1 line
2.25.1
Re: [PATCH v3 7/7] drm/kmb: Enable support for framebuffer console
Hi
Am 14.10.21 um 01:36 schrieb Anitha Chrisanthus:
Quoted 33 lines
Enable support for fbcon (framebuffer console).
The user can initialize fbcon by loading kmb-drm with the parameter console=1.v2: added missing static
clk_enableSigned-off-by Edmund Dea <[email protected]>Signed-off-by Anitha Chrisanthus <[email protected]>--- drivers/gpu/drm/kmb/kmb_drv.c | 11 +++++++++++ 1 file changed, 11 insertions(+)drivers/gpu/drm/kmb/kmb_drv.c +2
-0@@ -5,6 +5,7 @@#include <linux/clk.h> #include <linux/module.h> +#include <linux/moduleparam.h> #include <linux/of_graph.h> #include <linux/of_platform.h> #include <linux/of_reserved_mem.h> @@ -15,6 +16,7 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_drv.h> +#include <drm/drm_fb_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_probe_helper.h>
drivers/gpu/drm/kmb/kmb_drv.c line 33
Quoted 8 lines
drivers/gpu/drm/kmb/kmb_drv.c +5
-0@@ -24,6 +26,12 @@#include "kmb_dsi.h" #include "kmb_regs.h" +/* Module Parameters */ +static bool console; +module_param (console, bool,0400 ); +MODULE_PARM_DESC (console, +"Enable framebuffer console support (0=disable [default], 1=on)" );
There's already fbdev_emulation in drm_fb_helper.c. No need for a separate parameter here.
Best regards
Thomas
Quoted 15 lines
drivers/gpu/drm/kmb/kmb_drv.c +4
-0+static int kmb_display_clk_enable (struct kmb_drm_private *kmb) {int ret =0 ;@@ -559,6 +567,9 @@ static int kmb_probe(struct platform_device *pdev)if (ret) goto err_register; +if (console) +drm_fbdev_generic_setup (&kmb->drm,32 ); +return 0 ; err_register:
Signature · 6 lines
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
Chrisanthus, Anitha
maintainerRE: [PATCH v3 7/7] drm/kmb: Enable support for framebuffer console
Hi Thomas,
Thanks for your review.
Quoted 55 lines
-----Original Message-----
From: Thomas Zimmermann <[email protected]>
Sent: Thursday, October 14, 2021 5:50 AM
To: Chrisanthus, Anitha <[email protected]>; dri- [email protected]
Cc: [email protected]; Dea, Edmund J <[email protected]>
Subject: Re: [PATCH v3 7/7] drm/kmb: Enable support for framebuffer consoleHi
Am 14.10.21 um 01:36 schrieb Anitha Chrisanthus:
Quoted 6 lines
Enable support for fbcon (framebuffer console).
The user can initialize fbcon by loading kmb-drm with the parameter console=1.v2: added missing static
clk_enableReview
Quoted 7 lines
Signed-off-by Edmund Dea <[email protected]>Signed-off-by Anitha Chrisanthus <[email protected]>--- drivers/gpu/drm/kmb/kmb_drv.c | 11 +++++++++++ 1 file changed, 11 insertions(+)(quoted diff) +0
-0
b/drivers/gpu/drm/kmb/kmb_drv.cQuoted 20 lines
index
961ac6fb5fcf..b4e66eac63b5100644drivers/gpu/drm/kmb/kmb_drv.c +2
-0@@ -5,6 +5,7 @@#include <linux/clk.h> #include <linux/module.h> +#include <linux/moduleparam.h> #include <linux/of_graph.h> #include <linux/of_platform.h> #include <linux/of_reserved_mem.h> @@ -15,6 +16,7 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_drv.h> +#include <drm/drm_fb_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_probe_helper.h> drivers/gpu/drm/kmb/kmb_drv.c line 33
Quoted 8 lines
drivers/gpu/drm/kmb/kmb_drv.c +5
-0@@ -24,6 +26,12 @@#include "kmb_dsi.h" #include "kmb_regs.h" +/* Module Parameters */ +static bool console; +module_param (console, bool,0400 ); +MODULE_PARM_DESC(console, + "Enable framebuffer console support (0=disable [default],1=on)");
Quoted 2 lines
There's already
fbdev_emulationindrm_fb_helper.c. No need for a separate parameter here.
Good catch, I'll change it in V4.
Quoted 27 lines
Best regards
ThomasQuoted 6 lines
drivers/gpu/drm/kmb/kmb_drv.c +1
-0+static int kmb_display_clk_enable (struct kmb_drm_private *kmb) {int ret =0 ;drivers/gpu/drm/kmb/kmb_drv.c static int kmb_probe(struct platform_device *pdev) · line 575
Quoted 9 lines
drivers/gpu/drm/kmb/kmb_drv.c +3
-0@@ -559,6 +567,9 @@ static int kmb_probe(struct platform_device *pdev)if (ret) goto err_register; +if (console) +drm_fbdev_generic_setup (&kmb->drm,32 ); +return 0 ; err_register:--
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
Re: [PATCH v3 7/7] drm/kmb: Enable support for framebuffer console
In reply to Anitha ChrisanthusHi
Am 14.10.21 um 01:36 schrieb Anitha Chrisanthus:
Quoted 46 lines
Enable support for fbcon (framebuffer console).
The user can initialize fbcon by loading kmb-drm with the parameter console=1.v2: added missing static
clk_enableSigned-off-by Edmund Dea <[email protected]>Signed-off-by Anitha Chrisanthus <[email protected]>--- drivers/gpu/drm/kmb/kmb_drv.c | 11 +++++++++++ 1 file changed, 11 insertions(+)drivers/gpu/drm/kmb/kmb_drv.c +8
-0@@ -5,6 +5,7 @@#include <linux/clk.h> #include <linux/module.h> +#include <linux/moduleparam.h> #include <linux/of_graph.h> #include <linux/of_platform.h> #include <linux/of_reserved_mem.h> @@ -15,6 +16,7 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_drv.h> +#include <drm/drm_fb_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_probe_helper.h> @@ -24,6 +26,12 @@#include "kmb_dsi.h" #include "kmb_regs.h" +/* Module Parameters */ +static bool console; +module_param (console, bool,0400 ); +MODULE_PARM_DESC (console, +"Enable framebuffer console support (0=disable [default], 1=on)" ); +static int kmb_display_clk_enable (struct kmb_drm_private *kmb) {int ret =0 ;
drivers/gpu/drm/kmb/kmb_drv.c static int kmb_probe(struct platform_device *pdev) · line 571
Quoted 5 lines
drivers/gpu/drm/kmb/kmb_drv.c +2
-0@@ -559,6 +567,9 @@ static int kmb_probe(struct platform_device *pdev)if (ret) goto err_register; +if (console) +drm_fbdev_generic_setup (&kmb->drm,32 );
The use of the final parameter is somewhat confusing and should probably be 0. It's the number of bits per pixel. 32 is the default. But the preferred way of selecting color mode is via dev->mode_config.preferred_depth, which is the color depth (24!). So maybe rather set preferred_depth to 24 and let the fbdev helper figure out the details.
Best regards
Thomas
Quoted 5 lines
drivers/gpu/drm/kmb/kmb_drv.c +1
-0+return 0 ; err_register:
Signature · 6 lines
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
Chrisanthus, Anitha
maintainerRE: [PATCH v3 7/7] drm/kmb: Enable support for framebuffer console
Hi Thomas,
Thanks for your review.
Quoted 62 lines
-----Original Message-----
From: Thomas Zimmermann <[email protected]>
Sent: Thursday, October 14, 2021 6:08 AM
To: Chrisanthus, Anitha <[email protected]>; dri- [email protected]
Cc: [email protected]; Dea, Edmund J <[email protected]>
Subject: Re: [PATCH v3 7/7] drm/kmb: Enable support for framebuffer consoleHi
Am 14.10.21 um 01:36 schrieb Anitha Chrisanthus:
Quoted 6 lines
Enable support for fbcon (framebuffer console).
The user can initialize fbcon by loading kmb-drm with the parameter console=1.v2: added missing static
clk_enableReview
Quoted 7 lines
Signed-off-by Edmund Dea <[email protected]>Signed-off-by Anitha Chrisanthus <[email protected]>--- drivers/gpu/drm/kmb/kmb_drv.c | 11 +++++++++++ 1 file changed, 11 insertions(+)(quoted diff) +0
-0
b/drivers/gpu/drm/kmb/kmb_drv.cQuoted 20 lines
index
961ac6fb5fcf..b4e66eac63b5100644drivers/gpu/drm/kmb/kmb_drv.c +2
-0@@ -5,6 +5,7 @@#include <linux/clk.h> #include <linux/module.h> +#include <linux/moduleparam.h> #include <linux/of_graph.h> #include <linux/of_platform.h> #include <linux/of_reserved_mem.h> @@ -15,6 +16,7 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_drv.h> +#include <drm/drm_fb_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_probe_helper.h> drivers/gpu/drm/kmb/kmb_drv.c line 33
Quoted 8 lines
drivers/gpu/drm/kmb/kmb_drv.c +5
-0@@ -24,6 +26,12 @@#include "kmb_dsi.h" #include "kmb_regs.h" +/* Module Parameters */ +static bool console; +module_param (console, bool,0400 ); +MODULE_PARM_DESC(console, + "Enable framebuffer console support (0=disable [default],1=on)");
Quoted 8 lines
drivers/gpu/drm/kmb/kmb_drv.c +1
-0+static int kmb_display_clk_enable (struct kmb_drm_private *kmb) {int ret =0 ;@@ -559,6 +567,9 @@ static int kmb_probe(struct platform_device *pdev)if (ret) goto err_register;
Quoted 9 lines
drivers/gpu/drm/kmb/kmb_drv.c static int kmb_probe(struct platform_device *pdev) · line 571
Quoted 2 lines
drivers/gpu/drm/kmb/kmb_drv.c +2
-0+if (console) +drm_fbdev_generic_setup (&kmb->drm,32 );The use of the final parameter is somewhat confusing and should probably be 0. It's the number of bits per pixel. 32 is the default. But the preferred way of selecting color mode is via
dev->mode_config.preferred_depth, which is the color depth (24!). So maybe rather setpreferred_depthto 24 and let the fbdev helper figure out the details.
Will change it in v4.
Quoted 17 lines
Best regards
Thomasdrivers/gpu/drm/kmb/kmb_drv.c static int kmb_probe(struct platform_device *pdev) · line 575
Quoted 5 lines
drivers/gpu/drm/kmb/kmb_drv.c +1
-0+return 0 ; err_register:--
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
Hi Anitha,
Quoted 5 lines · Anitha Chrisanthus
Use a different value for system clock offset in the ppl/llp ratio calculations for clocks higher than 500 Mhz.
Fixes 98521f4d4b4c ("drm/kmb: Mipi DSI part of the display driver")Signed-off-by Anitha Chrisanthus <[email protected]>
Looks fine.
Sam