From 123ee07ba5b7123e0ce0e0f9d64938026c16a2ce Mon Sep 17 00:00:00 2001 From: XuDong Liu Date: Sun, 30 Apr 2023 19:23:46 +0800 Subject: drm: sun4i_tcon: use devm_clk_get_enabled in `sun4i_tcon_init_clocks` Smatch reports: drivers/gpu/drm/sun4i/sun4i_tcon.c:805 sun4i_tcon_init_clocks() warn: 'tcon->clk' from clk_prepare_enable() not released on lines: 792,801. In the function sun4i_tcon_init_clocks(), tcon->clk and tcon->sclk0 are not disabled in the error handling, which affects the release of these variable. Although sun4i_tcon_bind(), which calls sun4i_tcon_init_clocks(), use sun4i_tcon_free_clocks to disable the variables mentioned, but the error handling branch of sun4i_tcon_init_clocks() ignores the required disable process. To fix this issue, use the devm_clk_get_enabled to automatically balance enable and disabled calls. As original implementation use sun4i_tcon_free_clocks() to disable clk explicitly, we delete the related calls and error handling that are no longer needed. Fixes: 9026e0d122ac ("drm: Add Allwinner A10 Display Engine support") Fixes: b14e945bda8a ("drm/sun4i: tcon: Prepare and enable TCON channel 0 clock at init") Fixes: 8e9240472522 ("drm/sun4i: support TCONs without channel 1") Fixes: 34d698f6e349 ("drm/sun4i: Add has_channel_0 TCON quirk") Signed-off-by: XuDong Liu Reviewed-by: Dongliang Mu Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20230430112347.4689-1-m202071377@hust.edu.cn --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index b263de7a8237..6a52fb12cbfb 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -784,21 +784,19 @@ static irqreturn_t sun4i_tcon_handler(int irq, void *private) static int sun4i_tcon_init_clocks(struct device *dev, struct sun4i_tcon *tcon) { - tcon->clk = devm_clk_get(dev, "ahb"); + tcon->clk = devm_clk_get_enabled(dev, "ahb"); if (IS_ERR(tcon->clk)) { dev_err(dev, "Couldn't get the TCON bus clock\n"); return PTR_ERR(tcon->clk); } - clk_prepare_enable(tcon->clk); if (tcon->quirks->has_channel_0) { - tcon->sclk0 = devm_clk_get(dev, "tcon-ch0"); + tcon->sclk0 = devm_clk_get_enabled(dev, "tcon-ch0"); if (IS_ERR(tcon->sclk0)) { dev_err(dev, "Couldn't get the TCON channel 0 clock\n"); return PTR_ERR(tcon->sclk0); } } - clk_prepare_enable(tcon->sclk0); if (tcon->quirks->has_channel_1) { tcon->sclk1 = devm_clk_get(dev, "tcon-ch1"); @@ -811,12 +809,6 @@ static int sun4i_tcon_init_clocks(struct device *dev, return 0; } -static void sun4i_tcon_free_clocks(struct sun4i_tcon *tcon) -{ - clk_disable_unprepare(tcon->sclk0); - clk_disable_unprepare(tcon->clk); -} - static int sun4i_tcon_init_irq(struct device *dev, struct sun4i_tcon *tcon) { @@ -1229,14 +1221,14 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master, ret = sun4i_tcon_init_regmap(dev, tcon); if (ret) { dev_err(dev, "Couldn't init our TCON regmap\n"); - goto err_free_clocks; + goto err_assert_reset; } if (tcon->quirks->has_channel_0) { ret = sun4i_dclk_create(dev, tcon); if (ret) { dev_err(dev, "Couldn't create our TCON dot clock\n"); - goto err_free_clocks; + goto err_assert_reset; } } @@ -1299,8 +1291,6 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master, err_free_dclk: if (tcon->quirks->has_channel_0) sun4i_dclk_free(tcon); -err_free_clocks: - sun4i_tcon_free_clocks(tcon); err_assert_reset: reset_control_assert(tcon->lcd_rst); return ret; @@ -1314,7 +1304,6 @@ static void sun4i_tcon_unbind(struct device *dev, struct device *master, list_del(&tcon->list); if (tcon->quirks->has_channel_0) sun4i_dclk_free(tcon); - sun4i_tcon_free_clocks(tcon); } static const struct component_ops sun4i_tcon_ops = { -- cgit v1.2.3 From dee23b2c9e3ff46d59c5d45e1436eceb878e7c9a Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Sun, 7 May 2023 20:26:38 +0300 Subject: drm/panel: sharp-ls043t1le01: adjust mode settings Using current settings causes panel flickering on APQ8074 dragonboard. Adjust panel settings to follow the vendor-provided mode. This also enables MIPI_DSI_MODE_VIDEO_SYNC_PULSE, which is also specified by the vendor dtsi for the mentioned dragonboard. Fixes: ee0172383190 ("drm/panel: Add Sharp LS043T1LE01 MIPI DSI panel") Signed-off-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230507172639.2320934-1-dmitry.baryshkov@linaro.org --- drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c index d1ec80a3e3c7..ef148504cf24 100644 --- a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c +++ b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c @@ -192,15 +192,15 @@ static int sharp_nt_panel_enable(struct drm_panel *panel) } static const struct drm_display_mode default_mode = { - .clock = 41118, + .clock = (540 + 48 + 32 + 80) * (960 + 3 + 10 + 15) * 60 / 1000, .hdisplay = 540, .hsync_start = 540 + 48, - .hsync_end = 540 + 48 + 80, - .htotal = 540 + 48 + 80 + 32, + .hsync_end = 540 + 48 + 32, + .htotal = 540 + 48 + 32 + 80, .vdisplay = 960, .vsync_start = 960 + 3, - .vsync_end = 960 + 3 + 15, - .vtotal = 960 + 3 + 15 + 1, + .vsync_end = 960 + 3 + 10, + .vtotal = 960 + 3 + 10 + 15, }; static int sharp_nt_panel_get_modes(struct drm_panel *panel, @@ -280,6 +280,7 @@ static int sharp_nt_panel_probe(struct mipi_dsi_device *dsi) dsi->lanes = 2; dsi->format = MIPI_DSI_FMT_RGB888; dsi->mode_flags = MIPI_DSI_MODE_VIDEO | + MIPI_DSI_MODE_VIDEO_SYNC_PULSE | MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_CLOCK_NON_CONTINUOUS | MIPI_DSI_MODE_NO_EOT_PACKET; -- cgit v1.2.3 From 7e8ba34d357127e2c93f18123d09b5c817156512 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Sun, 7 May 2023 20:26:39 +0300 Subject: drm/panel: sharp-ls043t1le01: drop dummy functions and data fields Drop sharp_nt_panel_disable() and sharp_nt_panel_enable(), which bear no useful code. Also drop sharp_nt_panel::enable and sharp_nt_panel::mode fields which also provide no use now. Signed-off-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230507172639.2320934-2-dmitry.baryshkov@linaro.org --- drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c | 32 ------------------------- 1 file changed, 32 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c index ef148504cf24..855e64444daa 100644 --- a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c +++ b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c @@ -28,9 +28,6 @@ struct sharp_nt_panel { struct gpio_desc *reset_gpio; bool prepared; - bool enabled; - - const struct drm_display_mode *mode; }; static inline struct sharp_nt_panel *to_sharp_nt_panel(struct drm_panel *panel) @@ -97,19 +94,6 @@ static int sharp_nt_panel_off(struct sharp_nt_panel *sharp_nt) return 0; } - -static int sharp_nt_panel_disable(struct drm_panel *panel) -{ - struct sharp_nt_panel *sharp_nt = to_sharp_nt_panel(panel); - - if (!sharp_nt->enabled) - return 0; - - sharp_nt->enabled = false; - - return 0; -} - static int sharp_nt_panel_unprepare(struct drm_panel *panel) { struct sharp_nt_panel *sharp_nt = to_sharp_nt_panel(panel); @@ -179,18 +163,6 @@ poweroff: return ret; } -static int sharp_nt_panel_enable(struct drm_panel *panel) -{ - struct sharp_nt_panel *sharp_nt = to_sharp_nt_panel(panel); - - if (sharp_nt->enabled) - return 0; - - sharp_nt->enabled = true; - - return 0; -} - static const struct drm_display_mode default_mode = { .clock = (540 + 48 + 32 + 80) * (960 + 3 + 10 + 15) * 60 / 1000, .hdisplay = 540, @@ -227,10 +199,8 @@ static int sharp_nt_panel_get_modes(struct drm_panel *panel, } static const struct drm_panel_funcs sharp_nt_panel_funcs = { - .disable = sharp_nt_panel_disable, .unprepare = sharp_nt_panel_unprepare, .prepare = sharp_nt_panel_prepare, - .enable = sharp_nt_panel_enable, .get_modes = sharp_nt_panel_get_modes, }; @@ -239,8 +209,6 @@ static int sharp_nt_panel_add(struct sharp_nt_panel *sharp_nt) struct device *dev = &sharp_nt->dsi->dev; int ret; - sharp_nt->mode = &default_mode; - sharp_nt->supply = devm_regulator_get(dev, "avdd"); if (IS_ERR(sharp_nt->supply)) return PTR_ERR(sharp_nt->supply); -- cgit v1.2.3 From 0bd5bd65cd2e4d1335ea6c17cd2c8664decbc630 Mon Sep 17 00:00:00 2001 From: Liu Ying Date: Mon, 8 May 2023 16:38:25 +0800 Subject: dt-bindings: display: simple: Add BOE EV121WXM-N10-1850 panel Add BOE EV121WXM-N10-1850 12.1" WXGA (1280x800) TFT LCD panel compatible string. The panel has a LVDS display interface. The panel's product specification can be found at: http://www.onetech.com.tw/files/EV121WXM-N10-1850ProductSpecification_20180801.pdf Acked-by: Krzysztof Kozlowski Signed-off-by: Liu Ying Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230508083826.1016206-2-victor.liu@nxp.com --- Documentation/devicetree/bindings/display/panel/panel-simple.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml index ec50dd268314..733e47da36e8 100644 --- a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml +++ b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml @@ -77,6 +77,8 @@ properties: - auo,t215hvn01 # Shanghai AVIC Optoelectronics 7" 1024x600 color TFT-LCD panel - avic,tm070ddh03 + # BOE EV121WXM-N10-1850 12.1" WXGA (1280x800) TFT LCD panel + - boe,ev121wxm-n10-1850 # BOE HV070WSA-100 7.01" WSVGA TFT LCD panel - boe,hv070wsa-100 # BOE OPTOELECTRONICS TECHNOLOGY 10.1" WXGA TFT LCD panel -- cgit v1.2.3 From 8bb7c7bca5b70f3cd22d95b4d36029295c4274f6 Mon Sep 17 00:00:00 2001 From: Liu Ying Date: Mon, 8 May 2023 16:38:26 +0800 Subject: drm/panel: panel-simple: Add BOE EV121WXM-N10-1850 panel support Add BOE EV121WXM-N10-1850 12.1" WXGA (1280x800) TFT LCD panel support. The panel has a LVDS display interface. The panel's product specification can be found at: http://www.onetech.com.tw/files/EV121WXM-N10-1850ProductSpecification_20180801.pdf Signed-off-by: Liu Ying Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230508083826.1016206-3-victor.liu@nxp.com --- drivers/gpu/drm/panel/panel-simple.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 2a9c1a785a5c..5778824dffd4 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -1211,6 +1211,37 @@ static const struct panel_desc bananapi_s070wv20_ct16 = { }, }; +static const struct display_timing boe_ev121wxm_n10_1850_timing = { + .pixelclock = { 69922000, 71000000, 72293000 }, + .hactive = { 1280, 1280, 1280 }, + .hfront_porch = { 48, 48, 48 }, + .hback_porch = { 80, 80, 80 }, + .hsync_len = { 32, 32, 32 }, + .vactive = { 800, 800, 800 }, + .vfront_porch = { 3, 3, 3 }, + .vback_porch = { 14, 14, 14 }, + .vsync_len = { 6, 6, 6 }, +}; + +static const struct panel_desc boe_ev121wxm_n10_1850 = { + .timings = &boe_ev121wxm_n10_1850_timing, + .num_timings = 1, + .bpc = 8, + .size = { + .width = 261, + .height = 163, + }, + .delay = { + .prepare = 9, + .enable = 300, + .unprepare = 300, + .disable = 560, + }, + .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, + .bus_flags = DRM_BUS_FLAG_DE_HIGH, + .connector_type = DRM_MODE_CONNECTOR_LVDS, +}; + static const struct drm_display_mode boe_hv070wsa_mode = { .clock = 42105, .hdisplay = 1024, @@ -4016,6 +4047,9 @@ static const struct of_device_id platform_of_match[] = { }, { .compatible = "bananapi,s070wv20-ct16", .data = &bananapi_s070wv20_ct16, + }, { + .compatible = "boe,ev121wxm-n10-1850", + .data = &boe_ev121wxm_n10_1850, }, { .compatible = "boe,hv070wsa-100", .data = &boe_hv070wsa -- cgit v1.2.3 From 60aebc9559492cea6a9625f514a8041717e3a2e4 Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Mon, 4 Jul 2022 09:17:04 +0800 Subject: drivers/firmware: Move sysfb_init() from device_initcall to subsys_initcall_sync Consider a configuration like this: 1, efifb (or simpledrm) is built-in; 2, a native display driver (such as radeon) is also built-in. As Javier said, this is not a common configuration (the native display driver is usually built as a module), but it can happen and cause some trouble. In this case, since efifb, radeon and sysfb are all in device_initcall() level, the order in practise is like this: efifb registered at first, but no "efi-framebuffer" device yet. radeon registered later, and /dev/fb0 created. sysfb_init() comes at last, it registers "efi-framebuffer" and then causes an error message "efifb: a framebuffer is already registered". Make sysfb_init() to be subsys_ initcall_sync() can avoid this. And Javier Martinez Canillas is trying to make a more general solution in commit 873eb3b11860 ("fbdev: Disable sysfb device registration when removing conflicting FBs"). However, this patch still makes sense because it can make the screen display as early as possible (We cannot move to subsys_initcall, since sysfb_init() should be executed after PCI enumeration). Reviewed-by: Javier Martinez Canillas Signed-off-by: Huacai Chen Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220704011704.1418055-1-chenhuacai@loongson.cn --- drivers/firmware/sysfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/sysfb.c b/drivers/firmware/sysfb.c index 3c197db42c9d..82fcfd29bc4d 100644 --- a/drivers/firmware/sysfb.c +++ b/drivers/firmware/sysfb.c @@ -128,4 +128,4 @@ unlock_mutex: } /* must execute after PCI subsystem for EFI quirks */ -device_initcall(sysfb_init); +subsys_initcall_sync(sysfb_init); -- cgit v1.2.3 From 0f1cb4d777281ca3360dbc8959befc488e0c327e Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Fri, 12 May 2023 14:02:31 +0200 Subject: drm/ssd130x: Fix include guard name This is a leftover from an early iteration of the driver when it was still named ssd1307 instead of ssd130x. Change it for consistency with the rest. Signed-off-by: Javier Martinez Canillas Reviewed-by: Sam Ravnborg Reviewed-by: Sui Jingfeng Link: https://patchwork.freedesktop.org/patch/msgid/20230512120232.304603-1-javierm@redhat.com --- drivers/gpu/drm/solomon/ssd130x.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/solomon/ssd130x.h b/drivers/gpu/drm/solomon/ssd130x.h index 03038c1b6476..db03ee5db392 100644 --- a/drivers/gpu/drm/solomon/ssd130x.h +++ b/drivers/gpu/drm/solomon/ssd130x.h @@ -10,8 +10,8 @@ * Copyright 2012 Free Electrons */ -#ifndef __SSD1307X_H__ -#define __SSD1307X_H__ +#ifndef __SSD130X_H__ +#define __SSD130X_H__ #include #include @@ -94,4 +94,4 @@ struct ssd130x_device *ssd130x_probe(struct device *dev, struct regmap *regmap); void ssd130x_remove(struct ssd130x_device *ssd130x); void ssd130x_shutdown(struct ssd130x_device *ssd130x); -#endif /* __SSD1307X_H__ */ +#endif /* __SSD130X_H__ */ -- cgit v1.2.3 From fe7f4e8d496552f880d7368b482d2ccac33780b7 Mon Sep 17 00:00:00 2001 From: Shuijing Li Date: Mon, 15 May 2023 17:49:54 +0800 Subject: drm/panel: boe-tv101wum-nl6: Remove extra delay Reduce the delay after LCM reset by removing an extra delay in the initialization commands array. The required delay of at least 6ms after reset is guaranteed by boe_panel_prepare(). Signed-off-by: Shuijing Li Signed-off-by: Xinlei Lee Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230515094955.15982-2-shuijing.li@mediatek.com --- drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c index 783234ae0f57..a5652d38acda 100644 --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c @@ -780,7 +780,6 @@ static const struct panel_init_cmd inx_hj110iz_init_cmd[] = { }; static const struct panel_init_cmd boe_init_cmd[] = { - _INIT_DELAY_CMD(24), _INIT_DCS_CMD(0xB0, 0x05), _INIT_DCS_CMD(0xB1, 0xE5), _INIT_DCS_CMD(0xB3, 0x52), -- cgit v1.2.3 From 812562b8d881ce6d33fed8052b3a10b718430fb5 Mon Sep 17 00:00:00 2001 From: Shuijing Li Date: Mon, 15 May 2023 17:49:55 +0800 Subject: drm/panel: boe-tv101wum-nl6: Fine tune the panel power sequence For "boe,tv105wum-nw0" this special panel, it is stipulated in the panel spec that MIPI needs to keep the LP11 state before the lcm_reset pin is pulled high. Signed-off-by: Shuijing Li Signed-off-by: Xinlei Lee Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230515094955.15982-3-shuijing.li@mediatek.com --- drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c index a5652d38acda..64e462f49c60 100644 --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c @@ -36,6 +36,7 @@ struct panel_desc { const struct panel_init_cmd *init_cmds; unsigned int lanes; bool discharge_on_disable; + bool lp11_before_reset; }; struct boe_panel { @@ -1365,6 +1366,10 @@ static int boe_panel_prepare(struct drm_panel *panel) usleep_range(10000, 11000); + if (boe->desc->lp11_before_reset) { + mipi_dsi_dcs_nop(boe->dsi); + usleep_range(1000, 2000); + } gpiod_set_value(boe->enable_gpio, 1); usleep_range(1000, 2000); gpiod_set_value(boe->enable_gpio, 0); @@ -1591,6 +1596,7 @@ static const struct panel_desc boe_tv105wum_nw0_desc = { .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | MIPI_DSI_MODE_LPM, .init_cmds = boe_init_cmd, + .lp11_before_reset = true, }; static const struct drm_display_mode starry_qfh032011_53g_default_mode = { -- cgit v1.2.3 From 8b25320887d7feac98875546ea0f521628b745bb Mon Sep 17 00:00:00 2001 From: Maíra Canal Date: Fri, 12 May 2023 07:40:44 -0300 Subject: drm: Add fixed-point helper to get rounded integer values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Create a new fixed-point helper to allow us to return the rounded value of our fixed point value. [v2]: * Create the function drm_fixp2int_round() (Melissa Wen). [v3]: * Use drm_fixp2int() instead of shifting manually (Arthur Grillo). Signed-off-by: Maíra Canal Reviewed-by: Arthur Grillo Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230512104044.65034-1-mcanal@igalia.com --- include/drm/drm_fixed.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/drm/drm_fixed.h b/include/drm/drm_fixed.h index 255645c1f9a8..6ea339d5de08 100644 --- a/include/drm/drm_fixed.h +++ b/include/drm/drm_fixed.h @@ -71,6 +71,7 @@ static inline u32 dfixed_div(fixed20_12 A, fixed20_12 B) } #define DRM_FIXED_POINT 32 +#define DRM_FIXED_POINT_HALF 16 #define DRM_FIXED_ONE (1ULL << DRM_FIXED_POINT) #define DRM_FIXED_DECIMAL_MASK (DRM_FIXED_ONE - 1) #define DRM_FIXED_DIGITS_MASK (~DRM_FIXED_DECIMAL_MASK) @@ -87,6 +88,11 @@ static inline int drm_fixp2int(s64 a) return ((s64)a) >> DRM_FIXED_POINT; } +static inline int drm_fixp2int_round(s64 a) +{ + return drm_fixp2int(a + (1 << (DRM_FIXED_POINT_HALF - 1))); +} + static inline int drm_fixp2int_ceil(s64 a) { if (a > 0) -- cgit v1.2.3 From ab87f558dcfb2562c3497e89600dec798a446665 Mon Sep 17 00:00:00 2001 From: Maíra Canal Date: Fri, 12 May 2023 07:40:45 -0300 Subject: drm/vkms: Fix RGB565 pixel conversion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, the pixel conversion isn't rounding the fixed-point values before assigning it to the RGB coefficients, which is causing the IGT pixel-format tests to fail. So, use the drm_fixp2int_round() fixed-point helper to round the values when assigning it to the RGB coefficients. Tested with igt@kms_plane@pixel-format and igt@kms_plane@pixel-format-source-clamping. [v2]: * Use drm_fixp2int_round() to fix the pixel conversion instead of casting the values to s32 (Melissa Wen). Fixes: 89b03aeaef16 ("drm/vkms: fix 32bit compilation error by replacing macros") Signed-off-by: Maíra Canal Reviewed-by: Arthur Grillo Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230512104044.65034-2-mcanal@igalia.com --- drivers/gpu/drm/vkms/vkms_formats.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_formats.c b/drivers/gpu/drm/vkms/vkms_formats.c index ebacb8efa055..5945da0beba6 100644 --- a/drivers/gpu/drm/vkms/vkms_formats.c +++ b/drivers/gpu/drm/vkms/vkms_formats.c @@ -106,9 +106,9 @@ static void RGB565_to_argb_u16(u8 *src_pixels, struct pixel_argb_u16 *out_pixel) s64 fp_b = drm_int2fixp(rgb_565 & 0x1f); out_pixel->a = (u16)0xffff; - out_pixel->r = drm_fixp2int(drm_fixp_mul(fp_r, fp_rb_ratio)); - out_pixel->g = drm_fixp2int(drm_fixp_mul(fp_g, fp_g_ratio)); - out_pixel->b = drm_fixp2int(drm_fixp_mul(fp_b, fp_rb_ratio)); + out_pixel->r = drm_fixp2int_round(drm_fixp_mul(fp_r, fp_rb_ratio)); + out_pixel->g = drm_fixp2int_round(drm_fixp_mul(fp_g, fp_g_ratio)); + out_pixel->b = drm_fixp2int_round(drm_fixp_mul(fp_b, fp_rb_ratio)); } void vkms_compose_row(struct line_buffer *stage_buffer, struct vkms_plane_state *plane, int y) @@ -232,9 +232,9 @@ static void argb_u16_to_RGB565(struct vkms_frame_info *frame_info, s64 fp_g = drm_int2fixp(in_pixels[x].g); s64 fp_b = drm_int2fixp(in_pixels[x].b); - u16 r = drm_fixp2int(drm_fixp_div(fp_r, fp_rb_ratio)); - u16 g = drm_fixp2int(drm_fixp_div(fp_g, fp_g_ratio)); - u16 b = drm_fixp2int(drm_fixp_div(fp_b, fp_rb_ratio)); + u16 r = drm_fixp2int_round(drm_fixp_div(fp_r, fp_rb_ratio)); + u16 g = drm_fixp2int_round(drm_fixp_div(fp_g, fp_g_ratio)); + u16 b = drm_fixp2int_round(drm_fixp_div(fp_b, fp_rb_ratio)); *dst_pixels = cpu_to_le16(r << 11 | g << 5 | b); } -- cgit v1.2.3 From adbcfcc92b5aaffdee4c5e62c077919014c483d9 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Mon, 15 May 2023 18:20:33 +0200 Subject: dt-bindings: display: bridge: tc358867: Document TC358867/TC9595 compatible The TC358867/TC9595 devices are compatible with the predecessor TC358767. Document compatible strings for the new devices, so they can be discerned in board DTs. Update the title to match description in the process. Signed-off-by: Marek Vasut Reviewed-by: Krzysztof Kozlowski Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230515162033.66986-1-marex@denx.de --- .../bindings/display/bridge/toshiba,tc358767.yaml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/display/bridge/toshiba,tc358767.yaml b/Documentation/devicetree/bindings/display/bridge/toshiba,tc358767.yaml index e1494b5007cb..0521261b04a9 100644 --- a/Documentation/devicetree/bindings/display/bridge/toshiba,tc358767.yaml +++ b/Documentation/devicetree/bindings/display/bridge/toshiba,tc358767.yaml @@ -4,16 +4,24 @@ $id: http://devicetree.org/schemas/display/bridge/toshiba,tc358767.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: Toshiba TC358767 eDP bridge +title: Toshiba TC358767/TC358867/TC9595 DSI/DPI/eDP bridge maintainers: - Andrey Gusakov -description: The TC358767 is bridge device which converts DSI/DPI to eDP/DP +description: | + The TC358767/TC358867/TC9595 is bridge device which + converts DSI/DPI to eDP/DP . properties: compatible: - const: toshiba,tc358767 + oneOf: + - items: + - enum: + - toshiba,tc358867 + - toshiba,tc9595 + - const: toshiba,tc358767 + - const: toshiba,tc358767 reg: enum: -- cgit v1.2.3 From 728cb3f061e2b3a002fd76d91c2449b1497b6640 Mon Sep 17 00:00:00 2001 From: Anup Sharma Date: Sat, 13 May 2023 15:42:17 +0530 Subject: gpu: drm: bridge: No need to set device_driver owner There is no need to exclusively set the .owner member of the struct device_driver when defining the platform_driver struct. The Linux core takes care of setting the .owner member as part of the call to module_platform_driver() helper function. Issue identified using the platform_no_drv_owner.cocci Coccinelle semantic patch as: drivers/gpu/drm/bridge/samsung-dsim.c:1957:6-11: No need to set .owner here. The core will do it. No functional changes are intended. Signed-off-by: Anup Sharma Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/ZF9igb/nvL6GRBsq@yoga --- drivers/gpu/drm/bridge/samsung-dsim.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index e0a402a85787..10dc3315e69e 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1954,7 +1954,6 @@ static struct platform_driver samsung_dsim_driver = { .remove = samsung_dsim_remove, .driver = { .name = "samsung-dsim", - .owner = THIS_MODULE, .pm = &samsung_dsim_pm_ops, .of_match_table = samsung_dsim_of_match, }, -- cgit v1.2.3 From 81d6b37b69b8b5d1a4c81d2e208b41888d4283df Mon Sep 17 00:00:00 2001 From: Francesco Dolcini Date: Mon, 15 May 2023 20:44:08 +0200 Subject: drm/bridge: tc358768: remove unneeded semicolon Remove unneeded stray semicolon. Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202305152341.oiSjRpv6-lkp@intel.com/ Signed-off-by: Francesco Dolcini Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230515184408.9421-1-francesco@dolcini.it --- drivers/gpu/drm/bridge/tc358768.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/tc358768.c b/drivers/gpu/drm/bridge/tc358768.c index 03c7e82e4109..97ae3a9c90da 100644 --- a/drivers/gpu/drm/bridge/tc358768.c +++ b/drivers/gpu/drm/bridge/tc358768.c @@ -952,7 +952,7 @@ tc358768_atomic_get_input_bus_fmts(struct drm_bridge *bridge, case 24: input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; break; - }; + } *num_input_fmts = MAX_INPUT_SEL_FORMATS; -- cgit v1.2.3 From 519ce291168af247c7c0fd122c754b74bcf08117 Mon Sep 17 00:00:00 2001 From: Cong Yang Date: Tue, 9 May 2023 10:51:53 +0800 Subject: drm/panel: Modify innolux hj110iz panel initial code There is a problem of screen shake on the old panel. So increase the panel GOP component pull-down circuit size in hardware, and update the initialization code at the same time. The new initialization code mainly modifles the following. a)adjusted for GOP timing. When Display sleep in, raise all GOP signals to VGHO and then drop to GND. b)Increased the Vertical back Porch and Vertical pulse width, so need to update vsync_end and vtotal and CLK in drm_display_mode. Signed-off-by: Cong Yang Reviewed-by: Douglas Anderson [dianders: fixed spelling mistake in subject] Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230509025153.1321446-1-yangcong5@huaqin.corp-partner.google.com --- drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 397 +++++++++++++++---------- 1 file changed, 235 insertions(+), 162 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c index 64e462f49c60..f5a6046f1d19 100644 --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c @@ -452,11 +452,14 @@ static const struct panel_init_cmd inx_hj110iz_init_cmd[] = { _INIT_DCS_CMD(0xFF, 0x20), _INIT_DCS_CMD(0xFB, 0x01), _INIT_DCS_CMD(0x05, 0xD1), - _INIT_DCS_CMD(0x0D, 0x63), - _INIT_DCS_CMD(0x07, 0x8C), + _INIT_DCS_CMD(0x06, 0xC0), + _INIT_DCS_CMD(0x07, 0x87), _INIT_DCS_CMD(0x08, 0x4B), + + _INIT_DCS_CMD(0x0D, 0x63), _INIT_DCS_CMD(0x0E, 0x91), _INIT_DCS_CMD(0x0F, 0x69), + _INIT_DCS_CMD(0x94, 0x00), _INIT_DCS_CMD(0x95, 0xF5), _INIT_DCS_CMD(0x96, 0xF5), _INIT_DCS_CMD(0x9D, 0x00), @@ -464,98 +467,96 @@ static const struct panel_init_cmd inx_hj110iz_init_cmd[] = { _INIT_DCS_CMD(0x69, 0x98), _INIT_DCS_CMD(0x75, 0xA2), _INIT_DCS_CMD(0x77, 0xB3), + + _INIT_DCS_CMD(0x58, 0x43), _INIT_DCS_CMD(0xFF, 0x24), _INIT_DCS_CMD(0xFB, 0x01), _INIT_DCS_CMD(0x91, 0x44), - _INIT_DCS_CMD(0x92, 0x7A), - _INIT_DCS_CMD(0x93, 0x1A), - _INIT_DCS_CMD(0x94, 0x40), - _INIT_DCS_CMD(0x9A, 0x08), + _INIT_DCS_CMD(0x92, 0x4C), + _INIT_DCS_CMD(0x94, 0x86), _INIT_DCS_CMD(0x60, 0x96), _INIT_DCS_CMD(0x61, 0xD0), _INIT_DCS_CMD(0x63, 0x70), - _INIT_DCS_CMD(0xC2, 0xCF), - _INIT_DCS_CMD(0x9B, 0x0F), - _INIT_DCS_CMD(0x9A, 0x08), + _INIT_DCS_CMD(0xC2, 0xCA), + _INIT_DCS_CMD(0x00, 0x03), _INIT_DCS_CMD(0x01, 0x03), _INIT_DCS_CMD(0x02, 0x03), - _INIT_DCS_CMD(0x03, 0x03), - _INIT_DCS_CMD(0x04, 0x03), - _INIT_DCS_CMD(0x05, 0x03), - _INIT_DCS_CMD(0x06, 0x22), - _INIT_DCS_CMD(0x07, 0x06), - _INIT_DCS_CMD(0x08, 0x00), - _INIT_DCS_CMD(0x09, 0x1D), - _INIT_DCS_CMD(0x0A, 0x1C), - _INIT_DCS_CMD(0x0B, 0x13), - _INIT_DCS_CMD(0x0C, 0x12), - _INIT_DCS_CMD(0x0D, 0x11), - _INIT_DCS_CMD(0x0E, 0x10), - _INIT_DCS_CMD(0x0F, 0x0F), - _INIT_DCS_CMD(0x10, 0x0E), - _INIT_DCS_CMD(0x11, 0x0D), - _INIT_DCS_CMD(0x12, 0x0C), + _INIT_DCS_CMD(0x03, 0x29), + _INIT_DCS_CMD(0x04, 0x22), + _INIT_DCS_CMD(0x05, 0x22), + _INIT_DCS_CMD(0x06, 0x0B), + _INIT_DCS_CMD(0x07, 0x1D), + _INIT_DCS_CMD(0x08, 0x1C), + _INIT_DCS_CMD(0x09, 0x05), + _INIT_DCS_CMD(0x0A, 0x08), + _INIT_DCS_CMD(0x0B, 0x09), + _INIT_DCS_CMD(0x0C, 0x0A), + _INIT_DCS_CMD(0x0D, 0x0C), + _INIT_DCS_CMD(0x0E, 0x0D), + _INIT_DCS_CMD(0x0F, 0x0E), + _INIT_DCS_CMD(0x10, 0x0F), + _INIT_DCS_CMD(0x11, 0x10), + _INIT_DCS_CMD(0x12, 0x11), _INIT_DCS_CMD(0x13, 0x04), - _INIT_DCS_CMD(0x14, 0x03), + _INIT_DCS_CMD(0x14, 0x00), _INIT_DCS_CMD(0x15, 0x03), _INIT_DCS_CMD(0x16, 0x03), _INIT_DCS_CMD(0x17, 0x03), _INIT_DCS_CMD(0x18, 0x03), - _INIT_DCS_CMD(0x19, 0x03), - _INIT_DCS_CMD(0x1A, 0x03), - _INIT_DCS_CMD(0x1B, 0x03), - _INIT_DCS_CMD(0x1C, 0x22), - _INIT_DCS_CMD(0x1D, 0x06), - _INIT_DCS_CMD(0x1E, 0x00), - _INIT_DCS_CMD(0x1F, 0x1D), - _INIT_DCS_CMD(0x20, 0x1C), - _INIT_DCS_CMD(0x21, 0x13), - _INIT_DCS_CMD(0x22, 0x12), - _INIT_DCS_CMD(0x23, 0x11), - _INIT_DCS_CMD(0x24, 0x10), - _INIT_DCS_CMD(0x25, 0x0F), - _INIT_DCS_CMD(0x26, 0x0E), - _INIT_DCS_CMD(0x27, 0x0D), - _INIT_DCS_CMD(0x28, 0x0C), + _INIT_DCS_CMD(0x19, 0x29), + _INIT_DCS_CMD(0x1A, 0x22), + _INIT_DCS_CMD(0x1B, 0x22), + _INIT_DCS_CMD(0x1C, 0x0B), + _INIT_DCS_CMD(0x1D, 0x1D), + _INIT_DCS_CMD(0x1E, 0x1C), + _INIT_DCS_CMD(0x1F, 0x05), + _INIT_DCS_CMD(0x20, 0x08), + _INIT_DCS_CMD(0x21, 0x09), + _INIT_DCS_CMD(0x22, 0x0A), + _INIT_DCS_CMD(0x23, 0x0C), + _INIT_DCS_CMD(0x24, 0x0D), + _INIT_DCS_CMD(0x25, 0x0E), + _INIT_DCS_CMD(0x26, 0x0F), + _INIT_DCS_CMD(0x27, 0x10), + _INIT_DCS_CMD(0x28, 0x11), _INIT_DCS_CMD(0x29, 0x04), - _INIT_DCS_CMD(0x2A, 0x03), + _INIT_DCS_CMD(0x2A, 0x00), _INIT_DCS_CMD(0x2B, 0x03), - _INIT_DCS_CMD(0x2F, 0x05), - _INIT_DCS_CMD(0x30, 0x32), - _INIT_DCS_CMD(0x31, 0x43), - _INIT_DCS_CMD(0x33, 0x05), - _INIT_DCS_CMD(0x34, 0x32), - _INIT_DCS_CMD(0x35, 0x43), - _INIT_DCS_CMD(0x37, 0x44), - _INIT_DCS_CMD(0x38, 0x40), + _INIT_DCS_CMD(0x2F, 0x0A), + _INIT_DCS_CMD(0x30, 0x35), + _INIT_DCS_CMD(0x37, 0xA7), _INIT_DCS_CMD(0x39, 0x00), - _INIT_DCS_CMD(0x3A, 0x18), - _INIT_DCS_CMD(0x3B, 0x00), - _INIT_DCS_CMD(0x3D, 0x93), - _INIT_DCS_CMD(0xAB, 0x44), - _INIT_DCS_CMD(0xAC, 0x40), + _INIT_DCS_CMD(0x3A, 0x46), + _INIT_DCS_CMD(0x3B, 0x32), + _INIT_DCS_CMD(0x3D, 0x12), + + _INIT_DCS_CMD(0x3F, 0x33), + _INIT_DCS_CMD(0x40, 0x31), + _INIT_DCS_CMD(0x41, 0x40), + _INIT_DCS_CMD(0x42, 0x42), + _INIT_DCS_CMD(0x47, 0x77), + _INIT_DCS_CMD(0x48, 0x77), + _INIT_DCS_CMD(0x4A, 0x45), + _INIT_DCS_CMD(0x4B, 0x45), + _INIT_DCS_CMD(0x4C, 0x14), _INIT_DCS_CMD(0x4D, 0x21), _INIT_DCS_CMD(0x4E, 0x43), _INIT_DCS_CMD(0x4F, 0x65), - _INIT_DCS_CMD(0x50, 0x87), - _INIT_DCS_CMD(0x51, 0x78), - _INIT_DCS_CMD(0x52, 0x56), - _INIT_DCS_CMD(0x53, 0x34), - _INIT_DCS_CMD(0x54, 0x21), - _INIT_DCS_CMD(0x55, 0x83), - _INIT_DCS_CMD(0x56, 0x08), + _INIT_DCS_CMD(0x55, 0x06), + _INIT_DCS_CMD(0x56, 0x06), _INIT_DCS_CMD(0x58, 0x21), - _INIT_DCS_CMD(0x59, 0x40), - _INIT_DCS_CMD(0x5A, 0x00), - _INIT_DCS_CMD(0x5B, 0x2C), - _INIT_DCS_CMD(0x5E, 0x00, 0x10), + _INIT_DCS_CMD(0x59, 0x70), + _INIT_DCS_CMD(0x5A, 0x46), + _INIT_DCS_CMD(0x5B, 0x32), + _INIT_DCS_CMD(0x5C, 0x88), + _INIT_DCS_CMD(0x5E, 0x00, 0x00), _INIT_DCS_CMD(0x5F, 0x00), - _INIT_DCS_CMD(0x7A, 0x00), - _INIT_DCS_CMD(0x7B, 0x00), + _INIT_DCS_CMD(0x7A, 0xFF), + _INIT_DCS_CMD(0x7B, 0xFF), _INIT_DCS_CMD(0x7C, 0x00), _INIT_DCS_CMD(0x7D, 0x00), _INIT_DCS_CMD(0x7E, 0x20), @@ -565,152 +566,183 @@ static const struct panel_init_cmd inx_hj110iz_init_cmd[] = { _INIT_DCS_CMD(0x82, 0x08), _INIT_DCS_CMD(0x97, 0x02), _INIT_DCS_CMD(0xC5, 0x10), + + _INIT_DCS_CMD(0xD7, 0x55), + _INIT_DCS_CMD(0xD8, 0x55), + _INIT_DCS_CMD(0xD9, 0x23), _INIT_DCS_CMD(0xDA, 0x05), _INIT_DCS_CMD(0xDB, 0x01), - _INIT_DCS_CMD(0xDC, 0x7A), + _INIT_DCS_CMD(0xDC, 0x65), _INIT_DCS_CMD(0xDD, 0x55), _INIT_DCS_CMD(0xDE, 0x27), _INIT_DCS_CMD(0xDF, 0x01), - _INIT_DCS_CMD(0xE0, 0x7A), + _INIT_DCS_CMD(0xE0, 0x65), _INIT_DCS_CMD(0xE1, 0x01), - _INIT_DCS_CMD(0xE2, 0x7A), + _INIT_DCS_CMD(0xE2, 0x65), _INIT_DCS_CMD(0xE3, 0x01), - _INIT_DCS_CMD(0xE4, 0x7A), + _INIT_DCS_CMD(0xE4, 0x65), _INIT_DCS_CMD(0xE5, 0x01), - _INIT_DCS_CMD(0xE6, 0x7A), + _INIT_DCS_CMD(0xE6, 0x65), _INIT_DCS_CMD(0xE7, 0x00), _INIT_DCS_CMD(0xE8, 0x00), _INIT_DCS_CMD(0xE9, 0x01), - _INIT_DCS_CMD(0xEA, 0x7A), + _INIT_DCS_CMD(0xEA, 0x65), _INIT_DCS_CMD(0xEB, 0x01), - _INIT_DCS_CMD(0xEE, 0x7A), + _INIT_DCS_CMD(0xEE, 0x65), _INIT_DCS_CMD(0xEF, 0x01), - _INIT_DCS_CMD(0xF0, 0x7A), - + _INIT_DCS_CMD(0xF0, 0x65), _INIT_DCS_CMD(0xB6, 0x05, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x05, 0x00, 0x00), + _INIT_DCS_CMD(0xFF, 0x25), - _INIT_DCS_CMD(0xFB, 0x01), + _INIT_DCS_CMD(0xFB, 0x01), _INIT_DCS_CMD(0x05, 0x00), - - _INIT_DCS_CMD(0x13, 0x02), - _INIT_DCS_CMD(0x14, 0xDF), _INIT_DCS_CMD(0xF1, 0x10), + _INIT_DCS_CMD(0x1E, 0x00), - _INIT_DCS_CMD(0x1F, 0x00), - _INIT_DCS_CMD(0x20, 0x2C), + _INIT_DCS_CMD(0x1F, 0x46), + _INIT_DCS_CMD(0x20, 0x32), + _INIT_DCS_CMD(0x25, 0x00), - _INIT_DCS_CMD(0x26, 0x00), - _INIT_DCS_CMD(0x27, 0x2C), + _INIT_DCS_CMD(0x26, 0x46), + _INIT_DCS_CMD(0x27, 0x32), + _INIT_DCS_CMD(0x3F, 0x80), _INIT_DCS_CMD(0x40, 0x00), _INIT_DCS_CMD(0x43, 0x00), - _INIT_DCS_CMD(0x44, 0x18), - _INIT_DCS_CMD(0x45, 0x00), + _INIT_DCS_CMD(0x44, 0x46), + _INIT_DCS_CMD(0x45, 0x46), + + _INIT_DCS_CMD(0x48, 0x46), + _INIT_DCS_CMD(0x49, 0x32), - _INIT_DCS_CMD(0x48, 0x00), - _INIT_DCS_CMD(0x49, 0x2C), _INIT_DCS_CMD(0x5B, 0x80), + _INIT_DCS_CMD(0x5C, 0x00), - _INIT_DCS_CMD(0x5D, 0x00), - _INIT_DCS_CMD(0x5E, 0x00), - _INIT_DCS_CMD(0x61, 0x00), - _INIT_DCS_CMD(0x62, 0x2C), - _INIT_DCS_CMD(0x68, 0x10), + _INIT_DCS_CMD(0x5D, 0x46), + _INIT_DCS_CMD(0x5E, 0x32), + + _INIT_DCS_CMD(0x5F, 0x46), + _INIT_DCS_CMD(0x60, 0x32), + + _INIT_DCS_CMD(0x61, 0x46), + _INIT_DCS_CMD(0x62, 0x32), + _INIT_DCS_CMD(0x68, 0x0C), + + _INIT_DCS_CMD(0x6C, 0x0D), + _INIT_DCS_CMD(0x6E, 0x0D), + _INIT_DCS_CMD(0x78, 0x00), + _INIT_DCS_CMD(0x79, 0xC5), + _INIT_DCS_CMD(0x7A, 0x0C), + _INIT_DCS_CMD(0x7B, 0xB0), + _INIT_DCS_CMD(0xFF, 0x26), _INIT_DCS_CMD(0xFB, 0x01), _INIT_DCS_CMD(0x00, 0xA1), _INIT_DCS_CMD(0x02, 0x31), - _INIT_DCS_CMD(0x0A, 0xF2), - _INIT_DCS_CMD(0x04, 0x28), + _INIT_DCS_CMD(0x0A, 0xF4), + _INIT_DCS_CMD(0x04, 0x50), _INIT_DCS_CMD(0x06, 0x30), _INIT_DCS_CMD(0x0C, 0x16), _INIT_DCS_CMD(0x0D, 0x0D), _INIT_DCS_CMD(0x0F, 0x00), _INIT_DCS_CMD(0x11, 0x00), _INIT_DCS_CMD(0x12, 0x50), - _INIT_DCS_CMD(0x13, 0x56), - _INIT_DCS_CMD(0x14, 0x57), + _INIT_DCS_CMD(0x13, 0x40), + _INIT_DCS_CMD(0x14, 0x58), _INIT_DCS_CMD(0x15, 0x00), _INIT_DCS_CMD(0x16, 0x10), _INIT_DCS_CMD(0x17, 0xA0), _INIT_DCS_CMD(0x18, 0x86), _INIT_DCS_CMD(0x22, 0x00), _INIT_DCS_CMD(0x23, 0x00), - _INIT_DCS_CMD(0x19, 0x0D), - _INIT_DCS_CMD(0x1A, 0x7F), - _INIT_DCS_CMD(0x1B, 0x0C), - _INIT_DCS_CMD(0x1C, 0xBF), - _INIT_DCS_CMD(0x2A, 0x0D), - _INIT_DCS_CMD(0x2B, 0x7F), - _INIT_DCS_CMD(0x20, 0x00), + + _INIT_DCS_CMD(0x19, 0x0E), + _INIT_DCS_CMD(0x1A, 0x31), + _INIT_DCS_CMD(0x1B, 0x0D), + _INIT_DCS_CMD(0x1C, 0x29), + _INIT_DCS_CMD(0x2A, 0x0E), + _INIT_DCS_CMD(0x2B, 0x31), _INIT_DCS_CMD(0x1D, 0x00), - _INIT_DCS_CMD(0x1E, 0x78), - _INIT_DCS_CMD(0x1F, 0x78), + _INIT_DCS_CMD(0x1E, 0x62), + _INIT_DCS_CMD(0x1F, 0x62), - _INIT_DCS_CMD(0x2F, 0x03), - _INIT_DCS_CMD(0x30, 0x78), - _INIT_DCS_CMD(0x33, 0x78), - _INIT_DCS_CMD(0x34, 0x66), - _INIT_DCS_CMD(0x35, 0x11), + _INIT_DCS_CMD(0x2F, 0x06), + _INIT_DCS_CMD(0x30, 0x62), + _INIT_DCS_CMD(0x31, 0x06), + _INIT_DCS_CMD(0x32, 0x7F), + _INIT_DCS_CMD(0x33, 0x11), + _INIT_DCS_CMD(0x34, 0x89), + _INIT_DCS_CMD(0x35, 0x67), - _INIT_DCS_CMD(0x39, 0x10), - _INIT_DCS_CMD(0x3A, 0x78), + _INIT_DCS_CMD(0x39, 0x0B), + _INIT_DCS_CMD(0x3A, 0x62), _INIT_DCS_CMD(0x3B, 0x06), _INIT_DCS_CMD(0xC8, 0x04), - _INIT_DCS_CMD(0xC9, 0x84), + _INIT_DCS_CMD(0xC9, 0x89), _INIT_DCS_CMD(0xCA, 0x4E), _INIT_DCS_CMD(0xCB, 0x00), + _INIT_DCS_CMD(0xA9, 0x3F), + _INIT_DCS_CMD(0xAA, 0x3E), + _INIT_DCS_CMD(0xAB, 0x3D), + _INIT_DCS_CMD(0xAC, 0x3C), + _INIT_DCS_CMD(0xAD, 0x3B), + _INIT_DCS_CMD(0xAE, 0x3A), + _INIT_DCS_CMD(0xAF, 0x39), + _INIT_DCS_CMD(0xB0, 0x38), - _INIT_DCS_CMD(0xA9, 0x50), - _INIT_DCS_CMD(0xAA, 0x4F), - _INIT_DCS_CMD(0xAB, 0x4D), - _INIT_DCS_CMD(0xAC, 0x4A), - _INIT_DCS_CMD(0xAD, 0x48), - _INIT_DCS_CMD(0xAE, 0x46), _INIT_DCS_CMD(0xFF, 0x27), _INIT_DCS_CMD(0xFB, 0x01), + + _INIT_DCS_CMD(0xD0, 0x11), + _INIT_DCS_CMD(0xD1, 0x54), + _INIT_DCS_CMD(0xDE, 0x43), + _INIT_DCS_CMD(0xDF, 0x02), + _INIT_DCS_CMD(0xC0, 0x18), _INIT_DCS_CMD(0xC1, 0x00), _INIT_DCS_CMD(0xC2, 0x00), + _INIT_DCS_CMD(0x00, 0x00), + _INIT_DCS_CMD(0xC3, 0x00), _INIT_DCS_CMD(0x56, 0x06), + _INIT_DCS_CMD(0x58, 0x80), - _INIT_DCS_CMD(0x59, 0x75), + _INIT_DCS_CMD(0x59, 0x78), _INIT_DCS_CMD(0x5A, 0x00), - _INIT_DCS_CMD(0x5B, 0x02), + _INIT_DCS_CMD(0x5B, 0x18), _INIT_DCS_CMD(0x5C, 0x00), - _INIT_DCS_CMD(0x5D, 0x00), + _INIT_DCS_CMD(0x5D, 0x01), _INIT_DCS_CMD(0x5E, 0x20), _INIT_DCS_CMD(0x5F, 0x10), _INIT_DCS_CMD(0x60, 0x00), - _INIT_DCS_CMD(0x61, 0x2E), + _INIT_DCS_CMD(0x61, 0x1C), _INIT_DCS_CMD(0x62, 0x00), _INIT_DCS_CMD(0x63, 0x01), - _INIT_DCS_CMD(0x64, 0x43), - _INIT_DCS_CMD(0x65, 0x2D), + _INIT_DCS_CMD(0x64, 0x44), + _INIT_DCS_CMD(0x65, 0x1B), _INIT_DCS_CMD(0x66, 0x00), _INIT_DCS_CMD(0x67, 0x01), - _INIT_DCS_CMD(0x68, 0x43), + _INIT_DCS_CMD(0x68, 0x44), + _INIT_DCS_CMD(0x98, 0x01), _INIT_DCS_CMD(0xB4, 0x03), - _INIT_DCS_CMD(0x9B, 0xBD), - _INIT_DCS_CMD(0xA0, 0x90), - _INIT_DCS_CMD(0xAB, 0x1B), - _INIT_DCS_CMD(0xBC, 0x0C), + _INIT_DCS_CMD(0x9B, 0xBE), + + _INIT_DCS_CMD(0xAB, 0x14), + _INIT_DCS_CMD(0xBC, 0x08), _INIT_DCS_CMD(0xBD, 0x28), _INIT_DCS_CMD(0xFF, 0x2A), _INIT_DCS_CMD(0xFB, 0x01), - _INIT_DCS_CMD(0x22, 0x2F), _INIT_DCS_CMD(0x23, 0x08), _INIT_DCS_CMD(0x24, 0x00), - _INIT_DCS_CMD(0x25, 0x65), + _INIT_DCS_CMD(0x25, 0x62), _INIT_DCS_CMD(0x26, 0xF8), _INIT_DCS_CMD(0x27, 0x00), _INIT_DCS_CMD(0x28, 0x1A), @@ -720,18 +752,29 @@ static const struct panel_init_cmd inx_hj110iz_init_cmd[] = { _INIT_DCS_CMD(0x2D, 0x1A), _INIT_DCS_CMD(0x64, 0x96), - _INIT_DCS_CMD(0x65, 0x00), + _INIT_DCS_CMD(0x65, 0x10), _INIT_DCS_CMD(0x66, 0x00), + _INIT_DCS_CMD(0x67, 0x96), + _INIT_DCS_CMD(0x68, 0x10), + _INIT_DCS_CMD(0x69, 0x00), _INIT_DCS_CMD(0x6A, 0x96), - _INIT_DCS_CMD(0x6B, 0x00), + _INIT_DCS_CMD(0x6B, 0x10), _INIT_DCS_CMD(0x6C, 0x00), _INIT_DCS_CMD(0x70, 0x92), - _INIT_DCS_CMD(0x71, 0x00), + _INIT_DCS_CMD(0x71, 0x10), _INIT_DCS_CMD(0x72, 0x00), - _INIT_DCS_CMD(0xA2, 0x33), + _INIT_DCS_CMD(0x79, 0x96), + _INIT_DCS_CMD(0x7A, 0x10), + _INIT_DCS_CMD(0x88, 0x96), + _INIT_DCS_CMD(0x89, 0x10), + + _INIT_DCS_CMD(0xA2, 0x3F), _INIT_DCS_CMD(0xA3, 0x30), _INIT_DCS_CMD(0xA4, 0xC0), + _INIT_DCS_CMD(0xA5, 0x03), + _INIT_DCS_CMD(0xE8, 0x00), + _INIT_DCS_CMD(0x97, 0x3C), _INIT_DCS_CMD(0x98, 0x02), _INIT_DCS_CMD(0x99, 0x95), @@ -740,38 +783,68 @@ static const struct panel_init_cmd inx_hj110iz_init_cmd[] = { _INIT_DCS_CMD(0x9C, 0x0B), _INIT_DCS_CMD(0x9D, 0x0A), _INIT_DCS_CMD(0x9E, 0x90), + + _INIT_DCS_CMD(0xFF, 0x25), + _INIT_DCS_CMD(0x13, 0x02), + _INIT_DCS_CMD(0x14, 0xD7), + _INIT_DCS_CMD(0xDB, 0x02), + _INIT_DCS_CMD(0xDC, 0xD7), + _INIT_DCS_CMD(0x17, 0xCF), + _INIT_DCS_CMD(0x19, 0x0F), + _INIT_DCS_CMD(0x1B, 0x5B), + + _INIT_DCS_CMD(0xFF, 0x20), + + _INIT_DCS_CMD(0xB0, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x24, 0x00, 0x38, 0x00, 0x4C, 0x00, 0x5E, 0x00, 0x6F, 0x00, 0x7E), + _INIT_DCS_CMD(0xB1, 0x00, 0x8C, 0x00, 0xBE, 0x00, 0xE5, 0x01, 0x27, 0x01, 0x58, 0x01, 0xA8, 0x01, 0xE8, 0x01, 0xEA), + _INIT_DCS_CMD(0xB2, 0x02, 0x28, 0x02, 0x71, 0x02, 0x9E, 0x02, 0xDA, 0x03, 0x00, 0x03, 0x31, 0x03, 0x40, 0x03, 0x51), + _INIT_DCS_CMD(0xB3, 0x03, 0x62, 0x03, 0x75, 0x03, 0x89, 0x03, 0x9C, 0x03, 0xAA, 0x03, 0xB2), + + _INIT_DCS_CMD(0xB4, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x27, 0x00, 0x3D, 0x00, 0x52, 0x00, 0x64, 0x00, 0x75, 0x00, 0x84), + _INIT_DCS_CMD(0xB5, 0x00, 0x93, 0x00, 0xC5, 0x00, 0xEC, 0x01, 0x2C, 0x01, 0x5D, 0x01, 0xAC, 0x01, 0xEC, 0x01, 0xEE), + _INIT_DCS_CMD(0xB6, 0x02, 0x2B, 0x02, 0x73, 0x02, 0xA0, 0x02, 0xDB, 0x03, 0x01, 0x03, 0x31, 0x03, 0x41, 0x03, 0x51), + _INIT_DCS_CMD(0xB7, 0x03, 0x63, 0x03, 0x75, 0x03, 0x89, 0x03, 0x9C, 0x03, 0xAA, 0x03, 0xB2), + + _INIT_DCS_CMD(0xB8, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x2A, 0x00, 0x40, 0x00, 0x56, 0x00, 0x68, 0x00, 0x7A, 0x00, 0x89), + _INIT_DCS_CMD(0xB9, 0x00, 0x98, 0x00, 0xC9, 0x00, 0xF1, 0x01, 0x30, 0x01, 0x61, 0x01, 0xB0, 0x01, 0xEF, 0x01, 0xF1), + _INIT_DCS_CMD(0xBA, 0x02, 0x2E, 0x02, 0x76, 0x02, 0xA3, 0x02, 0xDD, 0x03, 0x02, 0x03, 0x32, 0x03, 0x42, 0x03, 0x53), + _INIT_DCS_CMD(0xBB, 0x03, 0x66, 0x03, 0x75, 0x03, 0x89, 0x03, 0x9C, 0x03, 0xAA, 0x03, 0xB2), + + _INIT_DCS_CMD(0xFF, 0x21), + _INIT_DCS_CMD(0xB0, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x24, 0x00, 0x38, 0x00, 0x4C, 0x00, 0x5E, 0x00, 0x6F, 0x00, 0x7E), + _INIT_DCS_CMD(0xB1, 0x00, 0x8C, 0x00, 0xBE, 0x00, 0xE5, 0x01, 0x27, 0x01, 0x58, 0x01, 0xA8, 0x01, 0xE8, 0x01, 0xEA), + _INIT_DCS_CMD(0xB2, 0x02, 0x28, 0x02, 0x71, 0x02, 0x9E, 0x02, 0xDA, 0x03, 0x00, 0x03, 0x31, 0x03, 0x40, 0x03, 0x51), + _INIT_DCS_CMD(0xB3, 0x03, 0x62, 0x03, 0x77, 0x03, 0x90, 0x03, 0xAC, 0x03, 0xCA, 0x03, 0xDA), + + _INIT_DCS_CMD(0xB4, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x27, 0x00, 0x3D, 0x00, 0x52, 0x00, 0x64, 0x00, 0x75, 0x00, 0x84), + _INIT_DCS_CMD(0xB5, 0x00, 0x93, 0x00, 0xC5, 0x00, 0xEC, 0x01, 0x2C, 0x01, 0x5D, 0x01, 0xAC, 0x01, 0xEC, 0x01, 0xEE), + _INIT_DCS_CMD(0xB6, 0x02, 0x2B, 0x02, 0x73, 0x02, 0xA0, 0x02, 0xDB, 0x03, 0x01, 0x03, 0x31, 0x03, 0x41, 0x03, 0x51), + _INIT_DCS_CMD(0xB7, 0x03, 0x63, 0x03, 0x77, 0x03, 0x90, 0x03, 0xAC, 0x03, 0xCA, 0x03, 0xDA), + + _INIT_DCS_CMD(0xB8, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x2A, 0x00, 0x40, 0x00, 0x56, 0x00, 0x68, 0x00, 0x7A, 0x00, 0x89), + _INIT_DCS_CMD(0xB9, 0x00, 0x98, 0x00, 0xC9, 0x00, 0xF1, 0x01, 0x30, 0x01, 0x61, 0x01, 0xB0, 0x01, 0xEF, 0x01, 0xF1), + _INIT_DCS_CMD(0xBA, 0x02, 0x2E, 0x02, 0x76, 0x02, 0xA3, 0x02, 0xDD, 0x03, 0x02, 0x03, 0x32, 0x03, 0x42, 0x03, 0x53), + _INIT_DCS_CMD(0xBB, 0x03, 0x66, 0x03, 0x77, 0x03, 0x90, 0x03, 0xAC, 0x03, 0xCA, 0x03, 0xDA), + _INIT_DCS_CMD(0xFF, 0xF0), _INIT_DCS_CMD(0xFB, 0x01), _INIT_DCS_CMD(0x3A, 0x08), - _INIT_DCS_CMD(0xFF, 0xD0), - _INIT_DCS_CMD(0xFB, 0x01), - _INIT_DCS_CMD(0x00, 0x33), - _INIT_DCS_CMD(0x08, 0x01), - _INIT_DCS_CMD(0x09, 0xBF), - _INIT_DCS_CMD(0x2F, 0x33), - _INIT_DCS_CMD(0xFF, 0x23), - _INIT_DCS_CMD(0xFB, 0x01), - _INIT_DCS_CMD(0x00, 0x80), - _INIT_DCS_CMD(0x07, 0x00), - _INIT_DCS_CMD(0xFF, 0x20), - _INIT_DCS_CMD(0xFB, 0x01), - _INIT_DCS_CMD(0x30, 0x00), - _INIT_DCS_CMD(0xFF, 0x24), - _INIT_DCS_CMD(0x5C, 0x88), - _INIT_DCS_CMD(0x5D, 0x08), + _INIT_DCS_CMD(0xFF, 0x10), _INIT_DCS_CMD(0xB9, 0x01), + _INIT_DCS_CMD(0xFF, 0x20), + _INIT_DCS_CMD(0x18, 0x40), _INIT_DCS_CMD(0xFF, 0x10), + _INIT_DCS_CMD(0xB9, 0x02), _INIT_DCS_CMD(0xFF, 0x10), + _INIT_DCS_CMD(0xFB, 0x01), - _INIT_DCS_CMD(0xBB, 0x13), - _INIT_DCS_CMD(0x3B, 0x03, 0x96, 0x1A, 0x04, 0x04), + _INIT_DCS_CMD(0xB0, 0x01), _INIT_DCS_CMD(0x35, 0x00), - _INIT_DCS_CMD(0x51, 0x0F, 0xFF), - _INIT_DCS_CMD(0x53, 0x24), + _INIT_DCS_CMD(0x3B, 0x03, 0xAE, 0x1A, 0x04, 0x04), _INIT_DELAY_CMD(100), _INIT_DCS_CMD(0x11), _INIT_DELAY_CMD(200), @@ -1435,15 +1508,15 @@ static const struct panel_desc boe_tv110c9m_desc = { }; static const struct drm_display_mode inx_hj110iz_default_mode = { - .clock = 166594, + .clock = 168432, .hdisplay = 1200, .hsync_start = 1200 + 40, .hsync_end = 1200 + 40 + 8, .htotal = 1200 + 40 + 8 + 28, .vdisplay = 2000, .vsync_start = 2000 + 26, - .vsync_end = 2000 + 26 + 1, - .vtotal = 2000 + 26 + 1 + 149, + .vsync_end = 2000 + 26 + 2, + .vtotal = 2000 + 26 + 2 + 172, .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, }; -- cgit v1.2.3 From 788557fb23702dbd21767a69894a53c1aa58bb60 Mon Sep 17 00:00:00 2001 From: Sui Jingfeng <15330273260@189.cn> Date: Wed, 17 May 2023 12:16:02 +0800 Subject: drm/drm_atomic_helper.c: fix a typo Signed-off-by: Sui Jingfeng Acked-by: Thomas Zimmermann Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20230517041602.3225325-1-suijingfeng@loongson.cn --- drivers/gpu/drm/drm_atomic_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index e0ab555aad2c..41b8066f61ff 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -3154,7 +3154,7 @@ fail: EXPORT_SYMBOL(drm_atomic_helper_update_plane); /** - * drm_atomic_helper_disable_plane - Helper for primary plane disable using * atomic + * drm_atomic_helper_disable_plane - Helper for primary plane disable using atomic * @plane: plane to disable * @ctx: lock acquire context * -- cgit v1.2.3 From 1ad797597a80ebe1c62b12403460d71e215f417b Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Thu, 9 Mar 2023 14:37:00 +0200 Subject: drm/ttm: let struct ttm_device_funcs be placed in rodata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the struct ttm_device_funcs pointers const so the data can be placed in rodata. Cc: Christian Koenig Cc: Huang Rui Signed-off-by: Jani Nikula Reviewed-by: Christian König Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20230309123700.528641-1-jani.nikula@intel.com --- drivers/gpu/drm/ttm/ttm_device.c | 2 +- include/drm/ttm/ttm_device.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c index 64a59f46f6c3..df4cf5468e7f 100644 --- a/drivers/gpu/drm/ttm/ttm_device.c +++ b/drivers/gpu/drm/ttm/ttm_device.c @@ -189,7 +189,7 @@ EXPORT_SYMBOL(ttm_device_swapout); * Returns: * !0: Failure. */ -int ttm_device_init(struct ttm_device *bdev, struct ttm_device_funcs *funcs, +int ttm_device_init(struct ttm_device *bdev, const struct ttm_device_funcs *funcs, struct device *dev, struct address_space *mapping, struct drm_vma_offset_manager *vma_manager, bool use_dma_alloc, bool use_dma32) diff --git a/include/drm/ttm/ttm_device.h b/include/drm/ttm/ttm_device.h index 56e82ba2d046..c22f30535c84 100644 --- a/include/drm/ttm/ttm_device.h +++ b/include/drm/ttm/ttm_device.h @@ -223,7 +223,7 @@ struct ttm_device { * @funcs: Function table for the device. * Constant after bo device init */ - struct ttm_device_funcs *funcs; + const struct ttm_device_funcs *funcs; /** * @sysman: Resource manager for the system domain. @@ -287,7 +287,7 @@ static inline void ttm_set_driver_manager(struct ttm_device *bdev, int type, bdev->man_drv[type] = manager; } -int ttm_device_init(struct ttm_device *bdev, struct ttm_device_funcs *funcs, +int ttm_device_init(struct ttm_device *bdev, const struct ttm_device_funcs *funcs, struct device *dev, struct address_space *mapping, struct drm_vma_offset_manager *vma_manager, bool use_dma_alloc, bool use_dma32); -- cgit v1.2.3 From f47d6140b7a4c858d82d263e7577ff6fb5279a9c Mon Sep 17 00:00:00 2001 From: Alexander Stein Date: Wed, 17 May 2023 14:21:06 +0200 Subject: drm/bridge: tc358767: Switch to devm MIPI-DSI helpers DSI device registering and attaching needs to be undone upon deregistration. This fixes module unload/load. Fixes: bbfd3190b656 ("drm/bridge: tc358767: Add DSI-to-DPI mode support") Signed-off-by: Alexander Stein Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230517122107.1766673-1-alexander.stein@ew.tq-group.com --- drivers/gpu/drm/bridge/tc358767.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 91f7cb56a654..d6349af4f1b6 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1890,7 +1890,7 @@ static int tc_mipi_dsi_host_attach(struct tc_data *tc) if (dsi_lanes < 0) return dsi_lanes; - dsi = mipi_dsi_device_register_full(host, &info); + dsi = devm_mipi_dsi_device_register_full(dev, host, &info); if (IS_ERR(dsi)) return dev_err_probe(dev, PTR_ERR(dsi), "failed to create dsi device\n"); @@ -1901,7 +1901,7 @@ static int tc_mipi_dsi_host_attach(struct tc_data *tc) dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS; - ret = mipi_dsi_attach(dsi); + ret = devm_mipi_dsi_attach(dev, dsi); if (ret < 0) { dev_err(dev, "failed to attach dsi to host: %d\n", ret); return ret; -- cgit v1.2.3 From bb47f218fd015b8530364271463f6cbc4d15b814 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Fri, 12 May 2023 12:24:38 +0200 Subject: fbdev/hitfb: Cast I/O offset to address Cast I/O offsets to pointers to use them with I/O functions. The I/O functions expect pointers of type 'volatile void __iomem *', but the offsets are plain integers. Build warnings are ../drivers/video/fbdev/hitfb.c: In function 'hitfb_accel_wait': ../arch/x86/include/asm/hd64461.h:18:33: warning: passing argument 1 of 'fb_readw' makes pointer from integer without a cast [-Wint-conversion] 18 | #define HD64461_IO_OFFSET(x) (HD64461_IOBASE + (x)) | ^~~~~~~~~~~~~~~~~~~~~~ | | | unsigned int ../arch/x86/include/asm/hd64461.h:93:33: note: in expansion of macro 'HD64461_IO_OFFSET' 93 | #define HD64461_GRCFGR HD64461_IO_OFFSET(0x1044) /* Accelerator Configuration Register */ | ^~~~~~~~~~~~~~~~~ ../drivers/video/fbdev/hitfb.c:47:25: note: in expansion of macro 'HD64461_GRCFGR' 47 | while (fb_readw(HD64461_GRCFGR) & HD64461_GRCFGR_ACCSTATUS) ; | ^~~~~~~~~~~~~~ In file included from ../arch/x86/include/asm/fb.h:15, from ../include/linux/fb.h:19, from ../drivers/video/fbdev/hitfb.c:22: ../include/asm-generic/fb.h:52:57: note: expected 'const volatile void *' but argument is of type 'unsigned int' 52 | static inline u16 fb_readw(const volatile void __iomem *addr) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ This patch only fixes the build warnings. It's not clear if the I/O offsets can legally be passed to the I/O helpers. It was apparently broken in 2007 when custom inw()/outw() helpers got removed by commit 34a780a0afeb ("sh: hp6xx pata_platform support."). Fixing the driver would require setting the I/O base address. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202305102136.eMjTSPwH-lkp@intel.com/ Signed-off-by: Thomas Zimmermann Cc: Artur Rojek Acked-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20230512102444.5438-2-tzimmermann@suse.de --- drivers/video/fbdev/hitfb.c | 122 +++++++++++++++++++++++++------------------- 1 file changed, 69 insertions(+), 53 deletions(-) diff --git a/drivers/video/fbdev/hitfb.c b/drivers/video/fbdev/hitfb.c index 3033f5056976..7737923b7a0a 100644 --- a/drivers/video/fbdev/hitfb.c +++ b/drivers/video/fbdev/hitfb.c @@ -42,17 +42,33 @@ static struct fb_fix_screeninfo hitfb_fix = { .accel = FB_ACCEL_NONE, }; +static volatile void __iomem *hitfb_offset_to_addr(unsigned int offset) +{ + return (__force volatile void __iomem *)(uintptr_t)offset; +} + +static u16 hitfb_readw(unsigned int offset) +{ + return fb_readw(hitfb_offset_to_addr(offset)); +} + +static void hitfb_writew(u16 value, unsigned int offset) +{ + fb_writew(value, hitfb_offset_to_addr(offset)); +} + static inline void hitfb_accel_wait(void) { - while (fb_readw(HD64461_GRCFGR) & HD64461_GRCFGR_ACCSTATUS) ; + while (hitfb_readw(HD64461_GRCFGR) & HD64461_GRCFGR_ACCSTATUS) + ; } static inline void hitfb_accel_start(int truecolor) { if (truecolor) { - fb_writew(6, HD64461_GRCFGR); + hitfb_writew(6, HD64461_GRCFGR); } else { - fb_writew(7, HD64461_GRCFGR); + hitfb_writew(7, HD64461_GRCFGR); } } @@ -63,11 +79,11 @@ static inline void hitfb_accel_set_dest(int truecolor, u16 dx, u16 dy, if (truecolor) saddr <<= 1; - fb_writew(width-1, HD64461_BBTDWR); - fb_writew(height-1, HD64461_BBTDHR); + hitfb_writew(width-1, HD64461_BBTDWR); + hitfb_writew(height-1, HD64461_BBTDHR); - fb_writew(saddr & 0xffff, HD64461_BBTDSARL); - fb_writew(saddr >> 16, HD64461_BBTDSARH); + hitfb_writew(saddr & 0xffff, HD64461_BBTDSARL); + hitfb_writew(saddr >> 16, HD64461_BBTDSARH); } @@ -80,7 +96,7 @@ static inline void hitfb_accel_bitblt(int truecolor, u16 sx, u16 sy, u16 dx, height--; width--; - fb_writew(rop, HD64461_BBTROPR); + hitfb_writew(rop, HD64461_BBTROPR); if ((sy < dy) || ((sy == dy) && (sx <= dx))) { saddr = WIDTH * (sy + height) + sx + width; daddr = WIDTH * (dy + height) + dx + width; @@ -91,32 +107,32 @@ static inline void hitfb_accel_bitblt(int truecolor, u16 sx, u16 sy, u16 dx, maddr = (((width >> 4) + 1) * (height + 1) - 1) * 2; - fb_writew((1 << 5) | 1, HD64461_BBTMDR); + hitfb_writew((1 << 5) | 1, HD64461_BBTMDR); } else - fb_writew(1, HD64461_BBTMDR); + hitfb_writew(1, HD64461_BBTMDR); } else { saddr = WIDTH * sy + sx; daddr = WIDTH * dy + dx; if (mask_addr) { - fb_writew((1 << 5), HD64461_BBTMDR); + hitfb_writew((1 << 5), HD64461_BBTMDR); } else { - fb_writew(0, HD64461_BBTMDR); + hitfb_writew(0, HD64461_BBTMDR); } } if (truecolor) { saddr <<= 1; daddr <<= 1; } - fb_writew(width, HD64461_BBTDWR); - fb_writew(height, HD64461_BBTDHR); - fb_writew(saddr & 0xffff, HD64461_BBTSSARL); - fb_writew(saddr >> 16, HD64461_BBTSSARH); - fb_writew(daddr & 0xffff, HD64461_BBTDSARL); - fb_writew(daddr >> 16, HD64461_BBTDSARH); + hitfb_writew(width, HD64461_BBTDWR); + hitfb_writew(height, HD64461_BBTDHR); + hitfb_writew(saddr & 0xffff, HD64461_BBTSSARL); + hitfb_writew(saddr >> 16, HD64461_BBTSSARH); + hitfb_writew(daddr & 0xffff, HD64461_BBTDSARL); + hitfb_writew(daddr >> 16, HD64461_BBTDSARH); if (mask_addr) { maddr += mask_addr; - fb_writew(maddr & 0xffff, HD64461_BBTMARL); - fb_writew(maddr >> 16, HD64461_BBTMARH); + hitfb_writew(maddr & 0xffff, HD64461_BBTMARL); + hitfb_writew(maddr >> 16, HD64461_BBTMARH); } hitfb_accel_start(truecolor); } @@ -127,17 +143,17 @@ static void hitfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect) cfb_fillrect(p, rect); else { hitfb_accel_wait(); - fb_writew(0x00f0, HD64461_BBTROPR); - fb_writew(16, HD64461_BBTMDR); + hitfb_writew(0x00f0, HD64461_BBTROPR); + hitfb_writew(16, HD64461_BBTMDR); if (p->var.bits_per_pixel == 16) { - fb_writew(((u32 *) (p->pseudo_palette))[rect->color], + hitfb_writew(((u32 *) (p->pseudo_palette))[rect->color], HD64461_GRSCR); hitfb_accel_set_dest(1, rect->dx, rect->dy, rect->width, rect->height); hitfb_accel_start(1); } else { - fb_writew(rect->color, HD64461_GRSCR); + hitfb_writew(rect->color, HD64461_GRSCR); hitfb_accel_set_dest(0, rect->dx, rect->dy, rect->width, rect->height); hitfb_accel_start(0); @@ -162,7 +178,7 @@ static int hitfb_pan_display(struct fb_var_screeninfo *var, if (xoffset != 0) return -EINVAL; - fb_writew((yoffset*info->fix.line_length)>>10, HD64461_LCDCBAR); + hitfb_writew((yoffset*info->fix.line_length)>>10, HD64461_LCDCBAR); return 0; } @@ -172,33 +188,33 @@ int hitfb_blank(int blank_mode, struct fb_info *info) unsigned short v; if (blank_mode) { - v = fb_readw(HD64461_LDR1); + v = hitfb_readw(HD64461_LDR1); v &= ~HD64461_LDR1_DON; - fb_writew(v, HD64461_LDR1); + hitfb_writew(v, HD64461_LDR1); - v = fb_readw(HD64461_LCDCCR); + v = hitfb_readw(HD64461_LCDCCR); v |= HD64461_LCDCCR_MOFF; - fb_writew(v, HD64461_LCDCCR); + hitfb_writew(v, HD64461_LCDCCR); - v = fb_readw(HD64461_STBCR); + v = hitfb_readw(HD64461_STBCR); v |= HD64461_STBCR_SLCDST; - fb_writew(v, HD64461_STBCR); + hitfb_writew(v, HD64461_STBCR); } else { - v = fb_readw(HD64461_STBCR); + v = hitfb_readw(HD64461_STBCR); v &= ~HD64461_STBCR_SLCDST; - fb_writew(v, HD64461_STBCR); + hitfb_writew(v, HD64461_STBCR); - v = fb_readw(HD64461_LCDCCR); + v = hitfb_readw(HD64461_LCDCCR); v &= ~(HD64461_LCDCCR_MOFF | HD64461_LCDCCR_STREQ); - fb_writew(v, HD64461_LCDCCR); + hitfb_writew(v, HD64461_LCDCCR); do { - v = fb_readw(HD64461_LCDCCR); + v = hitfb_readw(HD64461_LCDCCR); } while(v&HD64461_LCDCCR_STBACK); - v = fb_readw(HD64461_LDR1); + v = hitfb_readw(HD64461_LDR1); v |= HD64461_LDR1_DON; - fb_writew(v, HD64461_LDR1); + hitfb_writew(v, HD64461_LDR1); } return 0; } @@ -211,10 +227,10 @@ static int hitfb_setcolreg(unsigned regno, unsigned red, unsigned green, switch (info->var.bits_per_pixel) { case 8: - fb_writew(regno << 8, HD64461_CPTWAR); - fb_writew(red >> 10, HD64461_CPTWDR); - fb_writew(green >> 10, HD64461_CPTWDR); - fb_writew(blue >> 10, HD64461_CPTWDR); + hitfb_writew(regno << 8, HD64461_CPTWAR); + hitfb_writew(red >> 10, HD64461_CPTWDR); + hitfb_writew(green >> 10, HD64461_CPTWDR); + hitfb_writew(blue >> 10, HD64461_CPTWDR); break; case 16: if (regno >= 16) @@ -302,11 +318,11 @@ static int hitfb_set_par(struct fb_info *info) break; } - fb_writew(info->fix.line_length, HD64461_LCDCLOR); - ldr3 = fb_readw(HD64461_LDR3); + hitfb_writew(info->fix.line_length, HD64461_LCDCLOR); + ldr3 = hitfb_readw(HD64461_LDR3); ldr3 &= ~15; ldr3 |= (info->var.bits_per_pixel == 8) ? 4 : 8; - fb_writew(ldr3, HD64461_LDR3); + hitfb_writew(ldr3, HD64461_LDR3); return 0; } @@ -337,9 +353,9 @@ static int hitfb_probe(struct platform_device *dev) hitfb_fix.smem_start = HD64461_IO_OFFSET(0x02000000); hitfb_fix.smem_len = 512 * 1024; - lcdclor = fb_readw(HD64461_LCDCLOR); - ldvndr = fb_readw(HD64461_LDVNDR); - ldr3 = fb_readw(HD64461_LDR3); + lcdclor = hitfb_readw(HD64461_LCDCLOR); + ldvndr = hitfb_readw(HD64461_LDVNDR); + ldr3 = hitfb_readw(HD64461_LDR3); switch (ldr3 & 15) { default: @@ -429,9 +445,9 @@ static int hitfb_suspend(struct device *dev) u16 v; hitfb_blank(1,0); - v = fb_readw(HD64461_STBCR); + v = hitfb_readw(HD64461_STBCR); v |= HD64461_STBCR_SLCKE_IST; - fb_writew(v, HD64461_STBCR); + hitfb_writew(v, HD64461_STBCR); return 0; } @@ -440,12 +456,12 @@ static int hitfb_resume(struct device *dev) { u16 v; - v = fb_readw(HD64461_STBCR); + v = hitfb_readw(HD64461_STBCR); v &= ~HD64461_STBCR_SLCKE_OST; msleep(100); - v = fb_readw(HD64461_STBCR); + v = hitfb_readw(HD64461_STBCR); v &= ~HD64461_STBCR_SLCKE_IST; - fb_writew(v, HD64461_STBCR); + hitfb_writew(v, HD64461_STBCR); hitfb_blank(0,0); return 0; -- cgit v1.2.3 From 2df418ff8be6c5e96bf92d74ce341342dc9080fe Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Fri, 12 May 2023 12:24:39 +0200 Subject: fbdev/matrox: Remove trailing whitespaces Fix coding style. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Arnd Bergmann Reviewed-by: Sam Ravnborg Reviewed-by: Sui Jingfeng Tested-by: Sui Jingfeng Link: https://patchwork.freedesktop.org/patch/msgid/20230512102444.5438-3-tzimmermann@suse.de --- drivers/video/fbdev/matrox/matroxfb_accel.c | 6 +++--- drivers/video/fbdev/matrox/matroxfb_base.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/video/fbdev/matrox/matroxfb_accel.c b/drivers/video/fbdev/matrox/matroxfb_accel.c index 9cb0685feddd..ce51227798a1 100644 --- a/drivers/video/fbdev/matrox/matroxfb_accel.c +++ b/drivers/video/fbdev/matrox/matroxfb_accel.c @@ -88,7 +88,7 @@ static inline void matrox_cfb4_pal(u_int32_t* pal) { unsigned int i; - + for (i = 0; i < 16; i++) { pal[i] = i * 0x11111111U; } @@ -96,7 +96,7 @@ static inline void matrox_cfb4_pal(u_int32_t* pal) { static inline void matrox_cfb8_pal(u_int32_t* pal) { unsigned int i; - + for (i = 0; i < 16; i++) { pal[i] = i * 0x01010101U; } @@ -482,7 +482,7 @@ static void matroxfb_1bpp_imageblit(struct matrox_fb_info *minfo, u_int32_t fgx, /* Tell... well, why bother... */ while (height--) { size_t i; - + for (i = 0; i < step; i += 4) { /* Hope that there are at least three readable bytes beyond the end of bitmap */ fb_writel(get_unaligned((u_int32_t*)(chardata + i)),mmio.vaddr); diff --git a/drivers/video/fbdev/matrox/matroxfb_base.h b/drivers/video/fbdev/matrox/matroxfb_base.h index 958be6805f87..c93c69bbcd57 100644 --- a/drivers/video/fbdev/matrox/matroxfb_base.h +++ b/drivers/video/fbdev/matrox/matroxfb_base.h @@ -301,9 +301,9 @@ struct matrox_altout { int (*verifymode)(void* altout_dev, u_int32_t mode); int (*getqueryctrl)(void* altout_dev, struct v4l2_queryctrl* ctrl); - int (*getctrl)(void* altout_dev, + int (*getctrl)(void *altout_dev, struct v4l2_control* ctrl); - int (*setctrl)(void* altout_dev, + int (*setctrl)(void *altout_dev, struct v4l2_control* ctrl); }; -- cgit v1.2.3 From 30745abe9bb8c67f4ac5486cd810cbb72e3afa16 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Fri, 12 May 2023 12:24:40 +0200 Subject: ipu-v3: Include The code uses readl() and writel(). Include the header file to get the declarations. Signed-off-by: Thomas Zimmermann Reviewed-by: Arnd Bergmann Reviewed-by: Sam Ravnborg Reviewed-by: Sui Jingfeng Link: https://patchwork.freedesktop.org/patch/msgid/20230512102444.5438-4-tzimmermann@suse.de --- drivers/gpu/ipu-v3/ipu-prv.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/ipu-v3/ipu-prv.h b/drivers/gpu/ipu-v3/ipu-prv.h index 291ac1bab66d..d4621b1ea7f1 100644 --- a/drivers/gpu/ipu-v3/ipu-prv.h +++ b/drivers/gpu/ipu-v3/ipu-prv.h @@ -8,6 +8,7 @@ struct ipu_soc; +#include #include #include #include -- cgit v1.2.3 From e1d534ac5b764a573789d4e1d79be6fb7abb1d78 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Fri, 12 May 2023 12:24:41 +0200 Subject: fbdev: Include in various drivers The code uses writel() and similar I/O-memory helpers. Include the header file to get the declarations. Signed-off-by: Thomas Zimmermann Reviewed-by: Arnd Bergmann Reviewed-by: Sam Ravnborg Reviewed-by: Sui Jingfeng Link: https://patchwork.freedesktop.org/patch/msgid/20230512102444.5438-5-tzimmermann@suse.de --- drivers/video/fbdev/arcfb.c | 1 + drivers/video/fbdev/aty/atyfb.h | 2 ++ drivers/video/fbdev/wmt_ge_rops.c | 2 ++ 3 files changed, 5 insertions(+) diff --git a/drivers/video/fbdev/arcfb.c b/drivers/video/fbdev/arcfb.c index 7750e020839e..ace104850e50 100644 --- a/drivers/video/fbdev/arcfb.c +++ b/drivers/video/fbdev/arcfb.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/video/fbdev/aty/atyfb.h b/drivers/video/fbdev/aty/atyfb.h index 465f55beb97f..30da3e82ed3c 100644 --- a/drivers/video/fbdev/aty/atyfb.h +++ b/drivers/video/fbdev/aty/atyfb.h @@ -3,8 +3,10 @@ * ATI Frame Buffer Device Driver Core Definitions */ +#include #include #include + /* * Elements of the hardware specific atyfb_par structure */ diff --git a/drivers/video/fbdev/wmt_ge_rops.c b/drivers/video/fbdev/wmt_ge_rops.c index 3ed143457d22..b70961901683 100644 --- a/drivers/video/fbdev/wmt_ge_rops.c +++ b/drivers/video/fbdev/wmt_ge_rops.c @@ -9,7 +9,9 @@ #include #include +#include #include + #include "core/fb_draw.h" #include "wmt_ge_rops.h" -- cgit v1.2.3 From 8ff1541da3908b504cb53e5384d5deae2b9c6e1a Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Fri, 12 May 2023 12:24:42 +0200 Subject: fbdev: Include instead of Replace include statements for with . Fixes the coding style: if a header is available in asm/ and linux/, it is preferable to include the header from linux/. This only affects a few source files, most of which already include . Suggested-by: Sam Ravnborg Signed-off-by: Thomas Zimmermann Reviewed-by: Arnd Bergmann Reviewed-by: Sui Jingfeng Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20230512102444.5438-6-tzimmermann@suse.de --- arch/parisc/video/fbdev.c | 3 +-- arch/sparc/video/fbdev.c | 1 - arch/x86/video/fbdev.c | 2 -- drivers/staging/sm750fb/sm750.c | 2 +- drivers/video/fbdev/core/fbcon.c | 1 - drivers/video/fbdev/core/fbmem.c | 2 -- include/linux/fb.h | 2 ++ 7 files changed, 4 insertions(+), 9 deletions(-) diff --git a/arch/parisc/video/fbdev.c b/arch/parisc/video/fbdev.c index 4a0ae08fc75b..137561d98246 100644 --- a/arch/parisc/video/fbdev.c +++ b/arch/parisc/video/fbdev.c @@ -5,10 +5,9 @@ * Copyright (C) 2001-2002 Thomas Bogendoerfer */ +#include #include -#include - #include