Re: [PATCH v2 1/2] drm/client: Dual licence the file in GPL-2 and MIT
On Mon, 24 Feb 2020 11:40:38 + Chris Wilson wrote: > Quoting Jani Nikula (2020-02-15 18:33:09) > > On Sat, 15 Feb 2020, Emmanuel Vadot wrote: > > > From: Emmanuel Vadot > > > > > > Contributors for this file are : > > > Chris Wilson > > > Denis Efremov > > > Jani Nikula > > > Maxime Ripard > > > Noralf Trønnes > > > Sam Ravnborg > > > Thomas Zimmermann > > > > > > Signed-off-by: Emmanuel Vadot > > > > I've only converted some logging. > > > > Acked-by: Jani Nikula > > Bonus ack from another Intel employee to cover all Intel copyright in > this file, > Acked-by: Chris Wilson > -Chris Thanks Chris, Daniel, if I'm counting right this was the last ack needed. -- Emmanuel Vadot ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v10 08/12] drm/bridge: lvds-codec: Implement basic bus format negotiation
On Tue, 25 Feb 2020 07:15:43 +0100 Sam Ravnborg wrote: > Hi Boris/Laurent. > > > > + > > > + err = of_property_read_u32(np, "bus-width", &input_bus_width); > > > + of_node_put(np); > > > + > > > + if (err) { > > > + lvds_codec->input_fmt = MEDIA_BUS_FMT_FIXED; > > > + } else if (input_bus_width == 18) { > > > + lvds_codec->input_fmt = MEDIA_BUS_FMT_RGB666_1X18; > > > + } else if (input_bus_width == 24) { > > > + lvds_codec->input_fmt = MEDIA_BUS_FMT_RGB888_1X24; > > > + } else { > > > + dev_dbg(dev, "unsupported bus-width value %u on port 0\n", > > > + input_bus_width); > > > + return -ENOTSUPP; > > > > ENOTSUPP is "Operation not supported", I'd go for -EINVAL. > > > > > + } > > > > Doesn't this apply to LVDS encoders only ? For LVDS decoders I don't > > think we want to report an RGB format on the input. > > In panel-lvds we use the property "data-mapping" for the same purpose. > To specify the MEDIA_BUS format. I started with data-mapping, and was told (by Laurent IIRC) that bus-width would be more appropriate for a DPI (AKA RGB) bus. I think it has to do with the fact that fully-parallel buses always have one color bit per-signal, while serial or partially-parallel buses can have several color-bits per-signal, the assignment being described by this 'data-mapping' property. This being said, I can see a case where data-mapping would be needed for DPI buses => RGB component ordering. A 24bit bus does not distinguish between RGB888 and BGR888. > > It would be good to standardize on the same property, and maybe have the > same binding descriptions for all. As for the standardization, I'm all for it, but let's do that in a second step, please. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v10 10/12] drm/bridge: panel: Propage bus format/flags
On Tue, 25 Feb 2020 00:34:00 +0200 Laurent Pinchart wrote: > Hi Boris, > > Thank you for the patch. > > On Fri, Jan 31, 2020 at 06:25:05PM +0100, Boris Brezillon wrote: > > And the typo (Propage -> Propagate) is still there :-(. Fixing it right > > now so I don't forget. > > > > On Tue, 28 Jan 2020 14:55:12 +0100 Boris Brezillon wrote: > > > So that the previous bridge element in the chain knows which input > > > format the panel bridge expects. > > I've been told multiple times by Tomi that the commit message should be > readable by itself, not just as a continuation of the subject line. I > was annoyed in the beginning, as I had to change my habits, but I think > it's an actual improvement. You may want to pay attention to that too in > the future. > > > > v10: > > > * Add changelog to the commit message > > > > > > v8 -> v9: > > > * No changes > > > > > > v7: > > > * Set atomic state hooks explicitly > > > > > > v4 -> v6: > > > * Not part of the series > > > > > > v3: > > > * Adjust things to match the new bus-format negotiation approach > > > * Use drm_atomic_helper_bridge_propagate_bus_fmt > > > * Don't implement ->atomic_check() (the core now takes care of bus > > > flags propagation) > > > > > > v2: > > > * Adjust things to match the new bus-format negotiation approach > > > > > > Signed-off-by: Boris Brezillon > > With the typo fixed, > > Reviewed-by: Laurent Pinchart Will fix the typo, update the commit message and push this patch directly. Thanks, Boris > > > > --- > > > drivers/gpu/drm/bridge/panel.c | 4 > > > 1 file changed, 4 insertions(+) > > > > > > diff --git a/drivers/gpu/drm/bridge/panel.c > > > b/drivers/gpu/drm/bridge/panel.c > > > index f66777e24968..dcc72bd7df30 100644 > > > --- a/drivers/gpu/drm/bridge/panel.c > > > +++ b/drivers/gpu/drm/bridge/panel.c > > > @@ -127,6 +127,10 @@ static const struct drm_bridge_funcs > > > panel_bridge_bridge_funcs = { > > > .enable = panel_bridge_enable, > > > .disable = panel_bridge_disable, > > > .post_disable = panel_bridge_post_disable, > > > + .atomic_reset = drm_atomic_helper_bridge_reset, > > > + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, > > > + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, > > > + .atomic_get_input_bus_fmts = drm_atomic_helper_bridge_propagate_bus_fmt, > > > }; > > > > > > /** > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 42/56] drm/omap: remove global dss_device variable
We can simply provide the device to the omapdrm driver via pdata. omapdss_is_initialized() is no longer required (even before this patch), since omapdrm device is only registered after the pointer is initialized. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/dss/base.c| 14 -- drivers/gpu/drm/omapdrm/dss/dss.c | 9 - drivers/gpu/drm/omapdrm/dss/omapdss.h | 9 +++-- drivers/gpu/drm/omapdrm/omap_drv.c| 6 ++ 4 files changed, 9 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/base.c b/drivers/gpu/drm/omapdrm/dss/base.c index 455b410f7401..8e08c49b4f97 100644 --- a/drivers/gpu/drm/omapdrm/dss/base.c +++ b/drivers/gpu/drm/omapdrm/dss/base.c @@ -16,20 +16,6 @@ #include "dss.h" #include "omapdss.h" -static struct dss_device *dss_device; - -struct dss_device *omapdss_get_dss(void) -{ - return dss_device; -} -EXPORT_SYMBOL(omapdss_get_dss); - -void omapdss_set_dss(struct dss_device *dss) -{ - dss_device = dss; -} -EXPORT_SYMBOL(omapdss_set_dss); - struct dispc_device *dispc_get_dispc(struct dss_device *dss) { return dss->dispc; diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c index b76fc2b56227..4438947326ea 100644 --- a/drivers/gpu/drm/omapdrm/dss/dss.c +++ b/drivers/gpu/drm/omapdrm/dss/dss.c @@ -1305,6 +1305,7 @@ static int dss_bind(struct device *dev) { struct dss_device *dss = dev_get_drvdata(dev); struct platform_device *drm_pdev; + struct dss_pdata pdata; int r; r = component_bind_all(dev, NULL); @@ -1313,9 +1314,9 @@ static int dss_bind(struct device *dev) pm_set_vt_switch(0); - omapdss_set_dss(dss); - - drm_pdev = platform_device_register_simple("omapdrm", 0, NULL, 0); + pdata.dss = dss; + drm_pdev = platform_device_register_data(NULL, "omapdrm", 0, +&pdata, sizeof(pdata)); if (IS_ERR(drm_pdev)) { component_unbind_all(dev, NULL); return PTR_ERR(drm_pdev); @@ -1332,8 +1333,6 @@ static void dss_unbind(struct device *dev) platform_device_unregister(dss->drm_pdev); - omapdss_set_dss(NULL); - component_unbind_all(dev, NULL); } diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index 10e6ae666dfa..9f8aefaadefe 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -355,12 +355,9 @@ struct omap_dss_device { unsigned int of_port; }; -struct dss_device *omapdss_get_dss(void); -void omapdss_set_dss(struct dss_device *dss); -static inline bool omapdss_is_initialized(void) -{ - return !!omapdss_get_dss(); -} +struct dss_pdata { + struct dss_device *dss; +}; void omapdss_display_init(struct omap_dss_device *dssdev); int omapdss_display_get_modes(struct drm_connector *connector, diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index cdafd7ef1c32..579f9d80fec9 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -594,6 +594,7 @@ static const struct soc_device_attribute omapdrm_soc_devices[] = { static int omapdrm_init(struct omap_drm_private *priv, struct device *dev) { const struct soc_device_attribute *soc; + struct dss_pdata *pdata = dev->platform_data; struct drm_device *ddev; unsigned int i; int ret; @@ -609,7 +610,7 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev) ddev->dev_private = priv; priv->dev = dev; - priv->dss = omapdss_get_dss(); + priv->dss = pdata->dss; priv->dispc = dispc_get_dispc(priv->dss); priv->dispc_ops = dispc_get_ops(priv->dss); @@ -707,9 +708,6 @@ static int pdev_probe(struct platform_device *pdev) struct omap_drm_private *priv; int ret; - if (omapdss_is_initialized() == false) - return -EPROBE_DEFER; - ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); if (ret) { dev_err(&pdev->dev, "Failed to set the DMA mask\n"); -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 36/56] drm/omap: drop omapdss-boot-init
The table of compatible values needed to be prefixed with "omapdss," is empty, so all of this code is doing nothing now. Let's drop it. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/dss/Kconfig | 3 - drivers/gpu/drm/omapdrm/dss/Makefile | 2 - .../gpu/drm/omapdrm/dss/omapdss-boot-init.c | 219 -- 3 files changed, 224 deletions(-) delete mode 100644 drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c diff --git a/drivers/gpu/drm/omapdrm/dss/Kconfig b/drivers/gpu/drm/omapdrm/dss/Kconfig index 90e2dd522896..9ac60c24787b 100644 --- a/drivers/gpu/drm/omapdrm/dss/Kconfig +++ b/drivers/gpu/drm/omapdrm/dss/Kconfig @@ -1,7 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only -config OMAP2_DSS_INIT - bool - config OMAP_DSS_BASE tristate diff --git a/drivers/gpu/drm/omapdrm/dss/Makefile b/drivers/gpu/drm/omapdrm/dss/Makefile index f967e6948f2e..811966cd7468 100644 --- a/drivers/gpu/drm/omapdrm/dss/Makefile +++ b/drivers/gpu/drm/omapdrm/dss/Makefile @@ -1,6 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 -obj-$(CONFIG_OMAP2_DSS_INIT) += omapdss-boot-init.o - obj-$(CONFIG_OMAP_DSS_BASE) += omapdss-base.o omapdss-base-y := base.o display.o output.o diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c b/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c deleted file mode 100644 index c849927ff185.. --- a/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c +++ /dev/null @@ -1,219 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/ - * Author: Tomi Valkeinen - */ - -/* - * As omapdss panel drivers are omapdss specific, but we want to define the - * DT-data in generic manner, we convert the compatible strings of the panel and - * encoder nodes from "panel-foo" to "omapdss,panel-foo". This way we can have - * both correct DT data and omapdss specific drivers. - * - * When we get generic panel drivers to the kernel, this file will be removed. - */ - -#include -#include -#include -#include -#include - -static struct list_head dss_conv_list __initdata; - -static const char prefix[] __initconst = "omapdss,"; - -struct dss_conv_node { - struct list_head list; - struct device_node *node; - bool root; -}; - -static int __init omapdss_count_strings(const struct property *prop) -{ - const char *p = prop->value; - int l = 0, total = 0; - int i; - - for (i = 0; total < prop->length; total += l, p += l, i++) - l = strlen(p) + 1; - - return i; -} - -static void __init omapdss_update_prop(struct device_node *node, char *compat, - int len) -{ - struct property *prop; - - prop = kzalloc(sizeof(*prop), GFP_KERNEL); - if (!prop) - return; - - prop->name = "compatible"; - prop->value = compat; - prop->length = len; - - of_update_property(node, prop); -} - -static void __init omapdss_prefix_strcpy(char *dst, int dst_len, - const char *src, int src_len) -{ - size_t total = 0; - - while (total < src_len) { - size_t l = strlen(src) + 1; - - strcpy(dst, prefix); - dst += strlen(prefix); - - strcpy(dst, src); - dst += l; - - src += l; - total += l; - } -} - -/* prepend compatible property strings with "omapdss," */ -static void __init omapdss_omapify_node(struct device_node *node) -{ - struct property *prop; - char *new_compat; - int num_strs; - int new_len; - - prop = of_find_property(node, "compatible", NULL); - - if (!prop || !prop->value) - return; - - if (strnlen(prop->value, prop->length) >= prop->length) - return; - - /* is it already prefixed? */ - if (strncmp(prefix, prop->value, strlen(prefix)) == 0) - return; - - num_strs = omapdss_count_strings(prop); - - new_len = prop->length + strlen(prefix) * num_strs; - new_compat = kmalloc(new_len, GFP_KERNEL); - - omapdss_prefix_strcpy(new_compat, new_len, prop->value, prop->length); - - omapdss_update_prop(node, new_compat, new_len); -} - -static void __init omapdss_add_to_list(struct device_node *node, bool root) -{ - struct dss_conv_node *n = kmalloc(sizeof(*n), GFP_KERNEL); - if (n) { - n->node = node; - n->root = root; - list_add(&n->list, &dss_conv_list); - } -} - -static bool __init omapdss_list_contains(const struct device_node *node) -{ - struct dss_conv_node *n; - - list_for_each_entry(n, &dss_conv_list, list) { - if (n->node == node) - return true; - } - - return false; -} - -static void __init omapdss_walk_device(struct device_node *node, bool root) -{ - struct device_node *n; - - omapdss_add_to_list(node, root); - -
Re: [PATCH 04/89] i2c: brcmstb: Allow to compile it on BCM2835
On 2/24/20 1:06 AM, Maxime Ripard wrote: > The BCM2711, supported by ARCH_BCM2835, also has a controller by the > brcmstb driver so let's allow it to be compiled on that platform. > > Cc: Kamal Dasu > Cc: Florian Fainelli > Cc: Wolfram Sang > Cc: bcm-kernel-feedback-l...@broadcom.com > Cc: linux-...@vger.kernel.org > Signed-off-by: Maxime Ripard Acked-by: Florian Fainelli -- Florian ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 48/56] drm/omap: simplify omap_display_id
We no longer need to check for the DSS API, since all encoders, panels and connectors have been converted to the bridge API. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/omap_drv.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index 4c2095067544..3a1982e7aa98 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -206,14 +206,7 @@ static int omap_display_id(struct omap_dss_device *output) { struct device_node *node = NULL; - if (output->next) { - struct omap_dss_device *display = output; - - while (display->next) - display = display->next; - - node = display->dev->of_node; - } else if (output->bridge) { + if (output->bridge) { struct drm_bridge *bridge = output->bridge; while (drm_bridge_get_next_bridge(bridge)) -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 2/7] drm/sun4i: Add separate DE3 VI layer formats
DE3 VI layers support alpha blending, but DE2 VI layers do not. Additionally, DE3 VI layers support 10-bit RGB and YUV formats. Make a separate list for DE3. Fixes: c50519e6db4d ("drm/sun4i: Add basic support for DE3") Signed-off-by: Jernej Skrabec --- drivers/gpu/drm/sun4i/sun8i_mixer.c| 36 drivers/gpu/drm/sun4i/sun8i_mixer.h| 11 + drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 58 -- 3 files changed, 102 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c index 3a78dbbceb8a..655445bfe64a 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c @@ -148,6 +148,30 @@ static const struct de2_fmt_info de2_formats[] = { .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, + { + .drm_fmt = DRM_FORMAT_ARGB2101010, + .de2_fmt = SUN8I_MIXER_FBFMT_ARGB2101010, + .rgb = true, + .csc = SUN8I_CSC_MODE_OFF, + }, + { + .drm_fmt = DRM_FORMAT_ABGR2101010, + .de2_fmt = SUN8I_MIXER_FBFMT_ABGR2101010, + .rgb = true, + .csc = SUN8I_CSC_MODE_OFF, + }, + { + .drm_fmt = DRM_FORMAT_RGBA1010102, + .de2_fmt = SUN8I_MIXER_FBFMT_RGBA1010102, + .rgb = true, + .csc = SUN8I_CSC_MODE_OFF, + }, + { + .drm_fmt = DRM_FORMAT_BGRA1010102, + .de2_fmt = SUN8I_MIXER_FBFMT_BGRA1010102, + .rgb = true, + .csc = SUN8I_CSC_MODE_OFF, + }, { .drm_fmt = DRM_FORMAT_UYVY, .de2_fmt = SUN8I_MIXER_FBFMT_UYVY, @@ -232,6 +256,18 @@ static const struct de2_fmt_info de2_formats[] = { .rgb = false, .csc = SUN8I_CSC_MODE_YVU2RGB, }, + { + .drm_fmt = DRM_FORMAT_P010, + .de2_fmt = SUN8I_MIXER_FBFMT_P010_YUV, + .rgb = false, + .csc = SUN8I_CSC_MODE_YUV2RGB, + }, + { + .drm_fmt = DRM_FORMAT_P210, + .de2_fmt = SUN8I_MIXER_FBFMT_P210_YUV, + .rgb = false, + .csc = SUN8I_CSC_MODE_YUV2RGB, + }, }; const struct de2_fmt_info *sun8i_mixer_format_info(u32 format) diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.h b/drivers/gpu/drm/sun4i/sun8i_mixer.h index c6cc94057faf..345b28b0a80a 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.h +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.h @@ -93,6 +93,10 @@ #define SUN8I_MIXER_FBFMT_ABGR1555 17 #define SUN8I_MIXER_FBFMT_RGBA5551 18 #define SUN8I_MIXER_FBFMT_BGRA5551 19 +#define SUN8I_MIXER_FBFMT_ARGB2101010 20 +#define SUN8I_MIXER_FBFMT_ABGR2101010 21 +#define SUN8I_MIXER_FBFMT_RGBA1010102 22 +#define SUN8I_MIXER_FBFMT_BGRA1010102 23 #define SUN8I_MIXER_FBFMT_YUYV 0 #define SUN8I_MIXER_FBFMT_UYVY 1 @@ -109,6 +113,13 @@ /* format 12 is semi-planar YUV411 UVUV */ /* format 13 is semi-planar YUV411 VUVU */ #define SUN8I_MIXER_FBFMT_YUV411 14 +/* format 15 doesn't exist */ +/* format 16 is P010 YVU */ +#define SUN8I_MIXER_FBFMT_P010_YUV 17 +/* format 18 is P210 YVU */ +#define SUN8I_MIXER_FBFMT_P210_YUV 19 +/* format 20 is packed YVU444 10-bit */ +/* format 21 is packed YUV444 10-bit */ /* * Sub-engines listed bellow are unused for now. The EN registers are here only diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c index 6a244d6fafd9..6c0084a3c3d7 100644 --- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c +++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c @@ -436,24 +436,76 @@ static const u32 sun8i_vi_layer_formats[] = { DRM_FORMAT_YVU422, }; +static const u32 sun8i_vi_layer_de3_formats[] = { + DRM_FORMAT_ABGR1555, + DRM_FORMAT_ABGR2101010, + DRM_FORMAT_ABGR, + DRM_FORMAT_ABGR, + DRM_FORMAT_ARGB1555, + DRM_FORMAT_ARGB2101010, + DRM_FORMAT_ARGB, + DRM_FORMAT_ARGB, + DRM_FORMAT_BGR565, + DRM_FORMAT_BGR888, + DRM_FORMAT_BGRA1010102, + DRM_FORMAT_BGRA5551, + DRM_FORMAT_BGRA, + DRM_FORMAT_BGRA, + DRM_FORMAT_BGRX, + DRM_FORMAT_RGB565, + DRM_FORMAT_RGB888, + DRM_FORMAT_RGBA1010102, + DRM_FORMAT_RGBA, + DRM_FORMAT_RGBA5551, + DRM_FORMAT_RGBA, + DRM_FORMAT_RGBX, + DRM_FORMAT_XBGR, + DRM_FORMAT_XRGB, + + DRM_FORMAT_NV16, + DRM_FORMAT_NV12, + DRM_FORMAT_NV21, + DRM_FORMAT_NV61, + DRM_FORMAT_P010, + DRM_FORMAT_P210, + DRM_FORMAT_UYVY, + DRM_FORMAT_VYUY, + DRM_FORMAT_YUYV, + DRM_FORMAT_YVYU, + DRM_FORMAT_YUV411, + DRM_FORMAT_YUV420, + DRM_FORMAT_YUV422, + DRM_FORMAT_YVU411, + DRM_FORMAT_YVU420, + DRM_FORMAT_YVU42
[PATCHv2 14/56] drm/omap: dsi: introduce mipi_dsi_host
This moves from custom platform driver infrastructure to mipi_dsi_host and mipi_dsi_device. Note, that this is a graduate step and the driver only uses the devices types and transfer function, but not yet the new device binding style or drm_panel. Signed-off-by: Sebastian Reichel --- .../gpu/drm/omapdrm/displays/panel-dsi-cm.c | 119 +- drivers/gpu/drm/omapdrm/dss/dsi.c | 54 ++-- drivers/gpu/drm/omapdrm/dss/omapdss.h | 4 - 3 files changed, 102 insertions(+), 75 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index ba046a596044..c34daecb1de5 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -39,13 +38,13 @@ #define DCS_GET_ID30xdc struct panel_drv_data { + struct mipi_dsi_device *dsi; + struct omap_dss_device dssdev; struct omap_dss_device *src; struct videomode vm; - struct platform_device *pdev; - struct mutex lock; struct backlight_device *bldev; @@ -139,7 +138,7 @@ static void hw_guard_wait(struct panel_drv_data *ddata) static int dsicm_dcs_read_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 *data) { - struct omap_dss_device *src = ddata->src; + struct mipi_dsi_device *dsi = ddata->dsi; const struct mipi_dsi_msg msg = { .channel = ddata->channel, .type = MIPI_DSI_DCS_READ, @@ -149,12 +148,12 @@ static int dsicm_dcs_read_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 *data) .rx_buf = data }; - return src->ops->dsi.transfer(src, &msg); + return dsi->host->ops->transfer(dsi->host, &msg); } static int dsicm_dcs_write_0(struct panel_drv_data *ddata, u8 dcs_cmd) { - struct omap_dss_device *src = ddata->src; + struct mipi_dsi_device *dsi = ddata->dsi; const struct mipi_dsi_msg msg = { .channel = ddata->channel, .type = MIPI_DSI_DCS_SHORT_WRITE, @@ -162,12 +161,12 @@ static int dsicm_dcs_write_0(struct panel_drv_data *ddata, u8 dcs_cmd) .tx_len = 1, }; - return src->ops->dsi.transfer(src, &msg); + return dsi->host->ops->transfer(dsi->host, &msg); } static int dsicm_dcs_write_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 param) { - struct omap_dss_device *src = ddata->src; + struct mipi_dsi_device *dsi = ddata->dsi; const u8 buf[] = { dcs_cmd, param }; const struct mipi_dsi_msg msg = { .channel = ddata->channel, @@ -176,13 +175,13 @@ static int dsicm_dcs_write_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 param) .tx_len = 2, }; - return src->ops->dsi.transfer(src, &msg); + return dsi->host->ops->transfer(dsi->host, &msg); } static int dsicm_sleep_in(struct panel_drv_data *ddata) { - struct omap_dss_device *src = ddata->src; + struct mipi_dsi_device *dsi = ddata->dsi; int r; const u8 cmd = MIPI_DCS_ENTER_SLEEP_MODE; const struct mipi_dsi_msg msg = { @@ -194,7 +193,7 @@ static int dsicm_sleep_in(struct panel_drv_data *ddata) hw_guard_wait(ddata); - r = src->ops->dsi.transfer(src, &msg); + r = dsi->host->ops->transfer(dsi->host, &msg); if (r) return r; @@ -242,7 +241,7 @@ static int dsicm_get_id(struct panel_drv_data *ddata, u8 *id1, u8 *id2, u8 *id3) static int dsicm_set_update_window(struct panel_drv_data *ddata, u16 x, u16 y, u16 w, u16 h) { - struct omap_dss_device *src = ddata->src; + struct mipi_dsi_device *dsi = ddata->dsi; int r; u16 x1 = x; u16 x2 = x + w - 1; @@ -280,11 +279,11 @@ static int dsicm_set_update_window(struct panel_drv_data *ddata, }; - r = src->ops->dsi.transfer(src, &msgX); + r = dsi->host->ops->transfer(dsi->host, &msgX); if (r) return r; - r = src->ops->dsi.transfer(src, &msgY); + r = dsi->host->ops->transfer(dsi->host, &msgY); if (r) return r; @@ -327,7 +326,7 @@ static int dsicm_enter_ulps(struct panel_drv_data *ddata) return 0; err: - dev_err(&ddata->pdev->dev, "enter ULPS failed"); + dev_err(&ddata->dsi->dev, "enter ULPS failed"); dsicm_panel_reset(ddata); ddata->ulps_enabled = false; @@ -350,7 +349,7 @@ static int dsicm_exit_ulps(struct panel_drv_data *ddata) r = _dsicm_enable_te(ddata, true); if (r) { - dev_err(&ddata->pdev->dev, "failed to re-enable TE"); + dev_err(&ddata->dsi->dev, "failed to re-enable TE"); goto err2; } @@ -364,7 +363,7 @@ static int dsicm_exit_ulps(struct panel_drv_data *ddata)
[PATCHv2 11/56] drm/omap: dsi: simplify write function
Simplify the write related messages handling by using the functionality provided by CONFIG_DRM_MIPI_DSI. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/dss/Kconfig | 1 + drivers/gpu/drm/omapdrm/dss/dsi.c | 144 +++- 2 files changed, 33 insertions(+), 112 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/Kconfig b/drivers/gpu/drm/omapdrm/dss/Kconfig index 72ae79c0c9b4..90e2dd522896 100644 --- a/drivers/gpu/drm/omapdrm/dss/Kconfig +++ b/drivers/gpu/drm/omapdrm/dss/Kconfig @@ -95,6 +95,7 @@ config OMAP2_DSS_SDI config OMAP2_DSS_DSI bool "DSI support" default n + select DRM_MIPI_DSI help MIPI DSI (Display Serial Interface) support. diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index 8c223b808740..e5589e615808 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -2696,97 +2696,49 @@ static int dsi_vc_send_null(struct dsi_data *dsi, int channel) return dsi_vc_send_long(dsi, channel, MIPI_DSI_NULL_PACKET, NULL, 0, 0); } -static int dsi_vc_write_nosync_common(struct dsi_data *dsi, int channel, - const u8 *data, int len, - enum dss_dsi_content_type type) +static int dsi_vc_write_common(struct omap_dss_device *dssdev, + const struct mipi_dsi_msg *msg) { + struct dsi_data *dsi = to_dsi_data(dssdev); + struct mipi_dsi_packet packet; int r; - if (len == 0) { - BUG_ON(type == DSS_DSI_CONTENT_DCS); - r = dsi_vc_send_short(dsi, channel, - MIPI_DSI_GENERIC_SHORT_WRITE_0_PARAM, 0, 0); - } else if (len == 1) { - r = dsi_vc_send_short(dsi, channel, - type == DSS_DSI_CONTENT_GENERIC ? - MIPI_DSI_GENERIC_SHORT_WRITE_1_PARAM : - MIPI_DSI_DCS_SHORT_WRITE, data[0], 0); - } else if (len == 2) { - r = dsi_vc_send_short(dsi, channel, - type == DSS_DSI_CONTENT_GENERIC ? - MIPI_DSI_GENERIC_SHORT_WRITE_2_PARAM : - MIPI_DSI_DCS_SHORT_WRITE_PARAM, - data[0] | (data[1] << 8), 0); + r = mipi_dsi_create_packet(&packet, msg); + if (r < 0) + return r; + + if (mipi_dsi_packet_format_is_short(msg->type)) { + u16 data = packet.header[1] | (packet.header[2] << 8); + r = dsi_vc_send_short(dsi, msg->channel, msg->type, data, 0); } else { - r = dsi_vc_send_long(dsi, channel, - type == DSS_DSI_CONTENT_GENERIC ? - MIPI_DSI_GENERIC_LONG_WRITE : - MIPI_DSI_DCS_LONG_WRITE, data, len, 0); + r = dsi_vc_send_long(dsi, msg->channel, msg->type, + msg->tx_buf, msg->tx_len, 0); } - return r; -} - -static int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel, - const u8 *data, int len) -{ - struct dsi_data *dsi = to_dsi_data(dssdev); - - return dsi_vc_write_nosync_common(dsi, channel, data, len, - DSS_DSI_CONTENT_DCS); -} - -static int dsi_vc_generic_write_nosync(struct omap_dss_device *dssdev, int channel, - const u8 *data, int len) -{ - struct dsi_data *dsi = to_dsi_data(dssdev); - - return dsi_vc_write_nosync_common(dsi, channel, data, len, - DSS_DSI_CONTENT_GENERIC); -} - -static int dsi_vc_write_common(struct omap_dss_device *dssdev, - int channel, const u8 *data, int len, - enum dss_dsi_content_type type) -{ - struct dsi_data *dsi = to_dsi_data(dssdev); - int r; + if (r < 0) + return r; - r = dsi_vc_write_nosync_common(dsi, channel, data, len, type); - if (r) - goto err; + /* +* we do not always have to do the BTA sync, for example we can +* improve performance by setting the update window information +* without sending BTA sync between the commands. In that case +* we can return earily. +*/ - r = dsi_vc_send_bta_sync(dssdev, channel); - if (r) - goto err; + r = dsi_vc_send_bta_sync(dssdev, msg->channel); + if (r) { + DSSERR("bta sync failed\n"); + return r; + } /* RX_FIFO_NOT_EMPTY */ - if (REG_GET(dsi, DSI_VC_CTRL(channel), 20, 20)) { + if (REG_GET(dsi, DSI_VC_CTRL(msg->channel), 20, 20)) { DSSERR("rx fifo not empty after write, dumping data:\n"); - dsi_vc_flush_receive_data(dsi, channel); -
[PATCH 3/7] drm/sun4i: Fix DE2 VI layer format support
DE2 VI layer doesn't support blending which means alpha channel is ignored. Replace all formats with alpha with "don't care" (X) channel. Signed-off-by: Jernej Skrabec --- drivers/gpu/drm/sun4i/sun8i_mixer.c| 56 ++ drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 22 +- 2 files changed, 67 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c index 655445bfe64a..4a64f7ae437a 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c @@ -106,48 +106,104 @@ static const struct de2_fmt_info de2_formats[] = { .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, + { + /* for DE2 VI layer which ignores alpha */ + .drm_fmt = DRM_FORMAT_XRGB, + .de2_fmt = SUN8I_MIXER_FBFMT_ARGB, + .rgb = true, + .csc = SUN8I_CSC_MODE_OFF, + }, { .drm_fmt = DRM_FORMAT_ABGR, .de2_fmt = SUN8I_MIXER_FBFMT_ABGR, .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, + { + /* for DE2 VI layer which ignores alpha */ + .drm_fmt = DRM_FORMAT_XBGR, + .de2_fmt = SUN8I_MIXER_FBFMT_ABGR, + .rgb = true, + .csc = SUN8I_CSC_MODE_OFF, + }, { .drm_fmt = DRM_FORMAT_RGBA, .de2_fmt = SUN8I_MIXER_FBFMT_RGBA, .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, + { + /* for DE2 VI layer which ignores alpha */ + .drm_fmt = DRM_FORMAT_RGBX, + .de2_fmt = SUN8I_MIXER_FBFMT_RGBA, + .rgb = true, + .csc = SUN8I_CSC_MODE_OFF, + }, { .drm_fmt = DRM_FORMAT_BGRA, .de2_fmt = SUN8I_MIXER_FBFMT_BGRA, .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, + { + /* for DE2 VI layer which ignores alpha */ + .drm_fmt = DRM_FORMAT_BGRX, + .de2_fmt = SUN8I_MIXER_FBFMT_BGRA, + .rgb = true, + .csc = SUN8I_CSC_MODE_OFF, + }, { .drm_fmt = DRM_FORMAT_ARGB1555, .de2_fmt = SUN8I_MIXER_FBFMT_ARGB1555, .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, + { + /* for DE2 VI layer which ignores alpha */ + .drm_fmt = DRM_FORMAT_XRGB1555, + .de2_fmt = SUN8I_MIXER_FBFMT_ARGB1555, + .rgb = true, + .csc = SUN8I_CSC_MODE_OFF, + }, { .drm_fmt = DRM_FORMAT_ABGR1555, .de2_fmt = SUN8I_MIXER_FBFMT_ABGR1555, .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, + { + /* for DE2 VI layer which ignores alpha */ + .drm_fmt = DRM_FORMAT_XBGR1555, + .de2_fmt = SUN8I_MIXER_FBFMT_ABGR1555, + .rgb = true, + .csc = SUN8I_CSC_MODE_OFF, + }, { .drm_fmt = DRM_FORMAT_RGBA5551, .de2_fmt = SUN8I_MIXER_FBFMT_RGBA5551, .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, + { + /* for DE2 VI layer which ignores alpha */ + .drm_fmt = DRM_FORMAT_RGBX5551, + .de2_fmt = SUN8I_MIXER_FBFMT_RGBA5551, + .rgb = true, + .csc = SUN8I_CSC_MODE_OFF, + }, { .drm_fmt = DRM_FORMAT_BGRA5551, .de2_fmt = SUN8I_MIXER_FBFMT_BGRA5551, .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, + { + /* for DE2 VI layer which ignores alpha */ + .drm_fmt = DRM_FORMAT_BGRX5551, + .de2_fmt = SUN8I_MIXER_FBFMT_BGRA5551, + .rgb = true, + .csc = SUN8I_CSC_MODE_OFF, + }, { .drm_fmt = DRM_FORMAT_ARGB2101010, .de2_fmt = SUN8I_MIXER_FBFMT_ARGB2101010, diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c index 6c0084a3c3d7..b8398ca18b0f 100644 --- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c +++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c @@ -398,26 +398,26 @@ static const struct drm_plane_funcs sun8i_vi_layer_funcs = { }; /* - * While all RGB formats are supported, VI planes don't support - * alpha blending, so there is no point having formats with alpha - * channel if their opaque analog exist. + * While DE2 VI layer supports same RGB formats as UI layer, alpha + * channel is ignored. This structure lists all unique variants + * where alpha channel is replaced with "don't care" (X) channel. */ static const u32 sun8i_vi_layer_formats[] = {
Re: [PATCH 01/89] dt-bindings: i2c: brcmstb: Convert the BRCMSTB binding to a schema
On 2/24/20 1:06 AM, Maxime Ripard wrote: > Switch the DT binding to a YAML schema to enable the DT validation. > > Cc: Kamal Dasu > Cc: Florian Fainelli > Cc: Rob Herring > Cc: Wolfram Sang > Cc: bcm-kernel-feedback-l...@broadcom.com > Cc: linux-...@vger.kernel.org > Cc: devicet...@vger.kernel.org > Signed-off-by: Maxime Ripard Acked-by: Florian Fainelli -- Florian ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 00/56] drm/omap: Convert DSI code to use drm_mipi_dsi and drm_panel
This updates the existing omapdrm DSI code, so that it uses common drm_mipi_dsi API and drm_panel. The patchset has been tested with Droid 4 using Linux console, X.org and Weston. The patchset is based on Laurent Pinchartl's patch series [0] and removes the last custom panel driver, so quite a few cleanups on the omapdrm codebase were possible. [0] [PATCH v7 00/54] drm/omap: Replace custom display drivers with drm_bridge and drm_panel https://lore.kernel.org/dri-devel/20200222150106.22919-1-laurent.pinch...@ideasonboard.com/ git://linuxtv.org/pinchartl/media.git omapdrm/bridge/devel I pushed this patchset into the following branch: git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-n900.git omapdrm/bridge/devel-with-dsi The previous version of this patchset has been sent quite some time ago. This version has been rebased and required cleaning up most of the hacks. I do not have a detailed changelog, but quite a few things changed. I decided against doing anything special for the DT change (adding DSI channel number), since only 3 devices are affected. It is quite likely, that all developers of those devices update DT together with kernel for those devices. My suggestion is to merge the first two patches ASAP and backport to stable, since it does not affect old kernels and the change is rather small. RFCv1: https://lore.kernel.org/dri-devel/20191117023946.VjCC3yE08DMx7JIKxNagPoT5et7WTnKGVV6MtOtB9Ro@z/ -- Sebastian Sebastian Reichel (56): ARM: dts: omap: add channel to DSI panels ARM: dts: omap4-droid4: add panel compatible Revert "drm/omap: dss: Remove unused omap_dss_device operations" omap/drm: drop unused dsi.configure_pins drm/omap: dsi: use MIPI_DSI_FMT_* instead of OMAP_DSS_DSI_FMT_* drm/omap: constify write buffers drm/omap: dsi: add generic transfer function drm/omap: panel-dsi-cm: convert to transfer API drm/omap: dsi: unexport specific data transfer functions drm/omap: dsi: drop virtual channel logic drm/omap: dsi: simplify write function drm/omap: dsi: simplify read functions drm/omap: dsi: switch dsi_vc_send_long/short to mipi_dsi_msg drm/omap: dsi: introduce mipi_dsi_host drm/omap: panel-dsi-cm: use DSI helpers drm/omap: dsi: request VC via mipi_dsi_attach drm/omap: panel-dsi-cm: drop hardcoded VC drm/omap: panel-dsi-cm: use common MIPI DCS 1.3 defines drm/omap: dsi: drop unused memory_read() drm/omap: dsi: drop unused get_te() drm/omap: dsi: drop unused enable_te() drm/omap: dsi: drop useless sync() drm/omap: dsi: use pixel-format and mode from attach drm/omap: panel-dsi-cm: use bulk regulator API drm/omap: dsi: lp/hs switching support for transfer() drm/omap: dsi: move TE GPIO handling into core drm/omap: dsi: drop custom enable_te() API drm/omap: dsi: do bus locking in host driver drm/omap: dsi: untangle ulps ops from enable/disable drm/dsi: add MIPI_DSI_MODE_ULPS_IDLE drm/omap: dsi: do ULPS in host driver drm/omap: dsi: move panel refresh function to host drm/omap: dsi: Reverse direction of the DSS device enable/disable operations drm/omap: dsi: drop custom panel capability support drm/omap: dsi: convert to drm_panel drm/omap: drop omapdss-boot-init drm/omap: dsi: implement check timings drm/omap: panel-dsi-cm: use DEVICE_ATTR_RO drm/omap: panel-dsi-cm: support unbinding drm/omap: panel-dsi-cm: fix remove() drm/omap: dsi: return proper error code from dsi_update_all() drm/omap: remove global dss_device variable drm/omap: bind components with drm_device argument drm/panel: Move OMAP's DSI command mode panel driver drm/omap: dsi: Register a drm_bridge drm/omap: remove legacy DSS device operations drm/omap: remove unused omap_connector drm/omap: simplify omap_display_id drm/omap: drop unused DSS next pointer drm/omap: drop empty omap_encoder helper functions drm/omap: drop DSS ops_flags drm/omap: drop dssdev display field drm/omap: simplify DSI manual update code ARM: omap2plus_defconfig: Update for moved DSI command mode panel drm/panel/panel-dsi-cm: support rotation property ARM: dts: omap4-droid4: add panel orientation .../bindings/display/panel/panel-dsi-cm.txt |4 +- .../boot/dts/motorola-mapphone-common.dtsi|6 +- arch/arm/boot/dts/omap3-n950.dts |3 +- arch/arm/boot/dts/omap3.dtsi |3 + arch/arm/boot/dts/omap4-sdp.dts |6 +- arch/arm/boot/dts/omap4.dtsi |6 + arch/arm/boot/dts/omap5.dtsi |6 + arch/arm/configs/omap2plus_defconfig |2 +- drivers/gpu/drm/omapdrm/Kconfig |1 - drivers/gpu/drm/omapdrm/Makefile |2 - drivers/gpu/drm/omapdrm/displays/Kconfig | 10 - drivers/gpu/drm/omapdrm/displays/Makefile |2 - .../gpu/drm/omapdrm/displays/panel-dsi-cm.c | 1387 - drivers/gpu/drm/omapdrm/dss/Kconfig |4 +- drivers/gpu/drm/omapdrm/dss/Makefile
[PATCHv2 46/56] drm/omap: remove legacy DSS device operations
All DSS devices have been converted to bridge API, so the device operations are always NULL. This removes the device ops function pointers and all code using it. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/dss/base.c | 66 drivers/gpu/drm/omapdrm/dss/dss.c| 8 --- drivers/gpu/drm/omapdrm/dss/omapdss.h| 34 drivers/gpu/drm/omapdrm/omap_connector.c | 29 --- drivers/gpu/drm/omapdrm/omap_encoder.c | 40 -- 5 files changed, 177 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/base.c b/drivers/gpu/drm/omapdrm/dss/base.c index 8e08c49b4f97..c2791305c332 100644 --- a/drivers/gpu/drm/omapdrm/dss/base.c +++ b/drivers/gpu/drm/omapdrm/dss/base.c @@ -161,8 +161,6 @@ int omapdss_device_connect(struct dss_device *dss, struct omap_dss_device *src, struct omap_dss_device *dst) { - int ret; - dev_dbg(&dss->pdev->dev, "connect(%s, %s)\n", src ? dev_name(src->dev) : "NULL", dst ? dev_name(dst->dev) : "NULL"); @@ -181,14 +179,6 @@ int omapdss_device_connect(struct dss_device *dss, dst->dss = dss; - if (dst->ops && dst->ops->connect) { - ret = dst->ops->connect(src, dst); - if (ret < 0) { - dst->dss = NULL; - return ret; - } - } - return 0; } EXPORT_SYMBOL_GPL(omapdss_device_connect); @@ -212,66 +202,10 @@ void omapdss_device_disconnect(struct omap_dss_device *src, return; } - WARN_ON(dst->state != OMAP_DSS_DISPLAY_DISABLED); - - if (dst->ops && dst->ops->disconnect) - dst->ops->disconnect(src, dst); dst->dss = NULL; } EXPORT_SYMBOL_GPL(omapdss_device_disconnect); -void omapdss_device_pre_enable(struct omap_dss_device *dssdev) -{ - if (!dssdev) - return; - - omapdss_device_pre_enable(dssdev->next); - - if (dssdev->ops && dssdev->ops->pre_enable) - dssdev->ops->pre_enable(dssdev); -} -EXPORT_SYMBOL_GPL(omapdss_device_pre_enable); - -void omapdss_device_enable(struct omap_dss_device *dssdev) -{ - if (!dssdev) - return; - - if (dssdev->ops && dssdev->ops->enable) - dssdev->ops->enable(dssdev); - - omapdss_device_enable(dssdev->next); - - dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; -} -EXPORT_SYMBOL_GPL(omapdss_device_enable); - -void omapdss_device_disable(struct omap_dss_device *dssdev) -{ - if (!dssdev) - return; - - omapdss_device_disable(dssdev->next); - - if (dssdev->ops && dssdev->ops->disable) - dssdev->ops->disable(dssdev); -} -EXPORT_SYMBOL_GPL(omapdss_device_disable); - -void omapdss_device_post_disable(struct omap_dss_device *dssdev) -{ - if (!dssdev) - return; - - if (dssdev->ops && dssdev->ops->post_disable) - dssdev->ops->post_disable(dssdev); - - omapdss_device_post_disable(dssdev->next); - - dssdev->state = OMAP_DSS_DISPLAY_DISABLED; -} -EXPORT_SYMBOL_GPL(omapdss_device_post_disable); - /* - * Components Handling */ diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c index a0b37d9b62ea..bf627a50e72f 100644 --- a/drivers/gpu/drm/omapdrm/dss/dss.c +++ b/drivers/gpu/drm/omapdrm/dss/dss.c @@ -1553,15 +1553,7 @@ static int dss_remove(struct platform_device *pdev) static void dss_shutdown(struct platform_device *pdev) { - struct omap_dss_device *dssdev = NULL; - DSSDBG("shutdown\n"); - - for_each_dss_output(dssdev) { - if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE && - dssdev->ops && dssdev->ops->disable) - dssdev->ops->disable(dssdev); - } } static int dss_runtime_suspend(struct device *dev) diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index 45f5c46712eb..325a89d802e2 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -122,11 +122,6 @@ enum omap_dss_dsi_mode { OMAP_DSS_DSI_VIDEO_MODE, }; -enum omap_dss_display_state { - OMAP_DSS_DISPLAY_DISABLED = 0, - OMAP_DSS_DISPLAY_ACTIVE, -}; - enum omap_dss_rotation_type { OMAP_DSS_ROT_NONE = 0, OMAP_DSS_ROT_TILER = 1 << 0, @@ -280,24 +275,6 @@ struct omapdss_dsi_ops { }; struct omap_dss_device_ops { - int (*connect)(struct omap_dss_device *dssdev, - struct omap_dss_device *dst); - void (*disconnect)(struct omap_dss_device *dssdev, - struct omap_dss_device *dst); - - void (*pre_enable)(struct omap_dss_device *dssdev); - void (*enable)(struct omap_dss_device *dssdev); - void (*disable)(struc
[PATCH v7 0/2] Add initial support for slimport anx7625
Hi all, The following series add initial support for the Slimport ANX7625 transmitter, a ultra-low power Full-HD 4K MIPI to DP transmitter designed for portable device. This is the initial version, any mistakes, please let me know, I will fix it in the next series. Thanks, Xin Xin Ji (2): dt-bindings: drm/bridge: anx7625: MIPI to DP transmitter binding drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP bridge driver .../bindings/display/bridge/anx7625.yaml | 91 + drivers/gpu/drm/bridge/Makefile|2 +- drivers/gpu/drm/bridge/analogix/Kconfig|6 + drivers/gpu/drm/bridge/analogix/Makefile |1 + drivers/gpu/drm/bridge/analogix/anx7625.c | 2172 drivers/gpu/drm/bridge/analogix/anx7625.h | 410 6 files changed, 2681 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/display/bridge/anx7625.yaml create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.c create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.h -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 20/56] drm/omap: dsi: drop unused get_te()
The get_te() callback is not used, so we can drop the custom API. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 13 - drivers/gpu/drm/omapdrm/dss/omapdss.h | 1 - 2 files changed, 14 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 59b8fc71c974..e4b24c67c45d 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -919,18 +919,6 @@ static int dsicm_enable_te(struct omap_dss_device *dssdev, bool enable) return r; } -static int dsicm_get_te(struct omap_dss_device *dssdev) -{ - struct panel_drv_data *ddata = to_panel_data(dssdev); - int r; - - mutex_lock(&ddata->lock); - r = ddata->te_enabled; - mutex_unlock(&ddata->lock); - - return r; -} - static void dsicm_ulps_work(struct work_struct *work) { struct panel_drv_data *ddata = container_of(work, struct panel_drv_data, @@ -1002,7 +990,6 @@ static const struct omap_dss_driver dsicm_dss_driver = { .sync = dsicm_sync, .enable_te = dsicm_enable_te, - .get_te = dsicm_get_te, }; static int dsicm_probe_of(struct mipi_dsi_device *dsi) diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index 54f362cc5223..a1e78ba665d8 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -387,7 +387,6 @@ struct omap_dss_driver { int (*sync)(struct omap_dss_device *dssdev); int (*enable_te)(struct omap_dss_device *dssdev, bool enable); - int (*get_te)(struct omap_dss_device *dssdev); }; struct dss_device *omapdss_get_dss(void); -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCHv2 02/56] ARM: dts: omap4-droid4: add panel compatible
* Laurent Pinchart [200224 23:38]: > Hi Sebastian, > > Thank you for the patch. > > On Tue, Feb 25, 2020 at 12:20:32AM +0100, Sebastian Reichel wrote: > > Add Droid 4 specific compatible value in addition to the > > generic one, so that we have the ability to add panel > > specific quirks in the future. > > We need to document this compatible string in DT bindings, I don't think > this is included in this series. Furthermore, could we use a compatible > string that actually matches the panel vendor and model, instead of the > device name ? To me it seems there are multiple similar panels from various vendors in use for xt875/xt894/xt910/xt912 phones, I'm not sure if anybody has this list? Regards, Tony ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 13/56] drm/omap: dsi: switch dsi_vc_send_long/short to mipi_dsi_msg
Simplify the DSI encoder by using mipi_dsi_msg for dsi_vc_send_long and dsi_vc_send_short. Further improvements require cleaning up the channel allocation code first. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/dss/dsi.c | 92 +++ 1 file changed, 45 insertions(+), 47 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index 9b5b078beb6d..4899bfa2d76f 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -2599,30 +2599,36 @@ static inline void dsi_vc_write_long_payload(struct dsi_data *dsi, int channel, dsi_write_reg(dsi, DSI_VC_LONG_PACKET_PAYLOAD(channel), val); } -static int dsi_vc_send_long(struct dsi_data *dsi, int channel, u8 data_type, - const u8 *data, u16 len, u8 ecc) +static int dsi_vc_send_long(struct dsi_data *dsi, + const struct mipi_dsi_msg *msg) { + struct mipi_dsi_packet pkg; /*u32 val; */ int i; const u8 *p; int r = 0; u8 b1, b2, b3, b4; + r = mipi_dsi_create_packet(&pkg, msg); + if (r < 0) + return r; + if (dsi->debug_write) - DSSDBG("dsi_vc_send_long, %d bytes\n", len); + DSSDBG("dsi_vc_send_long, %d bytes\n", msg->tx_len); /* len + header */ - if (dsi->vc[channel].tx_fifo_size * 32 * 4 < len + 4) { + if (dsi->vc[msg->channel].tx_fifo_size * 32 * 4 < msg->tx_len + 4) { DSSERR("unable to send long packet: packet too long.\n"); return -EINVAL; } - dsi_vc_config_source(dsi, channel, DSI_VC_SOURCE_L4); + dsi_vc_config_source(dsi, msg->channel, DSI_VC_SOURCE_L4); - dsi_vc_write_long_header(dsi, channel, data_type, len, ecc); + dsi_vc_write_long_header(dsi, msg->channel, msg->type, msg->tx_len, +pkg.header[3]); - p = data; - for (i = 0; i < len >> 2; i++) { + p = msg->tx_buf; + for (i = 0; i < msg->tx_len >> 2; i++) { if (dsi->debug_write) DSSDBG("\tsending full packet %d\n", i); @@ -2631,10 +2637,10 @@ static int dsi_vc_send_long(struct dsi_data *dsi, int channel, u8 data_type, b3 = *p++; b4 = *p++; - dsi_vc_write_long_payload(dsi, channel, b1, b2, b3, b4); + dsi_vc_write_long_payload(dsi, msg->channel, b1, b2, b3, b4); } - i = len % 4; + i = msg->tx_len % 4; if (i) { b1 = 0; b2 = 0; b3 = 0; @@ -2656,64 +2662,64 @@ static int dsi_vc_send_long(struct dsi_data *dsi, int channel, u8 data_type, break; } - dsi_vc_write_long_payload(dsi, channel, b1, b2, b3, 0); + dsi_vc_write_long_payload(dsi, msg->channel, b1, b2, b3, 0); } return r; } -static int dsi_vc_send_short(struct dsi_data *dsi, int channel, u8 data_type, -u16 data, u8 ecc) +static int dsi_vc_send_short(struct dsi_data *dsi, +const struct mipi_dsi_msg *msg) { + struct mipi_dsi_packet pkg; u32 r; - u8 data_id; + + r = mipi_dsi_create_packet(&pkg, msg); + if (r < 0) + return r; WARN_ON(!dsi_bus_is_locked(dsi)); if (dsi->debug_write) DSSDBG("dsi_vc_send_short(ch%d, dt %#x, b1 %#x, b2 %#x)\n", - channel, - data_type, data & 0xff, (data >> 8) & 0xff); + msg->channel, + msg->type, pkg.header[1], pkg.header[2]); - dsi_vc_config_source(dsi, channel, DSI_VC_SOURCE_L4); + dsi_vc_config_source(dsi, msg->channel, DSI_VC_SOURCE_L4); - if (FLD_GET(dsi_read_reg(dsi, DSI_VC_CTRL(channel)), 16, 16)) { + if (FLD_GET(dsi_read_reg(dsi, DSI_VC_CTRL(msg->channel)), 16, 16)) { DSSERR("ERROR FIFO FULL, aborting transfer\n"); return -EINVAL; } - data_id = data_type | channel << 6; - - r = (data_id << 0) | (data << 8) | (ecc << 24); + r = pkg.header[3] << 24 | pkg.header[2] << 16 | pkg.header[1] << 8 | + pkg.header[0]; - dsi_write_reg(dsi, DSI_VC_SHORT_PACKET_HEADER(channel), r); + dsi_write_reg(dsi, DSI_VC_SHORT_PACKET_HEADER(msg->channel), r); return 0; } static int dsi_vc_send_null(struct dsi_data *dsi, int channel) { - return dsi_vc_send_long(dsi, channel, MIPI_DSI_NULL_PACKET, NULL, 0, 0); + const struct mipi_dsi_msg msg = { + .channel = channel, + .type = MIPI_DSI_NULL_PACKET, + }; + + return dsi_vc_send_long(dsi, &msg); } static int dsi_vc_write_common(struct omap_dss_device *dssdev, const struct mipi_dsi_msg
[PATCHv2 47/56] drm/omap: remove unused omap_connector
Remove unused code. Connectors are now created via drm_bridge_connector_init() and no longer OMAP specific. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/Makefile | 1 - drivers/gpu/drm/omapdrm/omap_connector.c | 128 --- drivers/gpu/drm/omapdrm/omap_connector.h | 28 - drivers/gpu/drm/omapdrm/omap_drv.c | 19 ++-- drivers/gpu/drm/omapdrm/omap_drv.h | 1 - drivers/gpu/drm/omapdrm/omap_encoder.c | 11 -- 6 files changed, 6 insertions(+), 182 deletions(-) delete mode 100644 drivers/gpu/drm/omapdrm/omap_connector.c delete mode 100644 drivers/gpu/drm/omapdrm/omap_connector.h diff --git a/drivers/gpu/drm/omapdrm/Makefile b/drivers/gpu/drm/omapdrm/Makefile index 66a73eae6f7c..2a404e045b78 100644 --- a/drivers/gpu/drm/omapdrm/Makefile +++ b/drivers/gpu/drm/omapdrm/Makefile @@ -12,7 +12,6 @@ omapdrm-y := omap_drv.o \ omap_crtc.o \ omap_plane.o \ omap_encoder.o \ - omap_connector.o \ omap_fb.o \ omap_gem.o \ omap_gem_dmabuf.o \ diff --git a/drivers/gpu/drm/omapdrm/omap_connector.c b/drivers/gpu/drm/omapdrm/omap_connector.c deleted file mode 100644 index db6becd345a0.. --- a/drivers/gpu/drm/omapdrm/omap_connector.c +++ /dev/null @@ -1,128 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ - * Author: Rob Clark - */ - -#include -#include -#include - -#include "omap_drv.h" - -/* - * connector funcs - */ - -#define to_omap_connector(x) container_of(x, struct omap_connector, base) - -struct omap_connector { - struct drm_connector base; - struct omap_dss_device *output; -}; - -static enum drm_connector_status omap_connector_detect( - struct drm_connector *connector, bool force) -{ - return connector_status_connected; -} - -static void omap_connector_destroy(struct drm_connector *connector) -{ - struct omap_connector *omap_connector = to_omap_connector(connector); - - DBG("%s", connector->name); - - drm_connector_unregister(connector); - drm_connector_cleanup(connector); - - omapdss_device_put(omap_connector->output); - - kfree(omap_connector); -} - -static int omap_connector_get_modes(struct drm_connector *connector) -{ - DBG("%s", connector->name); - - /* We can't retrieve modes. The KMS core will add the default modes. */ - return 0; -} - -enum drm_mode_status omap_connector_mode_fixup(struct omap_dss_device *dssdev, - const struct drm_display_mode *mode, - struct drm_display_mode *adjusted_mode) -{ - return MODE_OK; -} - -static enum drm_mode_status omap_connector_mode_valid(struct drm_connector *connector, -struct drm_display_mode *mode) -{ - struct omap_connector *omap_connector = to_omap_connector(connector); - struct drm_display_mode new_mode = { { 0 } }; - enum drm_mode_status status; - - status = omap_connector_mode_fixup(omap_connector->output, mode, - &new_mode); - if (status != MODE_OK) - goto done; - - /* Check if vrefresh is still valid. */ - if (drm_mode_vrefresh(mode) != drm_mode_vrefresh(&new_mode)) - status = MODE_NOCLOCK; - -done: - DBG("connector: mode %s: " DRM_MODE_FMT, - (status == MODE_OK) ? "valid" : "invalid", - DRM_MODE_ARG(mode)); - - return status; -} - -static const struct drm_connector_funcs omap_connector_funcs = { - .reset = drm_atomic_helper_connector_reset, - .detect = omap_connector_detect, - .fill_modes = drm_helper_probe_single_connector_modes, - .destroy = omap_connector_destroy, - .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, - .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, -}; - -static const struct drm_connector_helper_funcs omap_connector_helper_funcs = { - .get_modes = omap_connector_get_modes, - .mode_valid = omap_connector_mode_valid, -}; - -/* initialize connector */ -struct drm_connector *omap_connector_init(struct drm_device *dev, - struct omap_dss_device *output, - struct drm_encoder *encoder) -{ - struct drm_connector *connector = NULL; - struct omap_connector *omap_connector; - - DBG("%s", output->name); - - omap_connector = kzalloc(sizeof(*omap_connector), GFP_KERNEL); - if (!omap_connector) - goto fail; - - omap_connector->output = omapdss_device_get(output); - - connector = &omap_connector->base; - connector->interlace_allowed = 1; - connector->doublescan_allowed = 0; - - drm_connector_init(dev, connector, &omap_connector_funcs, -
[PATCH v7 1/2] dt-bindings: drm/bridge: anx7625: MIPI to DP transmitter binding
The ANX7625 is an ultra-low power 4K Mobile HD Transmitter designed for portable device. It converts MIPI to DisplayPort 1.3 4K. You can add support to your board with binding. Example: anx7625_bridge: encoder@58 { compatible = "analogix,anx7625"; reg = <0x58>; status = "okay"; panel-flags = <1>; enable-gpios = <&pio 45 GPIO_ACTIVE_HIGH>; reset-gpios = <&pio 73 GPIO_ACTIVE_HIGH>; #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; anx_1_in: endpoint { remote-endpoint = <&mipi_dsi>; }; }; port@2 { reg = <2>; anx_1_out: endpoint { remote-endpoint = <&panel_in>; }; }; }; Signed-off-by: Xin Ji --- .../bindings/display/bridge/anx7625.yaml | 91 ++ 1 file changed, 91 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/bridge/anx7625.yaml diff --git a/Documentation/devicetree/bindings/display/bridge/anx7625.yaml b/Documentation/devicetree/bindings/display/bridge/anx7625.yaml new file mode 100644 index 000..1149ebb --- /dev/null +++ b/Documentation/devicetree/bindings/display/bridge/anx7625.yaml @@ -0,0 +1,91 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright 2019 Analogix Semiconductor, Inc. +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/display/bridge/anx7625.yaml#"; +$schema: "http://devicetree.org/meta-schemas/core.yaml#"; + +title: Analogix ANX7625 SlimPort (4K Mobile HD Transmitter) + +maintainers: + - Xin Ji + +description: | + The ANX7625 is an ultra-low power 4K Mobile HD Transmitter + designed for portable devices. + +properties: + "#address-cells": true + "#size-cells": true + + compatible: +items: + - const: analogix,anx7625 + + reg: +maxItems: 1 + + panel-flags: +description: indicate the panel is internal or external. +maxItems: 1 + + interrupts: +maxItems: 1 + + enable-gpios: +description: used for power on chip control, POWER_EN pin D2. +maxItems: 1 + + reset-gpios: +description: used for reset chip control, RESET_N pin B7. +maxItems: 1 + + port@0: +type: object +description: + A port node pointing to MIPI DSI host port node. + + port@1: +type: object +description: + A port node pointing to MIPI DPI host port node. + + port@2: +type: object +description: + A port node pointing to panel port node. + +required: + - "#address-cells" + - "#size-cells" + - compatible + - reg + - port@0 + - port@2 + +example: + - | +anx7625_bridge: encoder@58 { +compatible = "analogix,anx7625"; +reg = <0x58>; +status = "okay"; +panel-flags = <1>; +enable-gpios = <&pio 45 GPIO_ACTIVE_HIGH>; +reset-gpios = <&pio 73 GPIO_ACTIVE_HIGH>; +#address-cells = <1>; +#size-cells = <0>; + +port@0 { + reg = <0>; + anx_1_in: endpoint { +remote-endpoint = <&mipi_dsi>; + }; +}; + +port@2 { + reg = <2>; + anx_1_out: endpoint { +remote-endpoint = <&panel_in>; + }; +}; +}; -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 0/7] drm/sun4i: de2/de3 format fixes and updates
Currently VI layer code reported wrong formats for DE2 and DE3. First three patches are fixes. Next two patches do code refactoring to remove redundant information, which is already included elsewhere. Last two patches are more cosmetic. Note: It can be argued if patch 2 is really a fix. Consider that if only patch 1 and 3 go into stable, wrong formats will be reported for DE3 VI layers. Please take a look. Best regards, Jernej Jernej Skrabec (7): drm/sun4i: de2/de3: Remove unsupported VI layer formats drm/sun4i: Add separate DE3 VI layer formats drm/sun4i: Fix DE2 VI layer format support drm/sun4i: de2: rgb field in de2 format struct is redundant drm/sun4i: de2: csc_mode in de2 format struct is mostly redundant drm/sun4i: de2: Don't return de2_fmt_info struct drm/sun4i: Sort includes in VI and UI layer code drivers/gpu/drm/sun4i/sun8i_mixer.c| 159 - drivers/gpu/drm/sun4i/sun8i_mixer.h| 21 ++-- drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 14 ++- drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 106 ++--- 4 files changed, 183 insertions(+), 117 deletions(-) -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 19/56] drm/omap: dsi: drop unused memory_read()
Signed-off-by: Sebastian Reichel --- .../gpu/drm/omapdrm/displays/panel-dsi-cm.c | 93 --- drivers/gpu/drm/omapdrm/dss/omapdss.h | 4 - 2 files changed, 97 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 92c9dc211aeb..59b8fc71c974 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -931,97 +931,6 @@ static int dsicm_get_te(struct omap_dss_device *dssdev) return r; } -static int dsicm_set_max_rx_packet_size(struct omap_dss_device *dssdev, -u16 size) -{ - struct panel_drv_data *ddata = to_panel_data(dssdev); - struct mipi_dsi_device *dsi = ddata->dsi; - - return mipi_dsi_set_maximum_return_packet_size(dsi, size); -} - -static int dsicm_memory_read(struct omap_dss_device *dssdev, - void *buf, size_t size, - u16 x, u16 y, u16 w, u16 h) -{ - struct panel_drv_data *ddata = to_panel_data(dssdev); - struct mipi_dsi_device *dsi = ddata->dsi; - struct omap_dss_device *src = ddata->src; - int r; - int first = 1; - int plen; - unsigned int buf_used = 0; - - if (size < w * h * 3) - return -ENOMEM; - - mutex_lock(&ddata->lock); - - if (!ddata->enabled) { - r = -ENODEV; - goto err1; - } - - size = min((u32)w * h * 3, - ddata->vm.hactive * ddata->vm.vactive * 3); - - src->ops->dsi.bus_lock(src); - - r = dsicm_wake_up(ddata); - if (r) - goto err2; - - /* plen 1 or 2 goes into short packet. until checksum error is fixed, -* use short packets. plen 32 works, but bigger packets seem to cause -* an error. */ - if (size % 2) - plen = 1; - else - plen = 2; - - dsicm_set_update_window(ddata, x, y, w, h); - - r = dsicm_set_max_rx_packet_size(dssdev, plen); - if (r) - goto err2; - - while (buf_used < size) { - u8 dcs_cmd = first ? 0x2e : 0x3e; - first = 0; - - r = mipi_dsi_dcs_read(dsi, dcs_cmd, - buf + buf_used, size - buf_used); - if (r < 0) { - dev_err(dssdev->dev, "read error\n"); - goto err3; - } - - buf_used += r; - - if (r < plen) { - dev_err(&ddata->dsi->dev, "short read\n"); - break; - } - - if (signal_pending(current)) { - dev_err(&ddata->dsi->dev, "signal pending, " - "aborting memory read\n"); - r = -ERESTARTSYS; - goto err3; - } - } - - r = buf_used; - -err3: - dsicm_set_max_rx_packet_size(dssdev, 1); -err2: - src->ops->dsi.bus_unlock(src); -err1: - mutex_unlock(&ddata->lock); - return r; -} - static void dsicm_ulps_work(struct work_struct *work) { struct panel_drv_data *ddata = container_of(work, struct panel_drv_data, @@ -1094,8 +1003,6 @@ static const struct omap_dss_driver dsicm_dss_driver = { .enable_te = dsicm_enable_te, .get_te = dsicm_get_te, - - .memory_read= dsicm_memory_read, }; static int dsicm_probe_of(struct mipi_dsi_device *dsi) diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index b946b90ce01b..54f362cc5223 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -388,10 +388,6 @@ struct omap_dss_driver { int (*enable_te)(struct omap_dss_device *dssdev, bool enable); int (*get_te)(struct omap_dss_device *dssdev); - - int (*memory_read)(struct omap_dss_device *dssdev, - void *buf, size_t size, - u16 x, u16 y, u16 w, u16 h); }; struct dss_device *omapdss_get_dss(void); -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 3/3] bus: ti-sysc: Implement display subsystem reset quirk
The display subsystem (DSS) needs the child outputs disabled for reset. In order to prepare to probe DSS without legacy platform data, let's implement sysc_pre_reset_quirk_dss() similar to what we have for the platform data with omap_dss_reset(). Note that we cannot directly use the old omap_dss_reset() without platform data callbacks and updating omap_dss_reset() to understand struct device. And we will be dropping omap_dss_reset() anyways when all the SoCs are probing with device tree, so let's not mess with the legacy code at all. Cc: Jyri Sarha Cc: Laurent Pinchart Cc: Tomi Valkeinen Signed-off-by: Tony Lindgren --- drivers/bus/ti-sysc.c | 131 +- include/linux/platform_data/ti-sysc.h | 1 + 2 files changed, 129 insertions(+), 3 deletions(-) diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -1303,11 +1303,11 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { SYSC_QUIRK("dcan", 0x4848, 0x20, -ENODEV, -ENODEV, 0xa3170504, 0x, SYSC_QUIRK_CLKDM_NOAUTO), SYSC_QUIRK("dss", 0x4832a000, 0, 0x10, 0x14, 0x0020, 0x, - SYSC_QUIRK_OPT_CLKS_IN_RESET), + SYSC_QUIRK_OPT_CLKS_IN_RESET | SYSC_MODULE_QUIRK_DSS_RESET), SYSC_QUIRK("dss", 0x5800, 0, -ENODEV, 0x14, 0x0040, 0x, - SYSC_QUIRK_OPT_CLKS_IN_RESET), + SYSC_QUIRK_OPT_CLKS_IN_RESET | SYSC_MODULE_QUIRK_DSS_RESET), SYSC_QUIRK("dss", 0x5800, 0, -ENODEV, 0x14, 0x0061, 0x, - SYSC_QUIRK_OPT_CLKS_IN_RESET), + SYSC_QUIRK_OPT_CLKS_IN_RESET | SYSC_MODULE_QUIRK_DSS_RESET), SYSC_QUIRK("dwc3", 0x4888, 0, 0x10, -ENODEV, 0x500a0200, 0x, SYSC_QUIRK_CLKDM_NOAUTO), SYSC_QUIRK("dwc3", 0x488c, 0, 0x10, -ENODEV, 0x500a0200, 0x, @@ -1468,6 +1468,128 @@ static void sysc_init_revision_quirks(struct sysc *ddata) } } +/* + * DSS needs dispc outputs disabled to reset modules. Returns mask of + * enabled DSS interrupts. Eventually we may be able to do this on + * dispc init rather than top-level DSS init. + */ +static u32 sysc_quirk_dispc(struct sysc *ddata, int dispc_offset, + bool disable) +{ + bool lcd_en, digit_en, lcd2_en = false, lcd3_en = false; + const int lcd_en_mask = BIT(0), digit_en_mask = BIT(1); + int manager_count; + bool framedonetv_irq; + u32 val, irq_mask = 0; + + switch (sysc_soc->soc) { + case SOC_2420 ... SOC_3630: + manager_count = 2; + framedonetv_irq = false; + break; + case SOC_4430 ... SOC_4470: + manager_count = 3; + break; + case SOC_5430: + case SOC_DRA7: + manager_count = 4; + break; + case SOC_AM4: + manager_count = 1; + break; + case SOC_UNKNOWN: + default: + return 0; + }; + + /* Remap the whole module range to be able to reset dispc outputs */ + devm_iounmap(ddata->dev, ddata->module_va); + ddata->module_va = devm_ioremap(ddata->dev, + ddata->module_pa, + ddata->module_size); + if (!ddata->module_va) + return -EIO; + + /* DISP_CONTROL */ + val = sysc_read(ddata, dispc_offset + 0x40); + lcd_en = val & lcd_en_mask; + digit_en = val & digit_en_mask; + if (lcd_en) + irq_mask |= BIT(0); /* FRAMEDONE */ + if (digit_en) { + if (framedonetv_irq) + irq_mask |= BIT(24);/* FRAMEDONETV */ + else + irq_mask |= BIT(2) | BIT(3);/* EVSYNC bits */ + } + if (disable & (lcd_en | digit_en)) + sysc_write(ddata, dispc_offset + 0x40, + val & ~(lcd_en_mask | digit_en_mask)); + + if (manager_count <= 2) + return irq_mask; + + /* DISPC_CONTROL2 */ + val = sysc_read(ddata, dispc_offset + 0x238); + lcd2_en = val & lcd_en_mask; + if (lcd2_en) + irq_mask |= BIT(22);/* FRAMEDONE2 */ + if (disable && lcd2_en) + sysc_write(ddata, dispc_offset + 0x238, + val & ~lcd_en_mask); + + if (manager_count <= 3) + return irq_mask; + + /* DISPC_CONTROL3 */ + val = sysc_read(ddata, dispc_offset + 0x848); + lcd3_en = val & lcd_en_mask; + if (lcd3_en) + irq_mask |= BIT(30);/* FRAMEDONE3 */ + if (disable && lcd3_en) + sysc_write(ddata, dispc_offset + 0x848, + val & ~lcd_en_mask); + + retur
[PATCHv2 28/56] drm/omap: dsi: do bus locking in host driver
This moves the bus locking into the host driver and unexports the custom API in preparation for drm_panel support. Signed-off-by: Sebastian Reichel --- .../gpu/drm/omapdrm/displays/panel-dsi-cm.c | 46 +-- drivers/gpu/drm/omapdrm/dss/dsi.c | 33 - drivers/gpu/drm/omapdrm/dss/omapdss.h | 3 -- 3 files changed, 23 insertions(+), 59 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index e4ffe34324f8..42a4a69b03fd 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -298,7 +298,6 @@ static int dsicm_wake_up(struct panel_drv_data *ddata) static int dsicm_bl_update_status(struct backlight_device *dev) { struct panel_drv_data *ddata = dev_get_drvdata(&dev->dev); - struct omap_dss_device *src = ddata->src; int r = 0; int level; @@ -313,15 +312,11 @@ static int dsicm_bl_update_status(struct backlight_device *dev) mutex_lock(&ddata->lock); if (ddata->enabled) { - src->ops->dsi.bus_lock(src); - r = dsicm_wake_up(ddata); if (!r) { r = dsicm_dcs_write_1(ddata, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, level); } - - src->ops->dsi.bus_unlock(src); } mutex_unlock(&ddata->lock); @@ -347,21 +342,16 @@ static ssize_t dsicm_num_errors_show(struct device *dev, struct device_attribute *attr, char *buf) { struct panel_drv_data *ddata = dev_get_drvdata(dev); - struct omap_dss_device *src = ddata->src; u8 errors = 0; int r; mutex_lock(&ddata->lock); if (ddata->enabled) { - src->ops->dsi.bus_lock(src); - r = dsicm_wake_up(ddata); if (!r) r = dsicm_dcs_read_1(ddata, DCS_READ_NUM_ERRORS, &errors); - - src->ops->dsi.bus_unlock(src); } else { r = -ENODEV; } @@ -378,20 +368,15 @@ static ssize_t dsicm_hw_revision_show(struct device *dev, struct device_attribute *attr, char *buf) { struct panel_drv_data *ddata = dev_get_drvdata(dev); - struct omap_dss_device *src = ddata->src; u8 id1, id2, id3; int r; mutex_lock(&ddata->lock); if (ddata->enabled) { - src->ops->dsi.bus_lock(src); - r = dsicm_wake_up(ddata); if (!r) r = dsicm_get_id(ddata, &id1, &id2, &id3); - - src->ops->dsi.bus_unlock(src); } else { r = -ENODEV; } @@ -409,7 +394,6 @@ static ssize_t dsicm_store_ulps(struct device *dev, const char *buf, size_t count) { struct panel_drv_data *ddata = dev_get_drvdata(dev); - struct omap_dss_device *src = ddata->src; unsigned long t; int r; @@ -420,14 +404,10 @@ static ssize_t dsicm_store_ulps(struct device *dev, mutex_lock(&ddata->lock); if (ddata->enabled) { - src->ops->dsi.bus_lock(src); - if (t) r = dsicm_enter_ulps(ddata); else r = dsicm_wake_up(ddata); - - src->ops->dsi.bus_unlock(src); } mutex_unlock(&ddata->lock); @@ -457,7 +437,6 @@ static ssize_t dsicm_store_ulps_timeout(struct device *dev, const char *buf, size_t count) { struct panel_drv_data *ddata = dev_get_drvdata(dev); - struct omap_dss_device *src = ddata->src; unsigned long t; int r; @@ -470,9 +449,7 @@ static ssize_t dsicm_store_ulps_timeout(struct device *dev, if (ddata->enabled) { /* dsicm_wake_up will restart the timer */ - src->ops->dsi.bus_lock(src); r = dsicm_wake_up(ddata); - src->ops->dsi.bus_unlock(src); } mutex_unlock(&ddata->lock); @@ -673,17 +650,11 @@ static void dsicm_disconnect(struct omap_dss_device *src, static void dsicm_enable(struct omap_dss_device *dssdev) { struct panel_drv_data *ddata = to_panel_data(dssdev); - struct omap_dss_device *src = ddata->src; int r; mutex_lock(&ddata->lock); - src->ops->dsi.bus_lock(src); - r = dsicm_power_on(ddata); - - src->ops->dsi.bus_unlock(src); - if (r) goto err; @@ -700,7 +671,6 @@ static void dsicm_enable(struct omap_dss_device *dssdev) static void dsicm_disable(struct omap_dss_device *dssdev) { struct panel_drv_data *ddata = to_panel_data(dssdev); - struct omap_dss_device *src = ddata->src; int r; dsicm_bl_power(ddata, false); @@ -709,24 +679,19 @@ static void dsicm_disable(struct omap_dss_device *
[PATCHv2 02/56] ARM: dts: omap4-droid4: add panel compatible
Add Droid 4 specific compatible value in addition to the generic one, so that we have the ability to add panel specific quirks in the future. Signed-off-by: Sebastian Reichel --- arch/arm/boot/dts/motorola-mapphone-common.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/motorola-mapphone-common.dtsi b/arch/arm/boot/dts/motorola-mapphone-common.dtsi index a5e4ba7c8dab..622383ec6a75 100644 --- a/arch/arm/boot/dts/motorola-mapphone-common.dtsi +++ b/arch/arm/boot/dts/motorola-mapphone-common.dtsi @@ -200,7 +200,7 @@ dsi1_out_ep: endpoint { }; lcd0: panel@0 { - compatible = "panel-dsi-cm"; + compatible = "motorola,droid4-panel", "panel-dsi-cm"; reg = <0>; label = "lcd0"; vddi-supply = <&lcd_regulator>; -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 05/56] drm/omap: dsi: use MIPI_DSI_FMT_* instead of OMAP_DSS_DSI_FMT_*
This replaces OMAP specific enum for pixel format with common implementation. Signed-off-by: Sebastian Reichel --- .../gpu/drm/omapdrm/displays/panel-dsi-cm.c | 2 +- drivers/gpu/drm/omapdrm/dss/dsi.c | 49 +++ drivers/gpu/drm/omapdrm/dss/omapdss.h | 10 +--- 3 files changed, 20 insertions(+), 41 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index e7fe5d702337..e6ebfc35243e 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -595,7 +595,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata) int r; struct omap_dss_dsi_config dsi_config = { .mode = OMAP_DSS_DSI_CMD_MODE, - .pixel_format = OMAP_DSS_DSI_FMT_RGB888, + .pixel_format = MIPI_DSI_FMT_RGB888, .vm = &ddata->vm, .hs_clk_min = 15000, .hs_clk_max = 3, diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index 8c39823a8295..bb2548d091ef 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -34,6 +34,7 @@ #include #include +#include #include "omapdss.h" #include "dss.h" @@ -410,7 +411,7 @@ struct dsi_data { struct dss_lcd_mgr_config mgr_config; struct videomode vm; - enum omap_dss_dsi_pixel_format pix_fmt; + enum mipi_dsi_pixel_format pix_fmt; enum omap_dss_dsi_mode mode; struct omap_dss_dsi_videomode_timings vm_timings; @@ -514,22 +515,6 @@ static inline bool wait_for_bit_change(struct dsi_data *dsi, return false; } -static u8 dsi_get_pixel_size(enum omap_dss_dsi_pixel_format fmt) -{ - switch (fmt) { - case OMAP_DSS_DSI_FMT_RGB888: - case OMAP_DSS_DSI_FMT_RGB666: - return 24; - case OMAP_DSS_DSI_FMT_RGB666_PACKED: - return 18; - case OMAP_DSS_DSI_FMT_RGB565: - return 16; - default: - BUG(); - return 0; - } -} - #ifdef DSI_PERF_MEASURE static void dsi_perf_mark_setup(struct dsi_data *dsi) { @@ -3239,7 +3224,7 @@ static void dsi_config_vp_num_line_buffers(struct dsi_data *dsi) int num_line_buffers; if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) { - int bpp = dsi_get_pixel_size(dsi->pix_fmt); + int bpp = mipi_dsi_pixel_format_to_bpp(dsi->pix_fmt); const struct videomode *vm = &dsi->vm; /* * Don't use line buffers if width is greater than the video @@ -3370,7 +3355,7 @@ static void dsi_config_cmd_mode_interleaving(struct dsi_data *dsi) int tclk_trail, ths_exit, exiths_clk; bool ddr_alwon; const struct videomode *vm = &dsi->vm; - int bpp = dsi_get_pixel_size(dsi->pix_fmt); + int bpp = mipi_dsi_pixel_format_to_bpp(dsi->pix_fmt); int ndl = dsi->num_lanes_used - 1; int dsi_fclk_hsdiv = dsi->user_dsi_cinfo.mX[HSDIV_DSI] + 1; int hsa_interleave_hs = 0, hsa_interleave_lp = 0; @@ -3498,7 +3483,7 @@ static int dsi_proto_config(struct dsi_data *dsi) dsi_set_lp_rx_timeout(dsi, 0x1fff, true, true); dsi_set_hs_tx_timeout(dsi, 0x1fff, true, true); - switch (dsi_get_pixel_size(dsi->pix_fmt)) { + switch (mipi_dsi_pixel_format_to_bpp(dsi->pix_fmt)) { case 16: buswidth = 0; break; @@ -3619,7 +3604,7 @@ static void dsi_proto_timings(struct dsi_data *dsi) int window_sync = dsi->vm_timings.window_sync; bool hsync_end; const struct videomode *vm = &dsi->vm; - int bpp = dsi_get_pixel_size(dsi->pix_fmt); + int bpp = mipi_dsi_pixel_format_to_bpp(dsi->pix_fmt); int tl, t_he, width_bytes; hsync_end = dsi->vm_timings.trans_mode == OMAP_DSS_DSI_PULSE_MODE; @@ -3726,7 +3711,7 @@ static int dsi_configure_pins(struct omap_dss_device *dssdev, static int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel) { struct dsi_data *dsi = to_dsi_data(dssdev); - int bpp = dsi_get_pixel_size(dsi->pix_fmt); + int bpp = mipi_dsi_pixel_format_to_bpp(dsi->pix_fmt); u8 data_type; u16 word_count; int r; @@ -3737,16 +3722,16 @@ static int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel) if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) { switch (dsi->pix_fmt) { - case OMAP_DSS_DSI_FMT_RGB888: + case MIPI_DSI_FMT_RGB888: data_type = MIPI_DSI_PACKED_PIXEL_STREAM_24; break; - case OMAP_DSS_DSI_FMT_RGB666: + case MIPI_DSI_FMT_RGB666: data_type = MIPI_DSI_PIXEL_STREAM_3BYTE_18; bre
[PATCHv2 50/56] drm/omap: drop empty omap_encoder helper functions
Cleanup empty functions for encoder enable, disable and atomic check. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/omap_encoder.c | 28 -- 1 file changed, 28 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_encoder.c b/drivers/gpu/drm/omapdrm/omap_encoder.c index 5f5fa01240a7..e24411fb9dac 100644 --- a/drivers/gpu/drm/omapdrm/omap_encoder.c +++ b/drivers/gpu/drm/omapdrm/omap_encoder.c @@ -113,36 +113,8 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder, dss_mgr_set_timings(output, &vm); } -static void omap_encoder_disable(struct drm_encoder *encoder) -{ - struct omap_encoder *omap_encoder = to_omap_encoder(encoder); - struct omap_dss_device *dssdev = omap_encoder->output; - struct drm_device *dev = encoder->dev; - - dev_dbg(dev->dev, "disable(%s)\n", dssdev->name); -} - -static void omap_encoder_enable(struct drm_encoder *encoder) -{ - struct omap_encoder *omap_encoder = to_omap_encoder(encoder); - struct omap_dss_device *dssdev = omap_encoder->output; - struct drm_device *dev = encoder->dev; - - dev_dbg(dev->dev, "enable(%s)\n", dssdev->name); -} - -static int omap_encoder_atomic_check(struct drm_encoder *encoder, -struct drm_crtc_state *crtc_state, -struct drm_connector_state *conn_state) -{ - return 0; -} - static const struct drm_encoder_helper_funcs omap_encoder_helper_funcs = { .mode_set = omap_encoder_mode_set, - .disable = omap_encoder_disable, - .enable = omap_encoder_enable, - .atomic_check = omap_encoder_atomic_check, }; /* initialize encoder */ -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 23/56] drm/omap: dsi: use pixel-format and mode from attach
In order to reduce the amount of custom functionality, this moves handling of pixel format and DSI mode from set_config() to dsi attach. Signed-off-by: Sebastian Reichel --- .../gpu/drm/omapdrm/displays/panel-dsi-cm.c | 2 -- drivers/gpu/drm/omapdrm/dss/dsi.c | 20 +-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index a45df247aad1..199eac88a777 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -550,8 +550,6 @@ static int dsicm_power_on(struct panel_drv_data *ddata) u8 id1, id2, id3; int r; struct omap_dss_dsi_config dsi_config = { - .mode = OMAP_DSS_DSI_CMD_MODE, - .pixel_format = MIPI_DSI_FMT_RGB888, .vm = &ddata->vm, .hs_clk_min = 15000, .hs_clk_max = 3, diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index 64407f4651af..6c625b6d6d6b 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -4583,18 +4583,19 @@ static int dsi_set_config(struct omap_dss_device *dssdev, { struct dsi_data *dsi = to_dsi_data(dssdev); struct dsi_clk_calc_ctx ctx; + struct omap_dss_dsi_config cfg = *config; bool ok; int r; mutex_lock(&dsi->lock); - dsi->pix_fmt = config->pixel_format; - dsi->mode = config->mode; + cfg.mode = dsi->mode; + cfg.pixel_format = dsi->pix_fmt; - if (config->mode == OMAP_DSS_DSI_VIDEO_MODE) - ok = dsi_vm_calc(dsi, config, &ctx); + if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) + ok = dsi_vm_calc(dsi, &cfg, &ctx); else - ok = dsi_cm_calc(dsi, config, &ctx); + ok = dsi_cm_calc(dsi, &cfg, &ctx); if (!ok) { DSSERR("failed to find suitable DSI clock settings\n"); @@ -4605,7 +4606,7 @@ static int dsi_set_config(struct omap_dss_device *dssdev, dsi_pll_calc_dsi_fck(dsi, &ctx.dsi_cinfo); r = dsi_lp_clock_calc(ctx.dsi_cinfo.clkout[HSDIV_DSI], - config->lp_clk_min, config->lp_clk_max, &dsi->user_lp_cinfo); + cfg.lp_clk_min, cfg.lp_clk_max, &dsi->user_lp_cinfo); if (r) { DSSERR("failed to find suitable DSI LP clock settings\n"); goto err; @@ -4784,6 +4785,13 @@ int omap_dsi_host_attach(struct mipi_dsi_host *host, } dsi->vc[channel].dest = client; + + dsi->pix_fmt = client->format; + if (client->mode_flags & MIPI_DSI_MODE_VIDEO) + dsi->mode = OMAP_DSS_DSI_VIDEO_MODE; + else + dsi->mode = OMAP_DSS_DSI_CMD_MODE; + return 0; } -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
RFC: drm/virtio: Dummy virtio GPU
Hi, I'd like to get comments on this before I polish it. This is a simple way to get something similar with vkms but it heavily reuse the code provided by virtio-gpu. Please feel free to give me any feedbacks or comments. Thanks! ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 0/3] ti-sysc changes for probing DSS with dts data
Hi all, Here are some changes to start probing display susbsystem (DSS) with device tree data instead of platform data. These changes are against v5.6-rc1, and depend on the earlier series "[PATCH 0/7] ti-sysc driver fix for hdq1w and few improvments". I'll be posting the related dts changes separately. Regards, Tony Tony Lindgren (3): drm/omap: Prepare DSS for probing without legacy platform data bus: ti-sysc: Detect display subsystem related devices bus: ti-sysc: Implement display subsystem reset quirk drivers/bus/ti-sysc.c | 144 ++ drivers/gpu/drm/omapdrm/dss/dss.c | 25 ++- .../gpu/drm/omapdrm/dss/omapdss-boot-init.c | 25 ++- include/linux/platform_data/ti-sysc.h | 1 + 4 files changed, 184 insertions(+), 11 deletions(-) -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v7 2/2] drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP bridge driver
The ANX7625 is an ultra-low power 4K Mobile HD Transmitter designed for portable device. It converts MIPI DSI/DPI to DisplayPort 1.3 4K. The ANX7625 can support both USB Type-C PD feature and MIPI DSI/DPI to DP feature. This driver only enabled MIPI DSI/DPI to DP feature. Signed-off-by: Xin Ji --- drivers/gpu/drm/bridge/Makefile |2 +- drivers/gpu/drm/bridge/analogix/Kconfig |6 + drivers/gpu/drm/bridge/analogix/Makefile |1 + drivers/gpu/drm/bridge/analogix/anx7625.c | 2172 + drivers/gpu/drm/bridge/analogix/anx7625.h | 410 ++ 5 files changed, 2590 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.c create mode 100644 drivers/gpu/drm/bridge/analogix/anx7625.h diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile index 4934fcf..bcd388a 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -12,8 +12,8 @@ obj-$(CONFIG_DRM_SII9234) += sii9234.o obj-$(CONFIG_DRM_THINE_THC63LVD1024) += thc63lvd1024.o obj-$(CONFIG_DRM_TOSHIBA_TC358764) += tc358764.o obj-$(CONFIG_DRM_TOSHIBA_TC358767) += tc358767.o -obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix/ obj-$(CONFIG_DRM_I2C_ADV7511) += adv7511/ obj-$(CONFIG_DRM_TI_SN65DSI86) += ti-sn65dsi86.o obj-$(CONFIG_DRM_TI_TFP410) += ti-tfp410.o +obj-y += analogix/ obj-y += synopsys/ diff --git a/drivers/gpu/drm/bridge/analogix/Kconfig b/drivers/gpu/drm/bridge/analogix/Kconfig index e930ff9..b2f127e 100644 --- a/drivers/gpu/drm/bridge/analogix/Kconfig +++ b/drivers/gpu/drm/bridge/analogix/Kconfig @@ -2,3 +2,9 @@ config DRM_ANALOGIX_DP tristate depends on DRM + +config ANALOGIX_ANX7625 + tristate "Analogix MIPI to DP interface support" + help + ANX7625 is an ultra-low power 4K mobile HD transmitter designed + for portable devices. It converts MIPI/DPI to DisplayPort1.3 4K. diff --git a/drivers/gpu/drm/bridge/analogix/Makefile b/drivers/gpu/drm/bridge/analogix/Makefile index fdbf3fd..8a52867 100644 --- a/drivers/gpu/drm/bridge/analogix/Makefile +++ b/drivers/gpu/drm/bridge/analogix/Makefile @@ -1,3 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only +obj-$(CONFIG_ANALOGIX_ANX7625) += anx7625.o analogix_dp-objs := analogix_dp_core.o analogix_dp_reg.o obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix_dp.o diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c new file mode 100644 index 000..90a693a --- /dev/null +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -0,0 +1,2172 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright(c) 2016, Analogix Semiconductor. All rights reserved. + * + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "anx7625.h" + +/* + * there is a sync issue while access I2C register between AP(CPU) and + * internal firmware(OCM), to avoid the race condition, AP should access + * the reserved slave address before slave address occurs changes. + */ +static int i2c_access_workaround(struct anx7625_data *ctx, +struct i2c_client *client) +{ + u8 offset; + struct device *dev = &client->dev; + int ret; + + if (client == ctx->last_client) + return 0; + + ctx->last_client = client; + + if (client == ctx->i2c.tcpc_client) + offset = RSVD_00_ADDR; + else if (client == ctx->i2c.tx_p0_client) + offset = RSVD_D1_ADDR; + else if (client == ctx->i2c.tx_p1_client) + offset = RSVD_60_ADDR; + else if (client == ctx->i2c.rx_p0_client) + offset = RSVD_39_ADDR; + else if (client == ctx->i2c.rx_p1_client) + offset = RSVD_7F_ADDR; + else + offset = RSVD_00_ADDR; + + ret = i2c_smbus_write_byte_data(client, offset, 0x00); + if (ret < 0) + DRM_DEV_ERROR(dev, + "failed to access i2c id=%x\n:%x", + client->addr, offset); + + return ret; +} + +static int anx7625_reg_read(struct anx7625_data *ctx, + struct i2c_client *client, u8 reg_addr) +{ + int ret; + struct device *dev = &client->dev; + + i2c_access_workaround(ctx, client); + + ret = i2c_smbus_read_byte_data(client, reg_addr); + if (ret < 0) + DRM_DEV_ERROR(dev, "read i2c failed id=%x:%x\n", + client->addr, reg_addr); + + return ret; +} + +static int anx7625_reg_block_read(struct anx7625_data *ctx, + struct i2c_client *client, + u8 reg_addr, u8 len, u8 *buf) +{ + int ret; + str
[PATCHv2 26/56] drm/omap: dsi: move TE GPIO handling into core
In preparation for removing custom DSS calls from the DSI panel driver, this moves support for external tearing event GPIOs into the DSI host driver. This way tearing events are always handled in the core resulting in simplification of the panel drivers. The TE GPIO acquisition follows works in the same way as the exynos DSI implementation. Signed-off-by: Sebastian Reichel --- .../gpu/drm/omapdrm/displays/panel-dsi-cm.c | 101 + drivers/gpu/drm/omapdrm/dss/dsi.c | 140 -- 2 files changed, 135 insertions(+), 106 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 79ac1f6b375a..30e48d0de961 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -54,7 +54,6 @@ struct panel_drv_data { /* panel HW configuration from DT or platform data */ struct gpio_desc *reset_gpio; - struct gpio_desc *ext_te_gpio; struct regulator_bulk_data supplies[DCS_REGULATOR_SUPPLY_NUM]; @@ -68,10 +67,6 @@ struct panel_drv_data { bool te_enabled; - atomic_t do_update; - - struct delayed_work te_timeout_work; - bool intro_printed; struct workqueue_struct *workqueue; @@ -83,8 +78,6 @@ struct panel_drv_data { #define to_panel_data(p) container_of(p, struct panel_drv_data, dssdev) -static irqreturn_t dsicm_te_isr(int irq, void *data); -static void dsicm_te_timeout_work_callback(struct work_struct *work); static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable); static int dsicm_panel_reset(struct panel_drv_data *ddata); @@ -240,9 +233,6 @@ static int dsicm_enter_ulps(struct panel_drv_data *ddata) if (r) goto err; - if (ddata->ext_te_gpio) - disable_irq(gpiod_to_irq(ddata->ext_te_gpio)); - src->ops->dsi.disable(src, false, true); ddata->ulps_enabled = true; @@ -271,15 +261,12 @@ static int dsicm_exit_ulps(struct panel_drv_data *ddata) src->ops->enable(src); ddata->dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; - r = _dsicm_enable_te(ddata, true); + r = _dsicm_enable_te(ddata, ddata->te_enabled); if (r) { dev_err(&ddata->dsi->dev, "failed to re-enable TE"); goto err2; } - if (ddata->ext_te_gpio) - enable_irq(gpiod_to_irq(ddata->ext_te_gpio)); - dsicm_queue_ulps_work(ddata); ddata->ulps_enabled = false; @@ -290,11 +277,8 @@ static int dsicm_exit_ulps(struct panel_drv_data *ddata) dev_err(&ddata->dsi->dev, "failed to exit ULPS"); r = dsicm_panel_reset(ddata); - if (!r) { - if (ddata->ext_te_gpio) - enable_irq(gpiod_to_irq(ddata->ext_te_gpio)); + if (!r) ddata->ulps_enabled = false; - } dsicm_queue_ulps_work(ddata); @@ -745,43 +729,6 @@ static void dsicm_framedone_cb(int err, void *data) src->ops->dsi.bus_unlock(src); } -static irqreturn_t dsicm_te_isr(int irq, void *data) -{ - struct panel_drv_data *ddata = data; - struct omap_dss_device *src = ddata->src; - int old; - int r; - - old = atomic_cmpxchg(&ddata->do_update, 1, 0); - - if (old) { - cancel_delayed_work(&ddata->te_timeout_work); - - r = src->ops->dsi.update(src, ddata->dsi->channel, dsicm_framedone_cb, - ddata); - if (r) - goto err; - } - - return IRQ_HANDLED; -err: - dev_err(&ddata->dsi->dev, "start update failed\n"); - src->ops->dsi.bus_unlock(src); - return IRQ_HANDLED; -} - -static void dsicm_te_timeout_work_callback(struct work_struct *work) -{ - struct panel_drv_data *ddata = container_of(work, struct panel_drv_data, - te_timeout_work.work); - struct omap_dss_device *src = ddata->src; - - dev_err(&ddata->dsi->dev, "TE not received for 250ms!\n"); - - atomic_set(&ddata->do_update, 0); - src->ops->dsi.bus_unlock(src); -} - static int dsicm_update(struct omap_dss_device *dssdev, u16 x, u16 y, u16 w, u16 h) { @@ -809,16 +756,10 @@ static int dsicm_update(struct omap_dss_device *dssdev, if (r) goto err; - if (ddata->te_enabled && ddata->ext_te_gpio) { - schedule_delayed_work(&ddata->te_timeout_work, - msecs_to_jiffies(250)); - atomic_set(&ddata->do_update, 1); - } else { - r = src->ops->dsi.update(src, ddata->dsi->channel, dsicm_framedone_cb, - ddata); - if (r) - goto err; - } + r = src->ops->dsi.update(src, ddata->dsi->channel, dsicm_framedone_cb, + d
Re: [PATCH v7 0/2] Add initial support for slimport anx7625
On Tue, Feb 25, 2020 at 10:42:00AM +0300, Dan Carpenter wrote: > On Tue, Feb 25, 2020 at 02:11:39PM +0800, Xin Ji wrote: > > Hi all, > > > > The following series add initial support for the Slimport ANX7625 > > transmitter, a > > ultra-low power Full-HD 4K MIPI to DP transmitter designed for portable > > device. > > > > This is the initial version, any mistakes, please let me know, I will fix > > it in > ^^^ > > the next series. > > This is actually the v7 version, but the patch zero cover letter hasn't > been updated. :P The last time anyone responded to these patches was > to point out three simple bugs which you fixed in v4 last November. Sorry, I missed it, I'll resend the cover letter. > > What changed in this version? My guess is that nothing changed and you > are just prodding us to re-review it... Feel free to say that also > because we can't read your mind. I added a new bridge interface "mode_fixup" for processing critical timing. And add MIPI RX tolerance by setting register 0x1B to 0x3D. > > regards, > dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 41/56] drm/omap: dsi: return proper error code from dsi_update_all()
Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/dss/dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index acbfffe83b3e..f629e6b1025b 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -3987,7 +3987,7 @@ static int dsi_update_all(struct omap_dss_device *dssdev) return r; } - return 0; + return r; } /* Display funcs */ -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 35/56] drm/omap: dsi: convert to drm_panel
This converts the DSI module to expect common drm_panel display drivers instead of dssdev based ones. Signed-off-by: Sebastian Reichel --- .../gpu/drm/omapdrm/displays/panel-dsi-cm.c | 210 +++--- drivers/gpu/drm/omapdrm/dss/dsi.c | 133 +-- .../gpu/drm/omapdrm/dss/omapdss-boot-init.c | 1 - drivers/gpu/drm/omapdrm/dss/omapdss.h | 8 - 4 files changed, 193 insertions(+), 159 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 30be9e4ab908..803b7dada343 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -6,8 +6,6 @@ * Author: Tomi Valkeinen */ -/* #define DEBUG */ - #include #include #include @@ -20,11 +18,14 @@ #include #include +#include +#include +#include +#include #include #include - -#include "../dss/omapdss.h" +#include #define DCS_READ_NUM_ERRORS0x05 #define DCS_GET_ID10xda @@ -35,11 +36,8 @@ struct panel_drv_data { struct mipi_dsi_device *dsi; - - struct omap_dss_device dssdev; - struct omap_dss_device *src; - - struct videomode vm; + struct drm_panel panel; + struct drm_display_mode mode; struct mutex lock; @@ -71,7 +69,11 @@ struct panel_drv_data { bool ulps_enabled; }; -#define to_panel_data(p) container_of(p, struct panel_drv_data, dssdev) + +static inline struct panel_drv_data *panel_to_ddata(struct drm_panel *panel) +{ + return container_of(panel, struct panel_drv_data, panel); +} static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable); @@ -285,7 +287,6 @@ static void dsicm_hw_reset(struct panel_drv_data *ddata) static int dsicm_power_on(struct panel_drv_data *ddata) { - struct omap_dss_device *src = ddata->src; u8 id1, id2, id3; int r; @@ -322,10 +323,6 @@ static int dsicm_power_on(struct panel_drv_data *ddata) if (r) goto err; - r = src->ops->dsi.enable_video_output(src, ddata->dsi->channel); - if (r) - goto err; - ddata->enabled = true; if (!ddata->intro_printed) { @@ -345,15 +342,12 @@ static int dsicm_power_on(struct panel_drv_data *ddata) return r; } -static void dsicm_power_off(struct panel_drv_data *ddata) +static int dsicm_power_off(struct panel_drv_data *ddata) { - struct omap_dss_device *src = ddata->src; int r; ddata->enabled = false; - src->ops->dsi.disable_video_output(src, ddata->dsi->channel); - r = mipi_dsi_dcs_set_display_off(ddata->dsi); if (!r) r = dsicm_sleep_in(ddata); @@ -363,52 +357,25 @@ static void dsicm_power_off(struct panel_drv_data *ddata) "error disabling panel, issuing HW reset\n"); dsicm_hw_reset(ddata); } -} - -static int dsicm_connect(struct omap_dss_device *src, -struct omap_dss_device *dst) -{ - struct panel_drv_data *ddata = to_panel_data(dst); - - ddata->src = src; - return 0; -} -static void dsicm_disconnect(struct omap_dss_device *src, -struct omap_dss_device *dst) -{ - struct panel_drv_data *ddata = to_panel_data(dst); - - ddata->src = NULL; + return r; } -static void dsicm_pre_enable(struct omap_dss_device *dssdev) +static int dsicm_prepare(struct drm_panel *panel) { - struct panel_drv_data *ddata = to_panel_data(dssdev); - struct omap_dss_device *src = ddata->src; + struct panel_drv_data *ddata = panel_to_ddata(panel); int r; - struct omap_dss_dsi_config dsi_config = { - .vm = &ddata->vm, - .hs_clk_min = 15000, - .hs_clk_max = 3, - .lp_clk_min = 700, - .lp_clk_max = 1000, - }; r = regulator_bulk_enable(DCS_REGULATOR_SUPPLY_NUM, ddata->supplies); - if (r) { + if (r) dev_err(&ddata->dsi->dev, "failed to enable supplies: %d\n", r); - } - r = src->ops->dsi.set_config(src, &dsi_config); - if (r) { - dev_err(&ddata->dsi->dev, "failed to configure DSI\n"); - } + return r; } -static void dsicm_enable(struct omap_dss_device *dssdev) +static int dsicm_enable(struct drm_panel *panel) { - struct panel_drv_data *ddata = to_panel_data(dssdev); + struct panel_drv_data *ddata = panel_to_ddata(panel); int r; mutex_lock(&ddata->lock); @@ -421,33 +388,39 @@ static void dsicm_enable(struct omap_dss_device *dssdev) dsicm_bl_power(ddata, true); - return; + return 0; err: - dev_dbg(&ddata->dsi->dev, "enable failed (%d)\n", r); + dev_err(&ddata->dsi->dev, "enable failed (%d)\n", r); mutex_unlock(&ddata->lock); + return r; +} + +stat
[PATCH 4/7] drm/sun4i: de2: rgb field in de2 format struct is redundant
drm_format_info structure already contains information if format is RGB or YUV. Use that instead. Signed-off-by: Jernej Skrabec --- drivers/gpu/drm/sun4i/sun8i_mixer.c| 48 -- drivers/gpu/drm/sun4i/sun8i_mixer.h| 1 - drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 6 ++-- drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 6 ++-- 4 files changed, 8 insertions(+), 53 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c index 4a64f7ae437a..45e3cd9e718c 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c @@ -31,297 +31,249 @@ static const struct de2_fmt_info de2_formats[] = { { .drm_fmt = DRM_FORMAT_ARGB, .de2_fmt = SUN8I_MIXER_FBFMT_ARGB, - .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_ABGR, .de2_fmt = SUN8I_MIXER_FBFMT_ABGR, - .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_RGBA, .de2_fmt = SUN8I_MIXER_FBFMT_RGBA, - .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_BGRA, .de2_fmt = SUN8I_MIXER_FBFMT_BGRA, - .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_XRGB, .de2_fmt = SUN8I_MIXER_FBFMT_XRGB, - .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_XBGR, .de2_fmt = SUN8I_MIXER_FBFMT_XBGR, - .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_RGBX, .de2_fmt = SUN8I_MIXER_FBFMT_RGBX, - .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_BGRX, .de2_fmt = SUN8I_MIXER_FBFMT_BGRX, - .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_RGB888, .de2_fmt = SUN8I_MIXER_FBFMT_RGB888, - .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_BGR888, .de2_fmt = SUN8I_MIXER_FBFMT_BGR888, - .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_RGB565, .de2_fmt = SUN8I_MIXER_FBFMT_RGB565, - .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_BGR565, .de2_fmt = SUN8I_MIXER_FBFMT_BGR565, - .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_ARGB, .de2_fmt = SUN8I_MIXER_FBFMT_ARGB, - .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, { /* for DE2 VI layer which ignores alpha */ .drm_fmt = DRM_FORMAT_XRGB, .de2_fmt = SUN8I_MIXER_FBFMT_ARGB, - .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_ABGR, .de2_fmt = SUN8I_MIXER_FBFMT_ABGR, - .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, { /* for DE2 VI layer which ignores alpha */ .drm_fmt = DRM_FORMAT_XBGR, .de2_fmt = SUN8I_MIXER_FBFMT_ABGR, - .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_RGBA, .de2_fmt = SUN8I_MIXER_FBFMT_RGBA, - .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, { /* for DE2 VI layer which ignores alpha */ .drm_fmt = DRM_FORMAT_RGBX, .de2_fmt = SUN8I_MIXER_FBFMT_RGBA, - .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_BGRA, .de2_fmt = SUN8I_MIXER_FBFMT_BGRA, - .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, { /* for DE2 VI layer which ignores alpha */ .drm_fmt = DRM_FORMAT_BGRX, .de2_fmt = SUN8I_MIXER_FBFMT_BGRA, - .rgb = true, .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_ARGB1555, .de2_fmt = SUN8I_MIXER_FBFMT_ARGB1555, - .rgb = true, .csc = SUN8
[PATCHv2 56/56] ARM: dts: omap4-droid4: add panel orientation
Add information about panel orientation, so that the system boots into a properly rotated shell. Signed-off-by: Sebastian Reichel --- arch/arm/boot/dts/motorola-mapphone-common.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/motorola-mapphone-common.dtsi b/arch/arm/boot/dts/motorola-mapphone-common.dtsi index 622383ec6a75..ec77b20470d2 100644 --- a/arch/arm/boot/dts/motorola-mapphone-common.dtsi +++ b/arch/arm/boot/dts/motorola-mapphone-common.dtsi @@ -208,6 +208,7 @@ lcd0: panel@0 { width-mm = <50>; height-mm = <89>; + rotation = <90>; panel-timing { clock-frequency = <0>; /* Calculated by dsi */ -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 18/56] drm/omap: panel-dsi-cm: use common MIPI DCS 1.3 defines
Drop local definition of common MIPI DCS 1.3 defines. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 9a2ccec27f7e..92c9dc211aeb 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -28,8 +28,6 @@ #include "../dss/omapdss.h" #define DCS_READ_NUM_ERRORS0x05 -#define DCS_BRIGHTNESS 0x51 -#define DCS_CTRL_DISPLAY 0x53 #define DCS_GET_ID10xda #define DCS_GET_ID20xdb #define DCS_GET_ID30xdc @@ -333,8 +331,10 @@ static int dsicm_bl_update_status(struct backlight_device *dev) src->ops->dsi.bus_lock(src); r = dsicm_wake_up(ddata); - if (!r) - r = dsicm_dcs_write_1(ddata, DCS_BRIGHTNESS, level); + if (!r) { + r = dsicm_dcs_write_1(ddata, + MIPI_DCS_SET_DISPLAY_BRIGHTNESS, level); + } src->ops->dsi.bus_unlock(src); } @@ -597,11 +597,11 @@ static int dsicm_power_on(struct panel_drv_data *ddata) if (r) goto err; - r = dsicm_dcs_write_1(ddata, DCS_BRIGHTNESS, 0xff); + r = dsicm_dcs_write_1(ddata, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, 0xff); if (r) goto err; - r = dsicm_dcs_write_1(ddata, DCS_CTRL_DISPLAY, + r = dsicm_dcs_write_1(ddata, MIPI_DCS_WRITE_CONTROL_DISPLAY, (1<<2) | (1<<5)); /* BL | BCTRL */ if (r) goto err; -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 08/56] drm/omap: panel-dsi-cm: convert to transfer API
This converts the panel-dsi-cm driver to use the transfer API instead of specific functions, so that the specific functions can be unexported and squashed into the generic transfer function. Signed-off-by: Sebastian Reichel --- .../gpu/drm/omapdrm/displays/panel-dsi-cm.c | 133 +- 1 file changed, 96 insertions(+), 37 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index e6ebfc35243e..92f510a771fe 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -140,45 +140,61 @@ static void hw_guard_wait(struct panel_drv_data *ddata) static int dsicm_dcs_read_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 *data) { struct omap_dss_device *src = ddata->src; - int r; - u8 buf[1]; - - r = src->ops->dsi.dcs_read(src, ddata->channel, dcs_cmd, buf, 1); - - if (r < 0) - return r; - - *data = buf[0]; + const struct mipi_dsi_msg msg = { + .channel = ddata->channel, + .type = MIPI_DSI_DCS_READ, + .tx_len = 1, + .tx_buf = &dcs_cmd, + .rx_len = 1, + .rx_buf = data + }; - return 0; + return src->ops->dsi.transfer(src, &msg); } static int dsicm_dcs_write_0(struct panel_drv_data *ddata, u8 dcs_cmd) { struct omap_dss_device *src = ddata->src; + const struct mipi_dsi_msg msg = { + .channel = ddata->channel, + .type = MIPI_DSI_DCS_SHORT_WRITE, + .tx_buf = &dcs_cmd, + .tx_len = 1, + }; - return src->ops->dsi.dcs_write(src, ddata->channel, &dcs_cmd, 1); + return src->ops->dsi.transfer(src, &msg); } static int dsicm_dcs_write_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 param) { struct omap_dss_device *src = ddata->src; - u8 buf[2] = { dcs_cmd, param }; + const u8 buf[] = { dcs_cmd, param }; + const struct mipi_dsi_msg msg = { + .channel = ddata->channel, + .type = MIPI_DSI_DCS_SHORT_WRITE_PARAM, + .tx_buf = &buf, + .tx_len = 2, + }; - return src->ops->dsi.dcs_write(src, ddata->channel, buf, 2); + return src->ops->dsi.transfer(src, &msg); } static int dsicm_sleep_in(struct panel_drv_data *ddata) { struct omap_dss_device *src = ddata->src; - u8 cmd; int r; + const u8 cmd = MIPI_DCS_ENTER_SLEEP_MODE; + const struct mipi_dsi_msg msg = { + .channel = ddata->channel, + .type = MIPI_DSI_DCS_SHORT_WRITE, + .tx_buf = &cmd, + .tx_len = 1, + }; hw_guard_wait(ddata); - cmd = MIPI_DCS_ENTER_SLEEP_MODE; - r = src->ops->dsi.dcs_write_nosync(src, ddata->channel, &cmd, 1); + r = src->ops->dsi.transfer(src, &msg); if (r) return r; @@ -233,28 +249,44 @@ static int dsicm_set_update_window(struct panel_drv_data *ddata, u16 y1 = y; u16 y2 = y + h - 1; - u8 buf[5]; - buf[0] = MIPI_DCS_SET_COLUMN_ADDRESS; - buf[1] = (x1 >> 8) & 0xff; - buf[2] = (x1 >> 0) & 0xff; - buf[3] = (x2 >> 8) & 0xff; - buf[4] = (x2 >> 0) & 0xff; + const u8 paramX[] = { + MIPI_DCS_SET_COLUMN_ADDRESS, + (x1 >> 8) & 0xff, + (x1 >> 0) & 0xff, + (x2 >> 8) & 0xff, + (x2 >> 0) & 0xff, + }; - r = src->ops->dsi.dcs_write_nosync(src, ddata->channel, buf, sizeof(buf)); - if (r) - return r; + const struct mipi_dsi_msg msgX = { + .channel = ddata->channel, + .type = MIPI_DSI_GENERIC_LONG_WRITE, + .tx_buf = paramX, + .tx_len = 5, + }; - buf[0] = MIPI_DCS_SET_PAGE_ADDRESS; - buf[1] = (y1 >> 8) & 0xff; - buf[2] = (y1 >> 0) & 0xff; - buf[3] = (y2 >> 8) & 0xff; - buf[4] = (y2 >> 0) & 0xff; + const u8 paramY[] = { + MIPI_DCS_SET_PAGE_ADDRESS, + (y1 >> 8) & 0xff, + (y1 >> 0) & 0xff, + (y2 >> 8) & 0xff, + (y2 >> 0) & 0xff, + }; - r = src->ops->dsi.dcs_write_nosync(src, ddata->channel, buf, sizeof(buf)); + const struct mipi_dsi_msg msgY = { + .channel = ddata->channel, + .type = MIPI_DSI_GENERIC_LONG_WRITE, + .tx_buf = paramY, + .tx_len = 5, + }; + + + r = src->ops->dsi.transfer(src, &msgX); if (r) return r; - src->ops->dsi.bta_sync(src, ddata->channel); + r = src->ops->dsi.transfer(src, &msgY); + if (r) + return r; return r; } @@ -991,6 +1023,27 @@ static int dsicm_get_te(struct omap_dss_device *dssdev) return r; } +static int ds
Re: [PATCH 03/89] i2c: brcmstb: Support BCM2711 HDMI BSC controllers
On 2/24/20 1:06 AM, Maxime Ripard wrote: > The HDMI blocks in the BCM2771 have an i2c controller to retrieve the > EDID. This block is split into two parts, the BSC and the AUTO_I2C, > lying in two separate register areas. > > The AUTO_I2C block has a mailbox-like interface and will take away the > BSC control from the CPU if enabled. However, the BSC is the actually > the same controller than the one supported by the brcmstb driver, and > the AUTO_I2C doesn't really bring any immediate benefit. > > Let's use the BSC then, but let's also tie the AUTO_I2C registers with a > separate compatible so that we can enable AUTO_I2C if needed in the > future. > > The AUTO_I2C is enabled by default at boot though, so we first need to > release the BSC from the AUTO_I2C control. > > Cc: Kamal Dasu > Cc: Florian Fainelli > Cc: Wolfram Sang > Cc: bcm-kernel-feedback-l...@broadcom.com > Cc: linux-...@vger.kernel.org > Signed-off-by: Maxime Ripard [snip] > @@ -705,6 +737,7 @@ static SIMPLE_DEV_PM_OPS(brcmstb_i2c_pm, > brcmstb_i2c_suspend, > static const struct of_device_id brcmstb_i2c_of_match[] = { > {.compatible = "brcm,brcmstb-i2c"}, > {.compatible = "brcm,brcmper-i2c"}, > + {.compatible = "brcm,bcm2711-hdmi-i2c"}, You could have added the bcm2711_release_bsc here as a function attached with the of_device_id::data member of the structure and do: if (data && data->init_func) rc = data->init_func(dev); But we can defer that until we have a second compatible string that requires the same approach. Akked-by: Florian Fainelli -- Florian ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 1/7] drm/sun4i: de2/de3: Remove unsupported VI layer formats
YUV444 and YVU444 are planar formats, but HW format RGB888 is packed. This means that those two mappings were never correct. Remove them. Fixes: 60a3dcf96aa8 ("drm/sun4i: Add DE2 definitions for YUV formats") Signed-off-by: Jernej Skrabec --- drivers/gpu/drm/sun4i/sun8i_mixer.c| 12 drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 2 -- 2 files changed, 14 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c index 7c24f8f832a5..3a78dbbceb8a 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c @@ -196,12 +196,6 @@ static const struct de2_fmt_info de2_formats[] = { .rgb = false, .csc = SUN8I_CSC_MODE_YUV2RGB, }, - { - .drm_fmt = DRM_FORMAT_YUV444, - .de2_fmt = SUN8I_MIXER_FBFMT_RGB888, - .rgb = true, - .csc = SUN8I_CSC_MODE_YUV2RGB, - }, { .drm_fmt = DRM_FORMAT_YUV422, .de2_fmt = SUN8I_MIXER_FBFMT_YUV422, @@ -220,12 +214,6 @@ static const struct de2_fmt_info de2_formats[] = { .rgb = false, .csc = SUN8I_CSC_MODE_YUV2RGB, }, - { - .drm_fmt = DRM_FORMAT_YVU444, - .de2_fmt = SUN8I_MIXER_FBFMT_RGB888, - .rgb = true, - .csc = SUN8I_CSC_MODE_YVU2RGB, - }, { .drm_fmt = DRM_FORMAT_YVU422, .de2_fmt = SUN8I_MIXER_FBFMT_YUV422, diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c index 42d445d23773..6a244d6fafd9 100644 --- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c +++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c @@ -431,11 +431,9 @@ static const u32 sun8i_vi_layer_formats[] = { DRM_FORMAT_YUV411, DRM_FORMAT_YUV420, DRM_FORMAT_YUV422, - DRM_FORMAT_YUV444, DRM_FORMAT_YVU411, DRM_FORMAT_YVU420, DRM_FORMAT_YVU422, - DRM_FORMAT_YVU444, }; struct sun8i_vi_layer *sun8i_vi_layer_init_one(struct drm_device *drm, -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 17/56] drm/omap: panel-dsi-cm: drop hardcoded VC
Use dsi->channel everywhere, which originates from DT. Signed-off-by: Sebastian Reichel --- .../gpu/drm/omapdrm/displays/panel-dsi-cm.c | 20 +++ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index b3688a8ca3cf..9a2ccec27f7e 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -27,9 +27,6 @@ #include "../dss/omapdss.h" -/* DSI Virtual channel. Hardcoded for now. */ -#define TCH 0 - #define DCS_READ_NUM_ERRORS0x05 #define DCS_BRIGHTNESS 0x51 #define DCS_CTRL_DISPLAY 0x53 @@ -73,7 +70,6 @@ struct panel_drv_data { bool te_enabled; atomic_t do_update; - int channel; struct delayed_work te_timeout_work; @@ -274,7 +270,7 @@ static int dsicm_exit_ulps(struct panel_drv_data *ddata) return 0; src->ops->enable(src); - src->ops->dsi.enable_hs(src, ddata->channel, true); + src->ops->dsi.enable_hs(src, ddata->dsi->channel, true); r = _dsicm_enable_te(ddata, true); if (r) { @@ -591,7 +587,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata) dsicm_hw_reset(ddata); - src->ops->dsi.enable_hs(src, ddata->channel, false); + src->ops->dsi.enable_hs(src, ddata->dsi->channel, false); r = dsicm_sleep_out(ddata); if (r) @@ -622,7 +618,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata) if (r) goto err; - r = src->ops->dsi.enable_video_output(src, ddata->channel); + r = src->ops->dsi.enable_video_output(src, ddata->dsi->channel); if (r) goto err; @@ -634,7 +630,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata) ddata->intro_printed = true; } - src->ops->dsi.enable_hs(src, ddata->channel, true); + src->ops->dsi.enable_hs(src, ddata->dsi->channel, true); return 0; err: @@ -658,7 +654,7 @@ static void dsicm_power_off(struct panel_drv_data *ddata) struct omap_dss_device *src = ddata->src; int r; - src->ops->dsi.disable_video_output(src, ddata->channel); + src->ops->dsi.disable_video_output(src, ddata->dsi->channel); r = mipi_dsi_dcs_set_display_off(ddata->dsi); if (!r) @@ -777,7 +773,7 @@ static irqreturn_t dsicm_te_isr(int irq, void *data) if (old) { cancel_delayed_work(&ddata->te_timeout_work); - r = src->ops->dsi.update(src, ddata->channel, dsicm_framedone_cb, + r = src->ops->dsi.update(src, ddata->dsi->channel, dsicm_framedone_cb, ddata); if (r) goto err; @@ -834,7 +830,7 @@ static int dsicm_update(struct omap_dss_device *dssdev, msecs_to_jiffies(250)); atomic_set(&ddata->do_update, 1); } else { - r = src->ops->dsi.update(src, ddata->channel, dsicm_framedone_cb, + r = src->ops->dsi.update(src, ddata->dsi->channel, dsicm_framedone_cb, ddata); if (r) goto err; @@ -1110,8 +1106,6 @@ static int dsicm_probe_of(struct mipi_dsi_device *dsi) struct display_timing timing; int err; - ddata->channel = TCH; - ddata->reset_gpio = devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(ddata->reset_gpio)) { err = PTR_ERR(ddata->reset_gpio); -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 34/56] drm/omap: dsi: drop custom panel capability support
Due to previous changes the DSI encoder gets the capabilities via DSI client's mode_flags and no longer needs the omapdss specific caps. The core code now checks if the DSI encoder is actually configured into command mode instead of just checking the panel capabilities. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 3 --- drivers/gpu/drm/omapdrm/dss/dsi.c | 8 drivers/gpu/drm/omapdrm/dss/omapdss.h | 8 +--- drivers/gpu/drm/omapdrm/omap_crtc.c | 17 - 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 6f559c1b0bf6..30be9e4ab908 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -602,9 +602,6 @@ static int dsicm_probe(struct mipi_dsi_device *dsi) dssdev->of_port = 0; dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES; - dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE | - OMAP_DSS_DISPLAY_CAP_TEAR_ELIM; - omapdss_display_init(dssdev); omapdss_device_register(dssdev); diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index b0e796f90fca..42f995da21a5 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -4732,6 +4732,13 @@ static bool dsi_vm_calc(struct dsi_data *dsi, dsi_vm_calc_pll_cb, ctx); } +static bool dsi_is_video_mode(struct omap_dss_device *dssdev) +{ + struct dsi_data *dsi = to_dsi_data(dssdev); + + return (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE); +} + static int dsi_set_config(struct omap_dss_device *dssdev, const struct omap_dss_dsi_config *config) { @@ -4951,6 +4958,7 @@ static const struct omap_dss_device_ops dsi_ops = { .disable_video_output = dsi_disable_video_output, .update = dsi_update_all, + .is_video_mode = dsi_is_video_mode, }, }; diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index d7081086c2b1..430e915d2759 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -122,11 +122,6 @@ enum omap_dss_dsi_mode { OMAP_DSS_DSI_VIDEO_MODE, }; -enum omap_display_caps { - OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE = 1 << 0, - OMAP_DSS_DISPLAY_CAP_TEAR_ELIM = 1 << 1, -}; - enum omap_dss_display_state { OMAP_DSS_DISPLAY_DISABLED = 0, OMAP_DSS_DISPLAY_ACTIVE, @@ -281,6 +276,7 @@ struct omap_dss_writeback_info { struct omapdss_dsi_ops { int (*update)(struct omap_dss_device *dssdev); + bool (*is_video_mode)(struct omap_dss_device *dssdev); /* legacy API used by omapdss panels */ int (*set_config)(struct omap_dss_device *dssdev, @@ -353,8 +349,6 @@ struct omap_dss_device { unsigned long ops_flags; u32 bus_flags; - enum omap_display_caps caps; - enum omap_dss_display_state state; /* OMAP DSS output specific fields */ diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c index c924d77207fb..af62f6075602 100644 --- a/drivers/gpu/drm/omapdrm/omap_crtc.c +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c @@ -495,8 +495,7 @@ static enum drm_mode_status omap_crtc_mode_valid(struct drm_crtc *crtc, * valid DISPC mode. DSI will calculate and configure the * proper DISPC mode later. */ - if (omap_crtc->pipe->output->next == NULL || - omap_crtc->pipe->output->next->type != OMAP_DISPLAY_TYPE_DSI) { + if (omap_crtc->pipe->output->type != OMAP_DISPLAY_TYPE_DSI) { r = priv->dispc_ops->mgr_check_timings(priv->dispc, omap_crtc->channel, &vm); @@ -548,17 +547,17 @@ static void omap_crtc_mode_set_nofb(struct drm_crtc *crtc) static bool omap_crtc_is_manually_updated(struct drm_crtc *crtc) { struct omap_crtc *omap_crtc = to_omap_crtc(crtc); - struct omap_dss_device *display = omap_crtc->pipe->output->next; + struct omap_dss_device *dssdev = omap_crtc->pipe->output; - if (!display) + if (dssdev->type != OMAP_DISPLAY_TYPE_DSI || + !dssdev->ops->dsi.is_video_mode) return false; - if (display->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) { - DBG("detected manually updated display!"); - return true; - } + if (dssdev->ops->dsi.is_video_mode(dssdev)) + return false; - return false; + DBG("detected manually updated display!"); + return true; } static int omap_crtc_atomic_check(struct drm_crtc *crtc, -- 2.25.0 ___ dri-dev
[PATCHv2 01/56] ARM: dts: omap: add channel to DSI panels
The standard binding for DSI requires, that the channel number of the panel is encoded in DT. This adds the channel number in all OMAP3-5 boards, in preparation for using common infrastructure. Signed-off-by: Sebastian Reichel --- .../devicetree/bindings/display/panel/panel-dsi-cm.txt | 4 +++- arch/arm/boot/dts/motorola-mapphone-common.dtsi | 3 ++- arch/arm/boot/dts/omap3-n950.dts| 3 ++- arch/arm/boot/dts/omap3.dtsi| 3 +++ arch/arm/boot/dts/omap4-sdp.dts | 6 -- arch/arm/boot/dts/omap4.dtsi| 6 ++ arch/arm/boot/dts/omap5.dtsi| 6 ++ 7 files changed, 26 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/display/panel/panel-dsi-cm.txt b/Documentation/devicetree/bindings/display/panel/panel-dsi-cm.txt index dce48eb9db57..f92d5c9adfc5 100644 --- a/Documentation/devicetree/bindings/display/panel/panel-dsi-cm.txt +++ b/Documentation/devicetree/bindings/display/panel/panel-dsi-cm.txt @@ -3,6 +3,7 @@ Generic MIPI DSI Command Mode Panel Required properties: - compatible: "panel-dsi-cm" +- reg: DSI channel number Optional properties: - label: a symbolic name for the panel @@ -15,9 +16,10 @@ Required nodes: Example --- -lcd0: display { +lcd0: panel@0 { compatible = "tpo,taal", "panel-dsi-cm"; label = "lcd0"; + reg = <0>; reset-gpios = <&gpio4 6 GPIO_ACTIVE_HIGH>; diff --git a/arch/arm/boot/dts/motorola-mapphone-common.dtsi b/arch/arm/boot/dts/motorola-mapphone-common.dtsi index 85665506f4f8..a5e4ba7c8dab 100644 --- a/arch/arm/boot/dts/motorola-mapphone-common.dtsi +++ b/arch/arm/boot/dts/motorola-mapphone-common.dtsi @@ -199,8 +199,9 @@ dsi1_out_ep: endpoint { }; }; - lcd0: display { + lcd0: panel@0 { compatible = "panel-dsi-cm"; + reg = <0>; label = "lcd0"; vddi-supply = <&lcd_regulator>; reset-gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>; /* gpio101 */ diff --git a/arch/arm/boot/dts/omap3-n950.dts b/arch/arm/boot/dts/omap3-n950.dts index 31d47a1fad84..80cf4e1177da 100644 --- a/arch/arm/boot/dts/omap3-n950.dts +++ b/arch/arm/boot/dts/omap3-n950.dts @@ -225,8 +225,9 @@ dsi_out_ep: endpoint { }; }; - lcd0: display { + lcd0: panel@0 { compatible = "nokia,himalaya", "panel-dsi-cm"; + reg = <0>; label = "lcd0"; pinctrl-names = "default"; diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi index 634ea16a711e..409d434a9b18 100644 --- a/arch/arm/boot/dts/omap3.dtsi +++ b/arch/arm/boot/dts/omap3.dtsi @@ -820,6 +820,9 @@ dsi: encoder@4804fc00 { ti,hwmods = "dss_dsi1"; clocks = <&dss1_alwon_fck>, <&dss2_alwon_fck>; clock-names = "fck", "sys_clk"; + + #address-cells = <1>; + #size-cells = <0>; }; rfbi: encoder@48050800 { diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts index 91480ac1f328..8a8307517dab 100644 --- a/arch/arm/boot/dts/omap4-sdp.dts +++ b/arch/arm/boot/dts/omap4-sdp.dts @@ -662,8 +662,9 @@ dsi1_out_ep: endpoint { }; }; - lcd0: display { + lcd0: panel@0 { compatible = "tpo,taal", "panel-dsi-cm"; + reg = <0>; label = "lcd0"; reset-gpios = <&gpio4 6 GPIO_ACTIVE_HIGH>; /* 102 */ @@ -687,8 +688,9 @@ dsi2_out_ep: endpoint { }; }; - lcd1: display { + lcd1: panel@0 { compatible = "tpo,taal", "panel-dsi-cm"; + reg = <0>; label = "lcd1"; reset-gpios = <&gpio4 8 GPIO_ACTIVE_HIGH>; /* 104 */ diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi index 9a87440d0b9d..a75734065cac 100644 --- a/arch/arm/boot/dts/omap4.dtsi +++ b/arch/arm/boot/dts/omap4.dtsi @@ -465,6 +465,9 @@ dsi1: encoder@58004000 { clocks = <&l3_dss_clkctrl OMAP4_DSS_CORE_CLKCTRL 8>, <&l3_dss_clkctrl OMAP4_DSS_CORE_CLKCTRL 10>; clock-names = "fck", "sys_clk"; + + #address-cells = <1>; + #size-cells = <0>; }; dsi2: encoder@58005000 { @@ -479,6 +482,9 @@ dsi2: encoder@58005000 { clocks = <&l3_dss_clkctrl OMAP4_DSS_CORE_CLKCTRL 8>, <&l3_dss_clkctrl OMAP4_DSS_CORE_CLKCTRL 10>; clock-names = "fck"
[PATCH 5/7] drm/sun4i: de2: csc_mode in de2 format struct is mostly redundant
For RGB formats CSC mode is always set to none and for YUV formats almost always set to YUV to RGB. Add a helper function to deduce CSC mode from format. Signed-off-by: Jernej Skrabec --- drivers/gpu/drm/sun4i/sun8i_mixer.c| 48 -- drivers/gpu/drm/sun4i/sun8i_mixer.h| 6 ++-- drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 24 +++-- 3 files changed, 23 insertions(+), 55 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c index 45e3cd9e718c..e078ec96de2d 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c @@ -31,250 +31,202 @@ static const struct de2_fmt_info de2_formats[] = { { .drm_fmt = DRM_FORMAT_ARGB, .de2_fmt = SUN8I_MIXER_FBFMT_ARGB, - .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_ABGR, .de2_fmt = SUN8I_MIXER_FBFMT_ABGR, - .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_RGBA, .de2_fmt = SUN8I_MIXER_FBFMT_RGBA, - .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_BGRA, .de2_fmt = SUN8I_MIXER_FBFMT_BGRA, - .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_XRGB, .de2_fmt = SUN8I_MIXER_FBFMT_XRGB, - .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_XBGR, .de2_fmt = SUN8I_MIXER_FBFMT_XBGR, - .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_RGBX, .de2_fmt = SUN8I_MIXER_FBFMT_RGBX, - .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_BGRX, .de2_fmt = SUN8I_MIXER_FBFMT_BGRX, - .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_RGB888, .de2_fmt = SUN8I_MIXER_FBFMT_RGB888, - .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_BGR888, .de2_fmt = SUN8I_MIXER_FBFMT_BGR888, - .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_RGB565, .de2_fmt = SUN8I_MIXER_FBFMT_RGB565, - .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_BGR565, .de2_fmt = SUN8I_MIXER_FBFMT_BGR565, - .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_ARGB, .de2_fmt = SUN8I_MIXER_FBFMT_ARGB, - .csc = SUN8I_CSC_MODE_OFF, }, { /* for DE2 VI layer which ignores alpha */ .drm_fmt = DRM_FORMAT_XRGB, .de2_fmt = SUN8I_MIXER_FBFMT_ARGB, - .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_ABGR, .de2_fmt = SUN8I_MIXER_FBFMT_ABGR, - .csc = SUN8I_CSC_MODE_OFF, }, { /* for DE2 VI layer which ignores alpha */ .drm_fmt = DRM_FORMAT_XBGR, .de2_fmt = SUN8I_MIXER_FBFMT_ABGR, - .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_RGBA, .de2_fmt = SUN8I_MIXER_FBFMT_RGBA, - .csc = SUN8I_CSC_MODE_OFF, }, { /* for DE2 VI layer which ignores alpha */ .drm_fmt = DRM_FORMAT_RGBX, .de2_fmt = SUN8I_MIXER_FBFMT_RGBA, - .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_BGRA, .de2_fmt = SUN8I_MIXER_FBFMT_BGRA, - .csc = SUN8I_CSC_MODE_OFF, }, { /* for DE2 VI layer which ignores alpha */ .drm_fmt = DRM_FORMAT_BGRX, .de2_fmt = SUN8I_MIXER_FBFMT_BGRA, - .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_ARGB1555, .de2_fmt = SUN8I_MIXER_FBFMT_ARGB1555, - .csc = SUN8I_CSC_MODE_OFF, }, { /* for DE2 VI layer which ignores alpha */ .drm_fmt = DRM_FORMAT_XRGB1555, .de2_fmt = SUN8I_MIXER_FBFMT_ARGB1555, - .csc = SUN8I_CSC_MODE_OFF, }, { .drm_fmt = DRM_FORMAT_ABGR1555, .de2_fmt = SUN8I_MIXER_FBFMT_ABGR1555, - .csc = SUN8I_CSC_MODE_OFF, }, { /* for DE2 VI layer which ignores alpha */ .drm_fmt = DRM_FORMAT_XBGR1555, .de2_fmt = SUN8I_MIXER_FBFMT_ABGR155
Re: [PATCH RFC v3 2/6] drm/sprd: add Unisoc's drm kms master
Got it, thanks! On Tue, Feb 25, 2020 at 12:43 AM Emil Velikov wrote: > Hi all, > > On Fri, 21 Feb 2020 at 11:15, Kevin Tang wrote: > > > > From: Kevin Tang > > > > Adds drm support for the Unisoc's display subsystem. > > > > This is drm device and gem driver. This driver provides support for the > > Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. > > > > Cc: Orson Zhai > > Cc: Baolin Wang > > Cc: Chunyan Zhang > > Signed-off-by: Kevin Tang > > --- > > drivers/gpu/drm/Kconfig | 2 + > > drivers/gpu/drm/Makefile| 1 + > > drivers/gpu/drm/sprd/Kconfig| 14 ++ > > drivers/gpu/drm/sprd/Makefile | 7 + > > drivers/gpu/drm/sprd/sprd_drm.c | 292 > > > drivers/gpu/drm/sprd/sprd_drm.h | 16 +++ > > 6 files changed, 332 insertions(+) > > create mode 100644 drivers/gpu/drm/sprd/Kconfig > > create mode 100644 drivers/gpu/drm/sprd/Makefile > > create mode 100644 drivers/gpu/drm/sprd/sprd_drm.c > > create mode 100644 drivers/gpu/drm/sprd/sprd_drm.h > > > > diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig > > index bfdadc3..cead12c 100644 > > --- a/drivers/gpu/drm/Kconfig > > +++ b/drivers/gpu/drm/Kconfig > > @@ -387,6 +387,8 @@ source "drivers/gpu/drm/aspeed/Kconfig" > > > > source "drivers/gpu/drm/mcde/Kconfig" > > > > +source "drivers/gpu/drm/sprd/Kconfig" > > + > > # Keep legacy drivers last > > > > menuconfig DRM_LEGACY > > diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile > > index 9f1c7c4..85ca211 100644 > > --- a/drivers/gpu/drm/Makefile > > +++ b/drivers/gpu/drm/Makefile > > @@ -122,3 +122,4 @@ obj-$(CONFIG_DRM_LIMA) += lima/ > > obj-$(CONFIG_DRM_PANFROST) += panfrost/ > > obj-$(CONFIG_DRM_ASPEED_GFX) += aspeed/ > > obj-$(CONFIG_DRM_MCDE) += mcde/ > > +obj-$(CONFIG_DRM_SPRD) += sprd/ > > diff --git a/drivers/gpu/drm/sprd/Kconfig b/drivers/gpu/drm/sprd/Kconfig > > new file mode 100644 > > index 000..79f286b > > --- /dev/null > > +++ b/drivers/gpu/drm/sprd/Kconfig > > @@ -0,0 +1,14 @@ > > +config DRM_SPRD > > + tristate "DRM Support for Unisoc SoCs Platform" > > + depends on ARCH_SPRD > > + depends on DRM && OF > > + select DRM_KMS_HELPER > > + select DRM_GEM_CMA_HELPER > > + select DRM_KMS_CMA_HELPER > > + select DRM_MIPI_DSI > > + select DRM_PANEL > > + select VIDEOMODE_HELPERS > > + select BACKLIGHT_CLASS_DEVICE > > + help > > + Choose this option if you have a Unisoc chipsets. > > + If M is selected the module will be called sprd-drm. > > \ No newline at end of file > > diff --git a/drivers/gpu/drm/sprd/Makefile > b/drivers/gpu/drm/sprd/Makefile > > new file mode 100644 > > index 000..63b8751 > > --- /dev/null > > +++ b/drivers/gpu/drm/sprd/Makefile > > @@ -0,0 +1,7 @@ > > +# SPDX-License-Identifier: GPL-2.0 > > + > > +ccflags-y += -Iinclude/drm > > + > > +subdir-ccflags-y += -I$(src) > > + > > +obj-y := sprd_drm.o > > diff --git a/drivers/gpu/drm/sprd/sprd_drm.c > b/drivers/gpu/drm/sprd/sprd_drm.c > > new file mode 100644 > > index 000..7cac098 > > --- /dev/null > > +++ b/drivers/gpu/drm/sprd/sprd_drm.c > > @@ -0,0 +1,292 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > +/* > > + * Copyright (C) 2019 Unisoc Inc. > > + */ > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#include "sprd_drm.h" > > + > > +#define DRIVER_NAME"sprd" > > +#define DRIVER_DESC"Spreadtrum SoCs' DRM Driver" > > +#define DRIVER_DATE"20191101" > > +#define DRIVER_MAJOR 1 > > +#define DRIVER_MINOR 0 > > + > > +static const struct drm_mode_config_helper_funcs > sprd_drm_mode_config_helper = { > > + .atomic_commit_tail = drm_atomic_helper_commit_tail_rpm, > > +}; > > + > > +static const struct drm_mode_config_funcs sprd_drm_mode_config_funcs = { > > + .fb_create = drm_gem_fb_create, > > + .atomic_check = drm_atomic_helper_check, > > + .atomic_commit = drm_atomic_helper_commit, > > +}; > > + > > +static void sprd_drm_mode_config_init(struct drm_device *drm) > > +{ > > + drm_mode_config_init(drm); > > + > > + drm->mode_config.min_width = 0; > > + drm->mode_config.min_height = 0; > > + drm->mode_config.max_width = 8192; > > + drm->mode_config.max_height = 8192; > > + drm->mode_config.allow_fb_modifiers = true; > > + > > + drm->mode_config.funcs = &sprd_drm_mode_config_funcs; > > + drm->mode_config.helper_private = &sprd_drm_mode_config_helper; > > +} > > + > > +DEFINE_DRM_GEM_CMA_FOPS(sprd_drm_fops); > > + > > +static struct drm_driver sprd_drm_drv = { > > + .driver_features= DRIVER_GEM | DRIVER_MODESET | > DRIVER_ATOMIC, > > + .fops = &sprd_drm_fops, > > + > > + /* GEM Operations */ > > + DRM_GEM_CMA_VMAP_DRIVER_O
Re: [PATCH 02/89] dt-bindings: i2c: brcmstb: Add BCM2711 BSC/AUTO-I2C binding
On 2/24/20 1:06 AM, Maxime Ripard wrote: > The HDMI blocks in the BCM2771 have an i2c controller to retrieve the > EDID. This block is split into two parts, the BSC and the AUTO_I2C, > lying in two separate register areas. > > The AUTO_I2C block has a mailbox-like interface and will take away the > BSC control from the CPU if enabled. However, the BSC is the actually > the same controller than the one supported by the brcmstb driver, and > the AUTO_I2C doesn't really bring any immediate benefit. > > We can model it in the DT as a single device with two register range, > which will allow us to use or or the other in the driver without > changing anything in the DT. > > Cc: Kamal Dasu > Cc: Florian Fainelli > Cc: Rob Herring > Cc: Wolfram Sang > Cc: bcm-kernel-feedback-l...@broadcom.com > Cc: linux-...@vger.kernel.org > Cc: devicet...@vger.kernel.org > Signed-off-by: Maxime Ripard Acked-by: Florian Fainelli -- Florian ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 15/56] drm/omap: panel-dsi-cm: use DSI helpers
After converting the driver to mipi_dsi_device we can use the generic message helpers to simplify the driver a lot. Signed-off-by: Sebastian Reichel --- .../gpu/drm/omapdrm/displays/panel-dsi-cm.c | 126 +++--- 1 file changed, 18 insertions(+), 108 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index c34daecb1de5..4a4a55135494 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -138,62 +138,22 @@ static void hw_guard_wait(struct panel_drv_data *ddata) static int dsicm_dcs_read_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 *data) { - struct mipi_dsi_device *dsi = ddata->dsi; - const struct mipi_dsi_msg msg = { - .channel = ddata->channel, - .type = MIPI_DSI_DCS_READ, - .tx_len = 1, - .tx_buf = &dcs_cmd, - .rx_len = 1, - .rx_buf = data - }; - - return dsi->host->ops->transfer(dsi->host, &msg); -} - -static int dsicm_dcs_write_0(struct panel_drv_data *ddata, u8 dcs_cmd) -{ - struct mipi_dsi_device *dsi = ddata->dsi; - const struct mipi_dsi_msg msg = { - .channel = ddata->channel, - .type = MIPI_DSI_DCS_SHORT_WRITE, - .tx_buf = &dcs_cmd, - .tx_len = 1, - }; - - return dsi->host->ops->transfer(dsi->host, &msg); + return mipi_dsi_dcs_read(ddata->dsi, dcs_cmd, data, 1); } static int dsicm_dcs_write_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 param) { - struct mipi_dsi_device *dsi = ddata->dsi; - const u8 buf[] = { dcs_cmd, param }; - const struct mipi_dsi_msg msg = { - .channel = ddata->channel, - .type = MIPI_DSI_DCS_SHORT_WRITE_PARAM, - .tx_buf = &buf, - .tx_len = 2, - }; - - return dsi->host->ops->transfer(dsi->host, &msg); + return mipi_dsi_dcs_write(ddata->dsi, dcs_cmd, ¶m, 1); } static int dsicm_sleep_in(struct panel_drv_data *ddata) { - struct mipi_dsi_device *dsi = ddata->dsi; int r; - const u8 cmd = MIPI_DCS_ENTER_SLEEP_MODE; - const struct mipi_dsi_msg msg = { - .channel = ddata->channel, - .type = MIPI_DSI_DCS_SHORT_WRITE, - .tx_buf = &cmd, - .tx_len = 1, - }; hw_guard_wait(ddata); - r = dsi->host->ops->transfer(dsi->host, &msg); + r = mipi_dsi_dcs_enter_sleep_mode(ddata->dsi); if (r) return r; @@ -210,7 +170,7 @@ static int dsicm_sleep_out(struct panel_drv_data *ddata) hw_guard_wait(ddata); - r = dsicm_dcs_write_0(ddata, MIPI_DCS_EXIT_SLEEP_MODE); + r = mipi_dsi_dcs_exit_sleep_mode(ddata->dsi); if (r) return r; @@ -248,46 +208,15 @@ static int dsicm_set_update_window(struct panel_drv_data *ddata, u16 y1 = y; u16 y2 = y + h - 1; - const u8 paramX[] = { - MIPI_DCS_SET_COLUMN_ADDRESS, - (x1 >> 8) & 0xff, - (x1 >> 0) & 0xff, - (x2 >> 8) & 0xff, - (x2 >> 0) & 0xff, - }; - - const struct mipi_dsi_msg msgX = { - .channel = ddata->channel, - .type = MIPI_DSI_GENERIC_LONG_WRITE, - .tx_buf = paramX, - .tx_len = 5, - }; - - const u8 paramY[] = { - MIPI_DCS_SET_PAGE_ADDRESS, - (y1 >> 8) & 0xff, - (y1 >> 0) & 0xff, - (y2 >> 8) & 0xff, - (y2 >> 0) & 0xff, - }; - - const struct mipi_dsi_msg msgY = { - .channel = ddata->channel, - .type = MIPI_DSI_GENERIC_LONG_WRITE, - .tx_buf = paramY, - .tx_len = 5, - }; - - - r = dsi->host->ops->transfer(dsi->host, &msgX); - if (r) + r = mipi_dsi_dcs_set_column_address(dsi, x1, x2); + if (r < 0) return r; - r = dsi->host->ops->transfer(dsi->host, &msgY); - if (r) + r = mipi_dsi_dcs_set_page_address(dsi, y1, y2); + if (r < 0) return r; - return r; + return 0; } static void dsicm_queue_ulps_work(struct panel_drv_data *ddata) @@ -681,12 +610,11 @@ static int dsicm_power_on(struct panel_drv_data *ddata) if (r) goto err; - r = dsicm_dcs_write_1(ddata, MIPI_DCS_SET_PIXEL_FORMAT, - MIPI_DCS_PIXEL_FMT_24BIT); + r = mipi_dsi_dcs_set_pixel_format(ddata->dsi, MIPI_DCS_PIXEL_FMT_24BIT); if (r) goto err; - r = dsicm_dcs_write_0(ddata, MIPI_DCS_SET_DISPLAY_ON); + r = mipi_dsi_dcs_set_display_on(ddata->dsi); if (r) goto err; @@ -732,7 +660,7 @@ static void dsicm_power_off(struct panel_drv_data *ddata) src->ops->dsi.d
[PATCHv2 49/56] drm/omap: drop unused DSS next pointer
Since all encoders and panels are using the bridge API now, we next pointer is no longer useful and can be dropped. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/dss/base.c | 2 +- drivers/gpu/drm/omapdrm/dss/omapdss.h | 1 - drivers/gpu/drm/omapdrm/dss/output.c | 13 + drivers/gpu/drm/omapdrm/omap_encoder.c | 4 4 files changed, 2 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/base.c b/drivers/gpu/drm/omapdrm/dss/base.c index c2791305c332..d62713b241d2 100644 --- a/drivers/gpu/drm/omapdrm/dss/base.c +++ b/drivers/gpu/drm/omapdrm/dss/base.c @@ -135,7 +135,7 @@ struct omap_dss_device *omapdss_device_next_output(struct omap_dss_device *from) goto done; } - if (dssdev->id && (dssdev->next || dssdev->bridge)) + if (dssdev->id && (dssdev->bridge)) goto done; } diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index 325a89d802e2..03498f0ed6c2 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -292,7 +292,6 @@ struct omap_dss_device { struct module *owner; struct dss_device *dss; - struct omap_dss_device *next; struct drm_bridge *bridge; struct drm_bridge *next_bridge; struct drm_panel *panel; diff --git a/drivers/gpu/drm/omapdrm/dss/output.c b/drivers/gpu/drm/omapdrm/dss/output.c index ce21c798cca6..40cb353572f6 100644 --- a/drivers/gpu/drm/omapdrm/dss/output.c +++ b/drivers/gpu/drm/omapdrm/dss/output.c @@ -30,7 +30,6 @@ int omapdss_device_init_output(struct omap_dss_device *out, return 0; } - out->next = omapdss_find_device_by_node(remote_node); out->bridge = of_drm_find_bridge(remote_node); out->panel = of_drm_find_panel(remote_node); if (IS_ERR(out->panel)) @@ -38,12 +37,6 @@ int omapdss_device_init_output(struct omap_dss_device *out, of_node_put(remote_node); - if (out->next && out->type != out->next->type) { - dev_err(out->dev, "output type and display type don't match\n"); - ret = -EINVAL; - goto error; - } - if (out->panel) { struct drm_bridge *bridge; @@ -69,7 +62,7 @@ int omapdss_device_init_output(struct omap_dss_device *out, out->bridge = local_bridge; } - if (!out->next && !out->bridge) { + if (!out->bridge) { ret = -EPROBE_DEFER; goto error; } @@ -78,7 +71,6 @@ int omapdss_device_init_output(struct omap_dss_device *out, error: omapdss_device_cleanup_output(out); - out->next = NULL; return ret; } EXPORT_SYMBOL(omapdss_device_init_output); @@ -88,9 +80,6 @@ void omapdss_device_cleanup_output(struct omap_dss_device *out) if (out->bridge && out->panel) drm_panel_bridge_remove(out->next_bridge ? out->next_bridge : out->bridge); - - if (out->next) - omapdss_device_put(out->next); } EXPORT_SYMBOL(omapdss_device_cleanup_output); diff --git a/drivers/gpu/drm/omapdrm/omap_encoder.c b/drivers/gpu/drm/omapdrm/omap_encoder.c index 610c5a2f2771..5f5fa01240a7 100644 --- a/drivers/gpu/drm/omapdrm/omap_encoder.c +++ b/drivers/gpu/drm/omapdrm/omap_encoder.c @@ -75,7 +75,6 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder, { struct omap_encoder *omap_encoder = to_omap_encoder(encoder); struct omap_dss_device *output = omap_encoder->output; - struct omap_dss_device *dssdev; struct drm_device *dev = encoder->dev; struct drm_connector *connector; struct drm_bridge *bridge; @@ -98,9 +97,6 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder, * * A better solution is to use DRM's bus-flags through the whole driver. */ - for (dssdev = output; dssdev; dssdev = dssdev->next) - omap_encoder_update_videomode_flags(&vm, dssdev->bus_flags); - for (bridge = output->bridge; bridge; bridge = drm_bridge_get_next_bridge(bridge)) { if (!bridge->timings) -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCHv3 2/2] drm/panel: add support for rm69299 visionox panel driver
On Wed 05 Feb 05:06 PST 2020, Harigovindan P wrote: > Add support for Visionox panel driver. > > Signed-off-by: Harigovindan P > --- > > Changes in v1: > - Split out panel driver patch from dsi config changes(Rob Clark). > - Remove unrelated code(Stephen Boyd). > - Remove static arrays to make regulator setup open coded > in probe(Stephen Boyd). > - Remove pre-assigning variables(Stephen Boyd). > - Inline panel_add function into probe(Stephen Boyd). > - Use mipi_dsi_dcs_write directly(Rob Clark). > - Remove qcom_rm69299_1080p_panel_magic_cmds array(Rob Clark). > Changes in v2: > - Dropping redundant space in Kconfig(Sam Ravnborg). > - Changing structure for include files(Sam Ravnborg). > - Removing backlight related code and functions(Sam Ravnborg). > - Removing repeated printing of error message(Sam Ravnborg). > - Adding drm_connector as an argument for get_modes function. > Changes in v3: > - Adding arguments for drm_panel_init to support against mainline. > > drivers/gpu/drm/panel/Kconfig | 8 + > drivers/gpu/drm/panel/Makefile | 1 + > drivers/gpu/drm/panel/panel-visionox-rm69299.c | 371 > + > 3 files changed, 380 insertions(+) > create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c > > diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig > index 04225a8..354a3a5 100644 > --- a/drivers/gpu/drm/panel/Kconfig > +++ b/drivers/gpu/drm/panel/Kconfig > @@ -407,6 +407,14 @@ config DRM_PANEL_TRULY_NT35597_WQXGA > Say Y here if you want to enable support for Truly NT35597 WQXGA Dual > DSI > Video Mode panel > > +config DRM_PANEL_VISIONOX_RM69299 > + tristate "Visionox RM69299" > + depends on OF > + depends on DRM_MIPI_DSI > + help > + Say Y here if you want to enable support for Visionox > + RM69299 DSI Video Mode panel. > + > config DRM_PANEL_XINPENG_XPP055C272 > tristate "Xinpeng XPP055C272 panel driver" > depends on OF > diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile > index 801f9f6..b7ae 100644 > --- a/drivers/gpu/drm/panel/Makefile > +++ b/drivers/gpu/drm/panel/Makefile > @@ -43,4 +43,5 @@ obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += > panel-tpo-td028ttec1.o > obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o > obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o > obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o > +obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) += panel-visionox-rm69299.o > obj-$(CONFIG_DRM_PANEL_XINPENG_XPP055C272) += panel-xinpeng-xpp055c272.o > diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c > b/drivers/gpu/drm/panel/panel-visionox-rm69299.c > new file mode 100644 > index 000..7195ab0 > --- /dev/null > +++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c > @@ -0,0 +1,371 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyright (c) 2019, The Linux Foundation. All rights reserved. > + */ > + > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +#include > +#include > +#include > +#include > + > +struct rm69299_config { > + unsigned long width_mm; > + unsigned long height_mm; > + const char *panel_name; > + u32 num_on_cmds; > + const struct drm_display_mode *dm; > +}; > + > +struct visionox_rm69299 { > + struct device *dev; You also store dev in panel.dev, why not just use that? > + struct drm_panel panel; > + > + struct regulator_bulk_data supplies[2]; > + > + struct gpio_desc *reset_gpio; > + > + struct mipi_dsi_device *dsi; > + const struct rm69299_config *config; > + bool prepared; > + bool enabled; > +}; > + > +static inline struct visionox_rm69299 *panel_to_ctx(struct drm_panel *panel) > +{ > + return container_of(panel, struct visionox_rm69299, panel); > +} > + > +static int visionox_35597_power_on(struct visionox_rm69299 *ctx) > +{ > + int ret; > + > + ret = regulator_set_load(ctx->supplies[0].consumer, 32000); > + if (ret) > + return ret; > + > + ret = regulator_set_load(ctx->supplies[1].consumer, 13200); > + if (ret) > + return ret; > + > + ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies); > + if (ret < 0) > + return ret; > + > + /* > + * Reset sequence of visionox panel requires the panel to be > + * out of reset for 10ms, followed by being held in reset > + * for 10ms and then out again > + */ > + gpiod_set_value(ctx->reset_gpio, 1); > + usleep_range(1, 2); > + gpiod_set_value(ctx->reset_gpio, 0); > + usleep_range(1, 2); > + gpiod_set_value(ctx->reset_gpio, 1); > + usleep_range(1, 2); > + > + return 0; > +} > + > +static int visionox_rm69299_power_off(struct visionox_rm69299 *ctx) > +{ >
[PATCH 7/7] drm/sun4i: Sort includes in VI and UI layer code
sun8i_mixer.h include is misplaced. Move it. Signed-off-by: Jernej Skrabec --- drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 2 +- drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c index a64aaea1ba74..54f937a7d5e7 100644 --- a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c +++ b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c @@ -19,8 +19,8 @@ #include #include -#include "sun8i_ui_layer.h" #include "sun8i_mixer.h" +#include "sun8i_ui_layer.h" #include "sun8i_ui_scaler.h" static void sun8i_ui_layer_enable(struct sun8i_mixer *mixer, int channel, diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c index b1e1ba2da663..22c8c5375d0d 100644 --- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c +++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c @@ -13,8 +13,8 @@ #include #include "sun8i_csc.h" -#include "sun8i_vi_layer.h" #include "sun8i_mixer.h" +#include "sun8i_vi_layer.h" #include "sun8i_vi_scaler.h" static void sun8i_vi_layer_enable(struct sun8i_mixer *mixer, int channel, -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 30/56] drm/dsi: add MIPI_DSI_MODE_ULPS_IDLE
DSI command mode panels are self-refreshing displays, that can be updated very rarely for static images. For this kind of scenario some panels support, that the DSI bus switches into ULPS mode until the panel needs to be refreshed. This is problematic on some panels, so introduce a flag to signal the DSI host implementation that the panel allows going into ULPS mode. Signed-off-by: Sebastian Reichel --- include/drm/drm_mipi_dsi.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index 360e6377e84b..f36f89c14b4a 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h @@ -132,6 +132,8 @@ struct mipi_dsi_host *of_find_mipi_dsi_host_by_node(struct device_node *node); #define MIPI_DSI_CLOCK_NON_CONTINUOUS BIT(10) /* transmit data in low power */ #define MIPI_DSI_MODE_LPM BIT(11) +/* allow going into ULPS mode while command mode panel is not updated */ +#define MIPI_DSI_MODE_ULPS_IDLEBIT(12) enum mipi_dsi_pixel_format { MIPI_DSI_FMT_RGB888, -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 40/56] drm/omap: panel-dsi-cm: fix remove()
Do not try to reset the panel after DSI has been detached, since the DSI clocks may have been disabled at this point. The panel will be disabled and unprepared before being removed and a reset will be done when being probed again. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 8562f056585d..fef9ba5319c2 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -627,9 +627,6 @@ static int dsicm_remove(struct mipi_dsi_device *dsi) if (ddata->extbldev) put_device(&ddata->extbldev->dev); - /* reset, to be sure that the panel is in a valid state */ - dsicm_hw_reset(ddata); - return 0; } -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 1/3] drm/omap: Prepare DSS for probing without legacy platform data
* Sebastian Reichel [200224 23:32]: > Hi, > > On Mon, Feb 24, 2020 at 11:12:28AM -0800, Tony Lindgren wrote: > > In order to probe display subsystem (DSS) components with ti-sysc > > interconnect target module without legacy platform data and using > > devicetree, we need to update dss probing a bit. > > > > In the device tree, we will be defining the data also for the interconnect > > target modules as DSS really is a private interconnect. There is some > > information about that in 4460 TRM in "Figure 10-3. DSS Integration" for > > example where it mentions "32-bit interconnect (SLX)". > > > > The changes we need to make are: > > > > 1. Parse also device tree subnodes for the compatible property fixup > > > > 2. Update the component code to consider device tree subnodes > > > > Cc: dri-devel@lists.freedesktop.org > > Cc: Jyri Sarha > > Cc: Laurent Pinchart > > Cc: Tomi Valkeinen > > Signed-off-by: Tony Lindgren > > --- > > > > This is needed for dropping DSS platform data that I'll be posting > > seprately. If this looks OK, can you guys please test and ack? > > > > --- > > Reviewed-by: Sebastian Reichel > > FWIW, I dropped omapdss-boot-init.c in my patch series updating DSI > code to use common panel infrastructure, so this will conflict. Hey that's great :) Sounds like we can set up an immutable branch for just this $subject patch against v5.6-rc1 to resolve the conflict. I can set it up for Tomi or Tomi can set it up for me, whichever Tomi prefers. Regards, Tony ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 27/56] drm/omap: dsi: drop custom enable_te() API
Instead of using the custon enable_te() API, this automatically enables/disables TE core support when a matching packet is send to the panel. Signed-off-by: Sebastian Reichel --- .../gpu/drm/omapdrm/displays/panel-dsi-cm.c | 3 -- drivers/gpu/drm/omapdrm/dss/dsi.c | 33 ++- drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 -- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 30e48d0de961..e4ffe34324f8 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -772,7 +772,6 @@ static int dsicm_update(struct omap_dss_device *dssdev, static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable) { - struct omap_dss_device *src = ddata->src; struct mipi_dsi_device *dsi = ddata->dsi; int r; @@ -781,8 +780,6 @@ static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable) else r = mipi_dsi_dcs_set_tear_off(dsi); - src->ops->dsi.enable_te(src, enable); - /* possible panel bug */ msleep(100); diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index 7c160512c886..50a567ebfb86 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -4117,10 +4117,8 @@ static void dsi_display_disable(struct omap_dss_device *dssdev, mutex_unlock(&dsi->lock); } -static int dsi_enable_te(struct omap_dss_device *dssdev, bool enable) +static int dsi_enable_te(struct dsi_data *dsi, bool enable) { - struct dsi_data *dsi = to_dsi_data(dssdev); - dsi->te_enabled = enable; if (dsi->te_gpio) { @@ -4730,6 +4728,7 @@ static ssize_t omap_dsi_host_transfer(struct mipi_dsi_host *host, { struct dsi_data *dsi = host_to_omap(host); struct omap_dss_device *dssdev = &dsi->output; + int r; if (NEQV(msg->flags & MIPI_DSI_MSG_USE_LPM, dsi->in_lp_mode)) { dsi_vc_enable_hs(dssdev, msg->channel, @@ -4746,16 +4745,34 @@ static ssize_t omap_dsi_host_transfer(struct mipi_dsi_host *host, case MIPI_DSI_DCS_LONG_WRITE: case MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE: case MIPI_DSI_NULL_PACKET: - return dsi_vc_write_common(dssdev, msg); + r = dsi_vc_write_common(dssdev, msg); + break; case MIPI_DSI_GENERIC_READ_REQUEST_0_PARAM: case MIPI_DSI_GENERIC_READ_REQUEST_1_PARAM: case MIPI_DSI_GENERIC_READ_REQUEST_2_PARAM: - return dsi_vc_generic_read(dssdev, msg); + r = dsi_vc_generic_read(dssdev, msg); + break; case MIPI_DSI_DCS_READ: - return dsi_vc_dcs_read(dssdev, msg); + r = dsi_vc_dcs_read(dssdev, msg); + break; + default: + r = -EINVAL; + break; } - return -EINVAL; + if (r < 0) + return r; + + if (msg->type == MIPI_DSI_DCS_SHORT_WRITE || + msg->type == MIPI_DSI_DCS_SHORT_WRITE_PARAM) { + u8 cmd = ((u8*) msg->tx_buf)[0]; + if (cmd == MIPI_DCS_SET_TEAR_OFF) + dsi_enable_te(dsi, false); + else if(cmd == MIPI_DCS_SET_TEAR_ON) + dsi_enable_te(dsi, true); + } + + return 0; } static int dsi_get_clocks(struct dsi_data *dsi) @@ -4802,8 +4819,6 @@ static const struct omap_dss_device_ops dsi_ops = { .disable_video_output = dsi_disable_video_output, .update = dsi_update, - - .enable_te = dsi_enable_te, }, }; diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index 355aa235c23c..dc41f982a082 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -287,8 +287,6 @@ struct omapdss_dsi_ops { int (*set_config)(struct omap_dss_device *dssdev, const struct omap_dss_dsi_config *cfg); - int (*enable_te)(struct omap_dss_device *dssdev, bool enable); - int (*update)(struct omap_dss_device *dssdev, int channel, void (*callback)(int, void *), void *data); -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 12/56] drm/omap: dsi: simplify read functions
Simplify the read related message handling by using the functionality provided by CONFIG_DRM_MIPI_DSI. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/dss/dsi.c | 109 +- 1 file changed, 33 insertions(+), 76 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index e5589e615808..9b5b078beb6d 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -2741,60 +2741,6 @@ static int dsi_vc_write_common(struct omap_dss_device *dssdev, return 0; } -static int dsi_vc_dcs_send_read_request(struct dsi_data *dsi, int channel, - u8 dcs_cmd) -{ - int r; - - if (dsi->debug_read) - DSSDBG("dsi_vc_dcs_send_read_request(ch%d, dcs_cmd %x)\n", - channel, dcs_cmd); - - r = dsi_vc_send_short(dsi, channel, MIPI_DSI_DCS_READ, dcs_cmd, 0); - if (r) { - DSSERR("dsi_vc_dcs_send_read_request(ch %d, cmd 0x%02x)" - " failed\n", channel, dcs_cmd); - return r; - } - - return 0; -} - -static int dsi_vc_generic_send_read_request(struct dsi_data *dsi, int channel, - const u8 *reqdata, int reqlen) -{ - u16 data; - u8 data_type; - int r; - - if (dsi->debug_read) - DSSDBG("dsi_vc_generic_send_read_request(ch %d, reqlen %d)\n", - channel, reqlen); - - if (reqlen == 0) { - data_type = MIPI_DSI_GENERIC_READ_REQUEST_0_PARAM; - data = 0; - } else if (reqlen == 1) { - data_type = MIPI_DSI_GENERIC_READ_REQUEST_1_PARAM; - data = reqdata[0]; - } else if (reqlen == 2) { - data_type = MIPI_DSI_GENERIC_READ_REQUEST_2_PARAM; - data = reqdata[0] | (reqdata[1] << 8); - } else { - BUG(); - return -EINVAL; - } - - r = dsi_vc_send_short(dsi, channel, data_type, data, 0); - if (r) { - DSSERR("dsi_vc_generic_send_read_request(ch %d, reqlen %d)" - " failed\n", channel, reqlen); - return r; - } - - return 0; -} - static int dsi_vc_read_rx_fifo(struct dsi_data *dsi, int channel, u8 *buf, int buflen, enum dss_dsi_content_type type) { @@ -2903,61 +2849,75 @@ static int dsi_vc_read_rx_fifo(struct dsi_data *dsi, int channel, u8 *buf, return r; } -static int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, - u8 *buf, int buflen) +static int dsi_vc_dcs_read(struct omap_dss_device *dssdev, + const struct mipi_dsi_msg *msg) { struct dsi_data *dsi = to_dsi_data(dssdev); int r; + u8 dcs_cmd = ((u8*) msg->tx_buf)[0]; - r = dsi_vc_dcs_send_read_request(dsi, channel, dcs_cmd); + r = dsi_vc_send_short(dsi, msg->channel, MIPI_DSI_DCS_READ, dcs_cmd, 0); if (r) goto err; - r = dsi_vc_send_bta_sync(dssdev, channel); + r = dsi_vc_send_bta_sync(dssdev, msg->channel); if (r) goto err; - r = dsi_vc_read_rx_fifo(dsi, channel, buf, buflen, + r = dsi_vc_read_rx_fifo(dsi, msg->channel, msg->rx_buf, msg->rx_len, DSS_DSI_CONTENT_DCS); if (r < 0) goto err; - if (r != buflen) { + if (r != msg->rx_len) { r = -EIO; goto err; } return 0; err: - DSSERR("dsi_vc_dcs_read(ch %d, cmd 0x%02x) failed\n", channel, dcs_cmd); + DSSERR("dsi_vc_dcs_read(ch %d, cmd 0x%02x) failed\n", + msg->channel, dcs_cmd); return r; } -static int dsi_vc_generic_read(struct omap_dss_device *dssdev, int channel, - const u8 *reqdata, int reqlen, u8 *buf, int buflen) +static int dsi_vc_generic_read(struct omap_dss_device *dssdev, + const struct mipi_dsi_msg *msg) { struct dsi_data *dsi = to_dsi_data(dssdev); + struct mipi_dsi_packet packet; + u16 data; int r; - r = dsi_vc_generic_send_read_request(dsi, channel, reqdata, reqlen); + r = mipi_dsi_create_packet(&packet, msg); + if (r < 0) + goto err; + + data = packet.header[1] | (packet.header[2] << 8); + + r = dsi_vc_send_short(dsi, msg->channel, msg->type, data, 0); if (r) - return r; + goto err; - r = dsi_vc_send_bta_sync(dssdev, channel); + r = dsi_vc_send_bta_sync(dssdev, msg->channel); if (r) - return r; + goto err; - r = dsi_vc_read_rx_fifo(dsi, channel, buf, buflen, + r = dsi_vc_read_rx_fifo(dsi, msg->channel, msg->rx_buf, msg->rx_len, DSS_DSI_CONTENT_GENERIC); if (r < 0) -
[PATCHv2 54/56] ARM: omap2plus_defconfig: Update for moved DSI command mode panel
The DSI command mode panel is no longer specific to OMAP and thus the config option has been renamed slightly. Signed-off-by: Sebastian Reichel --- arch/arm/configs/omap2plus_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig index b9698e217aa7..31ac2315f47c 100644 --- a/arch/arm/configs/omap2plus_defconfig +++ b/arch/arm/configs/omap2plus_defconfig @@ -350,7 +350,7 @@ CONFIG_DRM_OMAP=m CONFIG_OMAP5_DSS_HDMI=y CONFIG_OMAP2_DSS_SDI=y CONFIG_OMAP2_DSS_DSI=y -CONFIG_DRM_OMAP_PANEL_DSI_CM=m +CONFIG_DRM_PANEL_DSI_CM=m CONFIG_DRM_TILCDC=m CONFIG_DRM_PANEL_SIMPLE=m CONFIG_DRM_DISPLAY_CONNECTOR=m -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 44/56] drm/panel: Move OMAP's DSI command mode panel driver
The panel driver is no longer using any OMAP specific APIs, so let's move it into the generic panel directory. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/Kconfig| 1 - drivers/gpu/drm/omapdrm/Makefile | 1 - drivers/gpu/drm/omapdrm/displays/Kconfig | 10 -- drivers/gpu/drm/omapdrm/displays/Makefile | 2 -- drivers/gpu/drm/panel/Kconfig | 9 + drivers/gpu/drm/panel/Makefile | 1 + .../gpu/drm/{omapdrm/displays => panel}/panel-dsi-cm.c | 0 7 files changed, 10 insertions(+), 14 deletions(-) delete mode 100644 drivers/gpu/drm/omapdrm/displays/Kconfig delete mode 100644 drivers/gpu/drm/omapdrm/displays/Makefile rename drivers/gpu/drm/{omapdrm/displays => panel}/panel-dsi-cm.c (100%) diff --git a/drivers/gpu/drm/omapdrm/Kconfig b/drivers/gpu/drm/omapdrm/Kconfig index 5417e7a47072..cea3f44ea6d4 100644 --- a/drivers/gpu/drm/omapdrm/Kconfig +++ b/drivers/gpu/drm/omapdrm/Kconfig @@ -12,6 +12,5 @@ config DRM_OMAP if DRM_OMAP source "drivers/gpu/drm/omapdrm/dss/Kconfig" -source "drivers/gpu/drm/omapdrm/displays/Kconfig" endif diff --git a/drivers/gpu/drm/omapdrm/Makefile b/drivers/gpu/drm/omapdrm/Makefile index f115253115c5..66a73eae6f7c 100644 --- a/drivers/gpu/drm/omapdrm/Makefile +++ b/drivers/gpu/drm/omapdrm/Makefile @@ -5,7 +5,6 @@ # obj-y += dss/ -obj-y += displays/ omapdrm-y := omap_drv.o \ omap_irq.o \ diff --git a/drivers/gpu/drm/omapdrm/displays/Kconfig b/drivers/gpu/drm/omapdrm/displays/Kconfig deleted file mode 100644 index f2be594c7eff.. --- a/drivers/gpu/drm/omapdrm/displays/Kconfig +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only -menu "OMAPDRM External Display Device Drivers" - -config DRM_OMAP_PANEL_DSI_CM - tristate "Generic DSI Command Mode Panel" - depends on BACKLIGHT_CLASS_DEVICE - help - Driver for generic DSI command mode panels. - -endmenu diff --git a/drivers/gpu/drm/omapdrm/displays/Makefile b/drivers/gpu/drm/omapdrm/displays/Makefile deleted file mode 100644 index 488ddf153613.. --- a/drivers/gpu/drm/omapdrm/displays/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -obj-$(CONFIG_DRM_OMAP_PANEL_DSI_CM) += panel-dsi-cm.o diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index da3b84602cdd..07ab75a66607 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -38,6 +38,15 @@ config DRM_PANEL_BOE_TV101WUM_NL6 Say Y here if you want to support for BOE TV101WUM and AUO KD101N80 45NA WUXGA PANEL DSI Video Mode panel +config DRM_PANEL_DSI_CM + tristate "Generic DSI command mode panels" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + help + DRM panel driver for DSI command mode panels with support for + embedded and external backlights. + config DRM_PANEL_LVDS tristate "Generic LVDS panel driver" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index af1e2a3cc5fc..bb19cda8a619 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -2,6 +2,7 @@ obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o obj-$(CONFIG_DRM_PANEL_BOE_TV101WUM_NL6) += panel-boe-tv101wum-nl6.o +obj-$(CONFIG_DRM_PANEL_DSI_CM) += panel-dsi-cm.o obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o obj-$(CONFIG_DRM_PANEL_FEIXIN_K101_IM2BA02) += panel-feixin-k101-im2ba02.o diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/panel/panel-dsi-cm.c similarity index 100% rename from drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c rename to drivers/gpu/drm/panel/panel-dsi-cm.c -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 2/3] bus: ti-sysc: Detect display subsystem related devices
In order to prepare probing display subsystem (DSS) with ti-sysc interconnect target module driver and device tree data, let's detect DSS related modules. We need to also add reset quirk handling for DSS, but until that's done, let's just enable the optional clock quirks for DSS and omap4 HDMI. The rest is just naming of modules if CONFIG_DEBUG is set. Cc: Jyri Sarha Cc: Laurent Pinchart Cc: Tomi Valkeinen Signed-off-by: Tony Lindgren --- drivers/bus/ti-sysc.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -1302,10 +1302,18 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { SYSC_MODULE_QUIRK_AESS), SYSC_QUIRK("dcan", 0x4848, 0x20, -ENODEV, -ENODEV, 0xa3170504, 0x, SYSC_QUIRK_CLKDM_NOAUTO), + SYSC_QUIRK("dss", 0x4832a000, 0, 0x10, 0x14, 0x0020, 0x, + SYSC_QUIRK_OPT_CLKS_IN_RESET), + SYSC_QUIRK("dss", 0x5800, 0, -ENODEV, 0x14, 0x0040, 0x, + SYSC_QUIRK_OPT_CLKS_IN_RESET), + SYSC_QUIRK("dss", 0x5800, 0, -ENODEV, 0x14, 0x0061, 0x, + SYSC_QUIRK_OPT_CLKS_IN_RESET), SYSC_QUIRK("dwc3", 0x4888, 0, 0x10, -ENODEV, 0x500a0200, 0x, SYSC_QUIRK_CLKDM_NOAUTO), SYSC_QUIRK("dwc3", 0x488c, 0, 0x10, -ENODEV, 0x500a0200, 0x, SYSC_QUIRK_CLKDM_NOAUTO), + SYSC_QUIRK("hdmi", 0, 0, 0x10, -ENODEV, 0x50030200, 0x, + SYSC_QUIRK_OPT_CLKS_NEEDED), SYSC_QUIRK("hdq1w", 0, 0, 0x14, 0x18, 0x0006, 0x, SYSC_MODULE_QUIRK_HDQ1W), SYSC_QUIRK("hdq1w", 0, 0, 0x14, 0x18, 0x000a, 0x, @@ -1342,13 +1350,21 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { 0x00f0, 0), SYSC_QUIRK("dcan", 0, 0x20, -ENODEV, -ENODEV, 0xa3170504, 0x, 0), SYSC_QUIRK("dcan", 0, 0x20, -ENODEV, -ENODEV, 0x4edb1902, 0x, 0), + SYSC_QUIRK("dispc", 0x4832a400, 0, 0x10, 0x14, 0x0030, 0x, 0), + SYSC_QUIRK("dispc", 0x58001000, 0, 0x10, 0x14, 0x0040, 0x, 0), + SYSC_QUIRK("dispc", 0x58001000, 0, 0x10, 0x14, 0x0051, 0x, 0), SYSC_QUIRK("dmic", 0, 0, 0x10, -ENODEV, 0x5001, 0x, 0), + SYSC_QUIRK("dsi", 0x58004000, 0, 0x10, 0x14, 0x0030, 0x, 0), + SYSC_QUIRK("dsi", 0x58005000, 0, 0x10, 0x14, 0x0030, 0x, 0), + SYSC_QUIRK("dsi", 0x58005000, 0, 0x10, 0x14, 0x0040, 0x, 0), + SYSC_QUIRK("dsi", 0x58009000, 0, 0x10, 0x14, 0x0040, 0x, 0), SYSC_QUIRK("dwc3", 0, 0, 0x10, -ENODEV, 0x500a0200, 0x, 0), SYSC_QUIRK("d2d", 0x4a0b6000, 0, 0x10, 0x14, 0x0010, 0x, 0), SYSC_QUIRK("d2d", 0x4a0cd000, 0, 0x10, 0x14, 0x0010, 0x, 0), SYSC_QUIRK("epwmss", 0, 0, 0x4, -ENODEV, 0x4741, 0x, 0), SYSC_QUIRK("gpu", 0, 0x1fc00, 0x1fc10, -ENODEV, 0, 0, 0), SYSC_QUIRK("gpu", 0, 0xfe00, 0xfe10, -ENODEV, 0x4000 , 0x, 0), + SYSC_QUIRK("hdmi", 0, 0, 0x10, -ENODEV, 0x50031d00, 0x, 0), SYSC_QUIRK("hsi", 0, 0, 0x10, 0x14, 0x50043101, 0x, 0), SYSC_QUIRK("iss", 0, 0, 0x10, -ENODEV, 0x4101, 0x, 0), SYSC_QUIRK("lcdc", 0, 0, 0x54, -ENODEV, 0x4f201000, 0x, 0), @@ -1366,6 +1382,8 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { SYSC_QUIRK("prcm", 0, 0, -ENODEV, -ENODEV, 0x4100, 0x, 0), SYSC_QUIRK("prcm", 0, 0, -ENODEV, -ENODEV, 0x4102, 0x, 0), SYSC_QUIRK("prcm", 0, 0, -ENODEV, -ENODEV, 0x4400, 0x, 0), + SYSC_QUIRK("rfbi", 0x4832a800, 0, 0x10, 0x14, 0x0010, 0x, 0), + SYSC_QUIRK("rfbi", 0x58002000, 0, 0x10, 0x14, 0x0010, 0x, 0), SYSC_QUIRK("scm", 0, 0, 0x10, -ENODEV, 0x4900, 0x, 0), SYSC_QUIRK("scm", 0, 0, -ENODEV, -ENODEV, 0x4e8b0100, 0x, 0), SYSC_QUIRK("scm", 0, 0, -ENODEV, -ENODEV, 0x4f000100, 0x, 0), @@ -1383,6 +1401,7 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { SYSC_QUIRK("usbhstll", 0, 0, 0x10, 0x14, 0x0008, 0x, 0), SYSC_QUIRK("usb_host_hs", 0, 0, 0x10, 0x14, 0x50700100, 0x, 0), SYSC_QUIRK("usb_host_hs", 0, 0, 0x10, -ENODEV, 0x50700101, 0x, 0), + SYSC_QUIRK("venc", 0x58003000, 0, -ENODEV, -ENODEV, 0x0002, 0x, 0), SYSC_QUIRK("vfpe", 0, 0, 0x104, -ENODEV, 0x4d001200, 0x, 0), #endif }; -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 22/89] clk: bcm: rpi: Discover the firmware clocks
On 2/24/20 1:06 AM, Maxime Ripard wrote: > The firmware has an interface to discover the clocks it exposes. > > Let's use it to discover, register the clocks in the clocks framework and > then expose them through the device tree for consumers to use them. > > Cc: Michael Turquette > Cc: Stephen Boyd > Cc: linux-...@vger.kernel.org > Signed-off-by: Maxime Ripard That seems like a re-implementaiton of SCMI without all of its protocols, without being able to use the existing drivers, maybe a firmware update should be considered so standard drivers can be leveraged? -- Florian ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 16/56] drm/omap: dsi: request VC via mipi_dsi_attach
Drop custom request_vc/release_vc callbacks by using the generic mipi_dsi_attach/mipi_dsi_detach functions. Signed-off-by: Sebastian Reichel --- .../gpu/drm/omapdrm/displays/panel-dsi-cm.c | 24 +--- drivers/gpu/drm/omapdrm/dss/dsi.c | 61 --- drivers/gpu/drm/omapdrm/dss/omapdss.h | 3 - 3 files changed, 41 insertions(+), 47 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 4a4a55135494..b3688a8ca3cf 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -693,14 +693,6 @@ static int dsicm_connect(struct omap_dss_device *src, struct omap_dss_device *dst) { struct panel_drv_data *ddata = to_panel_data(dst); - struct device *dev = &ddata->dsi->dev; - int r; - - r = src->ops->dsi.request_vc(src, ddata->channel); - if (r) { - dev_err(dev, "failed to get virtual channel\n"); - return r; - } ddata->src = src; return 0; @@ -711,7 +703,6 @@ static void dsicm_disconnect(struct omap_dss_device *src, { struct panel_drv_data *ddata = to_panel_data(dst); - src->ops->dsi.release_vc(src, ddata->channel); ddata->src = NULL; } @@ -1278,8 +1269,21 @@ static int dsicm_probe(struct mipi_dsi_device *dsi) goto err_bl; } + dsi->lanes = 3; + dsi->format = MIPI_DSI_FMT_RGB888; + dsi->mode_flags = MIPI_DSI_CLOCK_NON_CONTINUOUS | + MIPI_DSI_MODE_EOT_PACKET; + dsi->hs_rate = 3; + dsi->lp_rate = 1000; + + r = mipi_dsi_attach(dsi); + if (r < 0) + goto err_dsi_attach; + return 0; +err_dsi_attach: + sysfs_remove_group(&dsi->dev.kobj, &dsicm_attr_group); err_bl: destroy_workqueue(ddata->workqueue); err_reg: @@ -1296,6 +1300,8 @@ static int __exit dsicm_remove(struct mipi_dsi_device *dsi) dev_dbg(&dsi->dev, "remove\n"); + mipi_dsi_detach(dsi); + omapdss_device_unregister(dssdev); if (omapdss_device_is_enabled(dssdev)) diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index 3e6a57e00456..64407f4651af 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -349,7 +349,7 @@ struct dsi_data { struct { enum dsi_vc_source source; - struct omap_dss_device *dssdev; + struct mipi_dsi_device *dest; enum fifo_size tx_fifo_size; enum fifo_size rx_fifo_size; } vc[4]; @@ -4690,32 +4690,6 @@ static enum omap_channel dsi_get_channel(struct dsi_data *dsi) } } -static int dsi_request_vc(struct omap_dss_device *dssdev, int channel) -{ - struct dsi_data *dsi = to_dsi_data(dssdev); - - if (channel < 0 || channel > 3) - return -EINVAL; - - if (dsi->vc[channel].dssdev) { - DSSERR("cannot get VC for display %s", dssdev->name); - return -EBUSY; - } - - dsi->vc[channel].dssdev = dssdev; - return 0; -} - -static void dsi_release_vc(struct omap_dss_device *dssdev, int channel) -{ - struct dsi_data *dsi = to_dsi_data(dssdev); - - if ((channel >= 0 && channel <= 3) && - dsi->vc[channel].dssdev == dssdev) { - dsi->vc[channel].dssdev = NULL; - } -} - static ssize_t omap_dsi_host_transfer(struct mipi_dsi_host *host, const struct mipi_dsi_msg *msg) { @@ -4792,23 +4766,40 @@ static const struct omap_dss_device_ops dsi_ops = { .update = dsi_update, .enable_te = dsi_enable_te, - - .request_vc = dsi_request_vc, - .release_vc = dsi_release_vc, }, }; int omap_dsi_host_attach(struct mipi_dsi_host *host, -struct mipi_dsi_device *dsi) +struct mipi_dsi_device *client) { - /* TODO: convert driver from custom binding method to this one */ + struct dsi_data *dsi = host_to_omap(host); + unsigned int channel = client->channel; + + if (channel > 3) + return -EINVAL; + + if (dsi->vc[channel].dest) { + DSSERR("cannot get VC for display %s", dev_name(&client->dev)); + return -EBUSY; + } + + dsi->vc[channel].dest = client; return 0; } int omap_dsi_host_detach(struct mipi_dsi_host *host, -struct mipi_dsi_device *dsi) +struct mipi_dsi_device *client) { - /* TODO: convert driver from custom binding method to this one */ + struct dsi_data *dsi = host_to_omap(host); + unsigned int channel = client->channel; + + if (channel > 3) + return -EINVAL; + + if (dsi->vc
[PATCHv2 33/56] drm/omap: dsi: Reverse direction of the DSS device enable/disable operations
Complete the direction reversal of the DSS device enable/disable operations started by 19b4200d8f4b ("drm/omap: Reverse direction of the DSS device enable/disable operations"). This effectively drops the requirement of calling DSS specific code from the DSI panel driver moving it a bit further to a standard drm_panel driver. Signed-off-by: Sebastian Reichel --- .../gpu/drm/omapdrm/displays/panel-dsi-cm.c | 75 ++- drivers/gpu/drm/omapdrm/omap_encoder.c| 24 ++ 2 files changed, 46 insertions(+), 53 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 5a2a8cee9186..6f559c1b0bf6 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -288,27 +288,6 @@ static int dsicm_power_on(struct panel_drv_data *ddata) struct omap_dss_device *src = ddata->src; u8 id1, id2, id3; int r; - struct omap_dss_dsi_config dsi_config = { - .vm = &ddata->vm, - .hs_clk_min = 15000, - .hs_clk_max = 3, - .lp_clk_min = 700, - .lp_clk_max = 1000, - }; - - r = regulator_bulk_enable(DCS_REGULATOR_SUPPLY_NUM, ddata->supplies); - if (r) { - dev_err(&ddata->dsi->dev, "failed to enable supplies: %d\n", r); - return r; - } - - r = src->ops->dsi.set_config(src, &dsi_config); - if (r) { - dev_err(&ddata->dsi->dev, "failed to configure DSI\n"); - goto err_regulators; - } - - src->ops->enable(src); dsicm_hw_reset(ddata); @@ -363,12 +342,6 @@ static int dsicm_power_on(struct panel_drv_data *ddata) dsicm_hw_reset(ddata); - src->ops->disable(src); -err_regulators: - r = regulator_bulk_disable(DCS_REGULATOR_SUPPLY_NUM, ddata->supplies); - if (r) - dev_err(&ddata->dsi->dev, "failed to disable supplies: %d\n", r); - return r; } @@ -377,6 +350,8 @@ static void dsicm_power_off(struct panel_drv_data *ddata) struct omap_dss_device *src = ddata->src; int r; + ddata->enabled = false; + src->ops->dsi.disable_video_output(src, ddata->dsi->channel); r = mipi_dsi_dcs_set_display_off(ddata->dsi); @@ -388,14 +363,6 @@ static void dsicm_power_off(struct panel_drv_data *ddata) "error disabling panel, issuing HW reset\n"); dsicm_hw_reset(ddata); } - - src->ops->disable(src); - - r = regulator_bulk_disable(DCS_REGULATOR_SUPPLY_NUM, ddata->supplies); - if (r) - dev_err(&ddata->dsi->dev, "failed to disable supplies: %d\n", r); - - ddata->enabled = false; } static int dsicm_connect(struct omap_dss_device *src, @@ -415,6 +382,30 @@ static void dsicm_disconnect(struct omap_dss_device *src, ddata->src = NULL; } +static void dsicm_pre_enable(struct omap_dss_device *dssdev) +{ + struct panel_drv_data *ddata = to_panel_data(dssdev); + struct omap_dss_device *src = ddata->src; + int r; + struct omap_dss_dsi_config dsi_config = { + .vm = &ddata->vm, + .hs_clk_min = 15000, + .hs_clk_max = 3, + .lp_clk_min = 700, + .lp_clk_max = 1000, + }; + + r = regulator_bulk_enable(DCS_REGULATOR_SUPPLY_NUM, ddata->supplies); + if (r) { + dev_err(&ddata->dsi->dev, "failed to enable supplies: %d\n", r); + } + + r = src->ops->dsi.set_config(src, &dsi_config); + if (r) { + dev_err(&ddata->dsi->dev, "failed to configure DSI\n"); + } +} + static void dsicm_enable(struct omap_dss_device *dssdev) { struct panel_drv_data *ddata = to_panel_data(dssdev); @@ -449,6 +440,16 @@ static void dsicm_disable(struct omap_dss_device *dssdev) mutex_unlock(&ddata->lock); } +static void dsicm_post_disable(struct omap_dss_device *dssdev) +{ + struct panel_drv_data *ddata = to_panel_data(dssdev); + int r; + + r = regulator_bulk_disable(DCS_REGULATOR_SUPPLY_NUM, ddata->supplies); + if (r) + dev_err(&ddata->dsi->dev, "failed to disable supplies: %d\n", r); +} + static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable) { struct mipi_dsi_device *dsi = ddata->dsi; @@ -502,8 +503,10 @@ static const struct omap_dss_device_ops dsicm_ops = { .connect= dsicm_connect, .disconnect = dsicm_disconnect, + .pre_enable = dsicm_pre_enable, .enable = dsicm_enable, .disable= dsicm_disable, + .post_disable = dsicm_post_disable, .get_modes = dsicm_get_modes, .check_timings = dsicm_check_timings, @@ -666,8 +669,6 @@ static int __exit dsicm_remove(struct mipi_dsi_device *ds
[PATCHv2 43/56] drm/omap: bind components with drm_device argument
This fixes the omapdrm driver to call component_bind_all() with drm_device as data argument as recommended in the DRM component helper usage text. After this patch DRM functionality can be implemented directly in the components resulting in a simpler driver stack by removing one layer of abstraction. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/dss/dss.c | 27 +-- drivers/gpu/drm/omapdrm/dss/omapdss.h | 3 +++ drivers/gpu/drm/omapdrm/omap_drv.c| 15 +++ 3 files changed, 31 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c index 4438947326ea..a0b37d9b62ea 100644 --- a/drivers/gpu/drm/omapdrm/dss/dss.c +++ b/drivers/gpu/drm/omapdrm/dss/dss.c @@ -1301,26 +1301,35 @@ static const struct soc_device_attribute dss_soc_devices[] = { { /* sentinel */ } }; +int dss_bind_components(struct dss_device *dss, struct drm_device *drm_dev) +{ + struct platform_device *pdev = dss->pdev; + + return component_bind_all(&pdev->dev, drm_dev); +} +EXPORT_SYMBOL(dss_bind_components); + +void dss_unbind_components(struct dss_device *dss, struct drm_device *drm_dev) +{ + struct platform_device *pdev = dss->pdev; + + component_unbind_all(&pdev->dev, drm_dev); +} +EXPORT_SYMBOL(dss_unbind_components); + static int dss_bind(struct device *dev) { struct dss_device *dss = dev_get_drvdata(dev); struct platform_device *drm_pdev; struct dss_pdata pdata; - int r; - - r = component_bind_all(dev, NULL); - if (r) - return r; pm_set_vt_switch(0); pdata.dss = dss; drm_pdev = platform_device_register_data(NULL, "omapdrm", 0, &pdata, sizeof(pdata)); - if (IS_ERR(drm_pdev)) { - component_unbind_all(dev, NULL); + if (IS_ERR(drm_pdev)) return PTR_ERR(drm_pdev); - } dss->drm_pdev = drm_pdev; @@ -1332,8 +1341,6 @@ static void dss_unbind(struct device *dev) struct dss_device *dss = dev_get_drvdata(dev); platform_device_unregister(dss->drm_pdev); - - component_unbind_all(dev, NULL); } static const struct component_master_ops dss_component_ops = { diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index 9f8aefaadefe..45f5c46712eb 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -526,4 +526,7 @@ const struct dispc_ops *dispc_get_ops(struct dss_device *dss); bool omapdss_stack_is_ready(void); void omapdss_gather_components(struct device *dev); +int dss_bind_components(struct dss_device *dss, struct drm_device *drm_dev); +void dss_unbind_components(struct dss_device *dss, struct drm_device *drm_dev); + #endif /* __OMAP_DRM_DSS_H */ diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index 579f9d80fec9..c47e63e94a2e 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -237,8 +237,6 @@ static int omap_modeset_init(struct drm_device *dev) if (!omapdss_stack_is_ready()) return -EPROBE_DEFER; - drm_mode_config_init(dev); - ret = omap_modeset_init_properties(dev); if (ret < 0) return ret; @@ -605,10 +603,15 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev) ddev = drm_dev_alloc(&omap_drm_driver, dev); if (IS_ERR(ddev)) return PTR_ERR(ddev); - - priv->ddev = ddev; ddev->dev_private = priv; + drm_mode_config_init(ddev); + + ret = dss_bind_components(pdata->dss, ddev); + if (ret) + goto err_ddev_deinit; + + priv->ddev = ddev; priv->dev = dev; priv->dss = pdata->dss; priv->dispc = dispc_get_dispc(priv->dss); @@ -673,6 +676,8 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev) destroy_workqueue(priv->wq); omap_disconnect_pipelines(ddev); omap_crtc_pre_uninit(priv); + dss_unbind_components(priv->dss, ddev); +err_ddev_deinit: drm_dev_put(ddev); return ret; } @@ -700,6 +705,8 @@ static void omapdrm_cleanup(struct omap_drm_private *priv) omap_disconnect_pipelines(ddev); omap_crtc_pre_uninit(priv); + dss_unbind_components(priv->dss, ddev); + drm_dev_put(ddev); } -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 51/56] drm/omap: drop DSS ops_flags
The omapdss device's ops_flags field is no longer used and can be dropped. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/dss/omapdss.h | 9 - drivers/gpu/drm/omapdrm/dss/venc.c| 1 - 2 files changed, 10 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index 03498f0ed6c2..0ee042228c96 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -278,14 +278,6 @@ struct omap_dss_device_ops { const struct omapdss_dsi_ops dsi; }; -/** - * enum omap_dss_device_ops_flag - Indicates which device ops are supported - * @OMAP_DSS_DEVICE_OP_MODES: The device supports reading modes - */ -enum omap_dss_device_ops_flag { - OMAP_DSS_DEVICE_OP_MODES = BIT(3), -}; - struct omap_dss_device { struct device *dev; @@ -314,7 +306,6 @@ struct omap_dss_device { const char *name; const struct omap_dss_device_ops *ops; - unsigned long ops_flags; u32 bus_flags; /* OMAP DSS output specific fields */ diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c b/drivers/gpu/drm/omapdrm/dss/venc.c index 766553bb2f87..96e5d2944452 100644 --- a/drivers/gpu/drm/omapdrm/dss/venc.c +++ b/drivers/gpu/drm/omapdrm/dss/venc.c @@ -774,7 +774,6 @@ static int venc_init_output(struct venc_device *venc) out->dispc_channel = OMAP_DSS_CHANNEL_DIGIT; out->owner = THIS_MODULE; out->of_port = 0; - out->ops_flags = OMAP_DSS_DEVICE_OP_MODES; r = omapdss_device_init_output(out, &venc->bridge); if (r < 0) { -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 06/56] drm/omap: constify write buffers
The write buffers are not modified, so they can be constant. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/dss/dsi.c | 24 drivers/gpu/drm/omapdrm/dss/omapdss.h | 10 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index bb2548d091ef..f01e0476296d 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -2601,11 +2601,11 @@ static inline void dsi_vc_write_long_payload(struct dsi_data *dsi, int channel, } static int dsi_vc_send_long(struct dsi_data *dsi, int channel, u8 data_type, - u8 *data, u16 len, u8 ecc) + const u8 *data, u16 len, u8 ecc) { /*u32 val; */ int i; - u8 *p; + const u8 *p; int r = 0; u8 b1, b2, b3, b4; @@ -2698,7 +2698,7 @@ static int dsi_vc_send_null(struct dsi_data *dsi, int channel) } static int dsi_vc_write_nosync_common(struct dsi_data *dsi, int channel, - u8 *data, int len, + const u8 *data, int len, enum dss_dsi_content_type type) { int r; @@ -2729,7 +2729,7 @@ static int dsi_vc_write_nosync_common(struct dsi_data *dsi, int channel, } static int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel, - u8 *data, int len) + const u8 *data, int len) { struct dsi_data *dsi = to_dsi_data(dssdev); @@ -2738,7 +2738,7 @@ static int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel, } static int dsi_vc_generic_write_nosync(struct omap_dss_device *dssdev, int channel, - u8 *data, int len) + const u8 *data, int len) { struct dsi_data *dsi = to_dsi_data(dssdev); @@ -2747,7 +2747,7 @@ static int dsi_vc_generic_write_nosync(struct omap_dss_device *dssdev, int chann } static int dsi_vc_write_common(struct omap_dss_device *dssdev, - int channel, u8 *data, int len, + int channel, const u8 *data, int len, enum dss_dsi_content_type type) { struct dsi_data *dsi = to_dsi_data(dssdev); @@ -2776,15 +2776,15 @@ static int dsi_vc_write_common(struct omap_dss_device *dssdev, return r; } -static int dsi_vc_dcs_write(struct omap_dss_device *dssdev, int channel, u8 *data, - int len) +static int dsi_vc_dcs_write(struct omap_dss_device *dssdev, int channel, + const u8 *data, int len) { return dsi_vc_write_common(dssdev, channel, data, len, DSS_DSI_CONTENT_DCS); } -static int dsi_vc_generic_write(struct omap_dss_device *dssdev, int channel, u8 *data, - int len) +static int dsi_vc_generic_write(struct omap_dss_device *dssdev, int channel, + const u8 *data, int len) { return dsi_vc_write_common(dssdev, channel, data, len, DSS_DSI_CONTENT_GENERIC); @@ -2810,7 +2810,7 @@ static int dsi_vc_dcs_send_read_request(struct dsi_data *dsi, int channel, } static int dsi_vc_generic_send_read_request(struct dsi_data *dsi, int channel, - u8 *reqdata, int reqlen) + const u8 *reqdata, int reqlen) { u16 data; u8 data_type; @@ -2983,7 +2983,7 @@ static int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_c } static int dsi_vc_generic_read(struct omap_dss_device *dssdev, int channel, - u8 *reqdata, int reqlen, u8 *buf, int buflen) + const u8 *reqdata, int reqlen, u8 *buf, int buflen) { struct dsi_data *dsi = to_dsi_data(dssdev); int r; diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index 53fea1cbbc2d..b909b3a8c835 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -308,18 +308,18 @@ struct omapdss_dsi_ops { /* data transfer */ int (*dcs_write)(struct omap_dss_device *dssdev, int channel, - u8 *data, int len); + const u8 *data, int len); int (*dcs_write_nosync)(struct omap_dss_device *dssdev, int channel, - u8 *data, int len); + const u8 *data, int len); int (*dcs_read)(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, u8 *data, int len); int (*gen_write)(struct omap_dss_device *dssdev, int channel, - u8 *data, int len); + const u8 *data, int len); int (*gen_write_nosync)(struct omap_dss_device *dssdev, int channel, - u8 *data, int len); + const u8 *data, int len);
[PATCHv2 07/56] drm/omap: dsi: add generic transfer function
This prepares the driver for becoming a mipi_dsi_host implementation, which provides a generic transfer function instead of all kind of different read/write functions. The implementation will become more elegant after unexporting the specific functions in the following patches. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/dss/dsi.c | 52 +++ drivers/gpu/drm/omapdrm/dss/omapdss.h | 3 ++ 2 files changed, 55 insertions(+) diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index f01e0476296d..84e2eb0b51d7 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -4836,6 +4836,56 @@ static void dsi_release_vc(struct omap_dss_device *dssdev, int channel) } } +static ssize_t omap_dsi_transfer(struct omap_dss_device *dssdev, +const struct mipi_dsi_msg *msg) +{ + /* +* no_sync can be used to optimize performance by sending +* e.g. column and page information without syncing in +* between. It's not absolutley required, so postpone this +* feature for now. +*/ + bool no_sync = false; + u16 val; + + switch (msg->type) { + case MIPI_DSI_GENERIC_SHORT_WRITE_0_PARAM: + case MIPI_DSI_GENERIC_SHORT_WRITE_1_PARAM: + case MIPI_DSI_GENERIC_SHORT_WRITE_2_PARAM: + case MIPI_DSI_GENERIC_LONG_WRITE: + if (no_sync) + return dsi_vc_generic_write_nosync(dssdev, msg->channel, + msg->tx_buf, msg->tx_len); + else + return dsi_vc_generic_write(dssdev, msg->channel, + msg->tx_buf, msg->tx_len); + case MIPI_DSI_DCS_SHORT_WRITE: + case MIPI_DSI_DCS_SHORT_WRITE_PARAM: + case MIPI_DSI_DCS_LONG_WRITE: + if (no_sync) + return dsi_vc_dcs_write_nosync(dssdev, msg->channel, + msg->tx_buf, msg->tx_len); + else + return dsi_vc_dcs_write(dssdev, msg->channel, + msg->tx_buf, msg->tx_len); + case MIPI_DSI_GENERIC_READ_REQUEST_0_PARAM: + case MIPI_DSI_GENERIC_READ_REQUEST_1_PARAM: + case MIPI_DSI_GENERIC_READ_REQUEST_2_PARAM: + return dsi_vc_generic_read(dssdev, msg->channel, msg->tx_buf, + msg->tx_len, msg->rx_buf, msg->rx_len); + case MIPI_DSI_DCS_READ: + return dsi_vc_dcs_read(dssdev, msg->channel, + ((u8*) msg->tx_buf)[0], + msg->rx_buf, msg->rx_len); + case MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE: + val = le16_to_cpu(*((__le16*) msg->tx_buf)); + return dsi_vc_set_max_rx_packet_size(dssdev, msg->channel, val); + case MIPI_DSI_NULL_PACKET: + return dsi_vc_send_null(to_dsi_data(dssdev), msg->channel); + } + + return -EINVAL; +} static int dsi_get_clocks(struct dsi_data *dsi) { @@ -4890,6 +4940,8 @@ static const struct omap_dss_device_ops dsi_ops = { .set_vc_id = dsi_set_vc_id, .release_vc = dsi_release_vc, + .transfer = omap_dsi_transfer, + .dcs_write = dsi_vc_dcs_write, .dcs_write_nosync = dsi_vc_dcs_write_nosync, .dcs_read = dsi_vc_dcs_read, diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index b909b3a8c835..ea7bf0970677 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -307,6 +307,9 @@ struct omapdss_dsi_ops { void (*release_vc)(struct omap_dss_device *dssdev, int channel); /* data transfer */ + ssize_t (*transfer)(struct omap_dss_device *dssdev, + const struct mipi_dsi_msg *msg); + int (*dcs_write)(struct omap_dss_device *dssdev, int channel, const u8 *data, int len); int (*dcs_write_nosync)(struct omap_dss_device *dssdev, int channel, -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 04/56] omap/drm: drop unused dsi.configure_pins
The panel-dsi-cm's ddata->pin_config is always NULL, so this callback is never called. Instead the DSI encoder gets the pin configuration directly from DT. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 11 --- drivers/gpu/drm/omapdrm/dss/dsi.c | 1 - drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 -- 3 files changed, 14 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 3484b5d4a91c..e7fe5d702337 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -68,8 +68,6 @@ struct panel_drv_data { int width_mm; int height_mm; - struct omap_dsi_pin_config pin_config; - /* runtime variables */ bool enabled; @@ -623,15 +621,6 @@ static int dsicm_power_on(struct panel_drv_data *ddata) } } - if (ddata->pin_config.num_pins > 0) { - r = src->ops->dsi.configure_pins(src, &ddata->pin_config); - if (r) { - dev_err(&ddata->pdev->dev, - "failed to configure DSI pins\n"); - goto err_vddi; - } - } - r = src->ops->dsi.set_config(src, &dsi_config); if (r) { dev_err(&ddata->pdev->dev, "failed to configure DSI\n"); diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index 79ddfbfd1b58..8c39823a8295 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -4892,7 +4892,6 @@ static const struct omap_dss_device_ops dsi_ops = { .enable_hs = dsi_vc_enable_hs, - .configure_pins = dsi_configure_pins, .set_config = dsi_set_config, .enable_video_output = dsi_enable_video_output, diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index cbbe10b2b60d..b0424daaceed 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -292,8 +292,6 @@ struct omapdss_dsi_ops { /* bus configuration */ int (*set_config)(struct omap_dss_device *dssdev, const struct omap_dss_dsi_config *cfg); - int (*configure_pins)(struct omap_dss_device *dssdev, - const struct omap_dsi_pin_config *pin_cfg); void (*enable_hs)(struct omap_dss_device *dssdev, int channel, bool enable); -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 32/56] drm/omap: dsi: move panel refresh function to host
This moves the panel refresh/update function from the panel driver into the DSI host driver to prepare for common drm_panel support. Signed-off-by: Sebastian Reichel --- .../gpu/drm/omapdrm/displays/panel-dsi-cm.c | 68 drivers/gpu/drm/omapdrm/dss/dsi.c | 101 -- drivers/gpu/drm/omapdrm/dss/omapdss.h | 13 +-- drivers/gpu/drm/omapdrm/omap_crtc.c | 11 +- 4 files changed, 97 insertions(+), 96 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 1e33cf7c1448..5a2a8cee9186 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -177,27 +177,6 @@ static int dsicm_get_id(struct panel_drv_data *ddata, u8 *id1, u8 *id2, u8 *id3) return 0; } -static int dsicm_set_update_window(struct panel_drv_data *ddata, - u16 x, u16 y, u16 w, u16 h) -{ - struct mipi_dsi_device *dsi = ddata->dsi; - int r; - u16 x1 = x; - u16 x2 = x + w - 1; - u16 y1 = y; - u16 y2 = y + h - 1; - - r = mipi_dsi_dcs_set_column_address(dsi, x1, x2); - if (r < 0) - return r; - - r = mipi_dsi_dcs_set_page_address(dsi, y1, y2); - if (r < 0) - return r; - - return 0; -} - static int dsicm_bl_update_status(struct backlight_device *dev) { struct panel_drv_data *ddata = dev_get_drvdata(&dev->dev); @@ -470,48 +449,6 @@ static void dsicm_disable(struct omap_dss_device *dssdev) mutex_unlock(&ddata->lock); } -static void dsicm_framedone_cb(int err, void *data) -{ - struct panel_drv_data *ddata = data; - - dev_dbg(&ddata->dsi->dev, "framedone, err %d\n", err); - mutex_unlock(&ddata->lock); -} - -static int dsicm_update(struct omap_dss_device *dssdev, - u16 x, u16 y, u16 w, u16 h) -{ - struct panel_drv_data *ddata = to_panel_data(dssdev); - struct omap_dss_device *src = ddata->src; - int r; - - dev_dbg(&ddata->dsi->dev, "update %d, %d, %d x %d\n", x, y, w, h); - - mutex_lock(&ddata->lock); - - if (!ddata->enabled) { - r = 0; - goto err; - } - - /* XXX no need to send this every frame, but dsi break if not done */ - r = dsicm_set_update_window(ddata, 0, 0, ddata->vm.hactive, - ddata->vm.vactive); - if (r) - goto err; - - r = src->ops->dsi.update(src, ddata->dsi->channel, dsicm_framedone_cb, - ddata); - if (r) - goto err; - - /* note: no unlock here. unlock is src framedone_cb */ - return 0; -err: - mutex_unlock(&ddata->lock); - return r; -} - static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable) { struct mipi_dsi_device *dsi = ddata->dsi; @@ -572,10 +509,6 @@ static const struct omap_dss_device_ops dsicm_ops = { .check_timings = dsicm_check_timings, }; -static const struct omap_dss_driver dsicm_dss_driver = { - .update = dsicm_update, -}; - static int dsicm_probe_of(struct mipi_dsi_device *dsi) { struct device_node *node = dsi->dev.of_node; @@ -660,7 +593,6 @@ static int dsicm_probe(struct mipi_dsi_device *dsi) dssdev = &ddata->dssdev; dssdev->dev = dev; dssdev->ops = &dsicm_ops; - dssdev->driver = &dsicm_dss_driver; dssdev->type = OMAP_DISPLAY_TYPE_DSI; dssdev->display = true; dssdev->owner = THIS_MODULE; diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index 12d661ad37ad..b0e796f90fca 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -217,6 +217,9 @@ static void dsi_display_uninit_dispc(struct dsi_data *dsi); static int dsi_vc_send_null(struct dsi_data *dsi, int channel); +static ssize_t _omap_dsi_host_transfer(struct dsi_data *dsi, + const struct mipi_dsi_msg *msg); + /* DSI PLL HSDIV indices */ #define HSDIV_DISPC0 #define HSDIV_DSI 1 @@ -386,9 +389,6 @@ struct dsi_data { struct delayed_work ulps_work; - void (*framedone_callback)(int, void *); - void *framedone_data; - struct delayed_work framedone_timeout_work; #ifdef DSI_CATCH_MISSING_TE @@ -3809,8 +3809,6 @@ static void dsi_handle_framedone(struct dsi_data *dsi, int error) dsi_set_ulps_auto(dsi, true); dsi_bus_unlock(dsi); - dsi->framedone_callback(error, dsi->framedone_data); - if (!error) dsi_perf_show(dsi, "DISPC"); } @@ -3842,6 +3840,8 @@ static void dsi_framedone_irq_callback(void *data) cancel_delayed_work(&dsi->framedone_timeout_work); + DSSDBG("Framedone received!\n"); + dsi_handle_framedone(dsi, 0); } @@ -3863,17 +3863,69 @@ static int _dsi_updat
[PATCHv2 55/56] drm/panel/panel-dsi-cm: support rotation property
Add support for the rotation property described by the common panel bindings. The information is forwarded to userspace using the orientation property. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/panel/panel-dsi-cm.c | 24 +++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-dsi-cm.c b/drivers/gpu/drm/panel/panel-dsi-cm.c index fef9ba5319c2..b043ebb9c247 100644 --- a/drivers/gpu/drm/panel/panel-dsi-cm.c +++ b/drivers/gpu/drm/panel/panel-dsi-cm.c @@ -58,6 +58,7 @@ struct panel_drv_data { int width_mm; int height_mm; + enum drm_panel_orientation panel_orientation; /* runtime variables */ bool enabled; @@ -458,6 +459,7 @@ static int dsicm_get_modes(struct drm_panel *panel, connector->display_info.width_mm = ddata->width_mm; connector->display_info.height_mm = ddata->height_mm; + connector->display_info.panel_orientation = ddata->panel_orientation; drm_mode_probed_add(connector, mode); @@ -479,7 +481,7 @@ static int dsicm_probe_of(struct mipi_dsi_device *dsi) struct panel_drv_data *ddata = mipi_dsi_get_drvdata(dsi); struct display_timing timing; struct videomode vm; - int err; + int err, rotation; vm.hactive = 864; vm.vactive = 480; @@ -509,6 +511,26 @@ static int dsicm_probe_of(struct mipi_dsi_device *dsi) ddata->height_mm = 0; of_property_read_u32(node, "height-mm", &ddata->height_mm); + rotation = -1; + of_property_read_u32(node, "rotation", &rotation); + switch (rotation) { + case 0: + ddata->panel_orientation = DRM_MODE_PANEL_ORIENTATION_NORMAL; + break; + case 90: + ddata->panel_orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP; + break; + case 180: + ddata->panel_orientation = DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP; + break; + case 270: + ddata->panel_orientation = DRM_MODE_PANEL_ORIENTATION_LEFT_UP; + break; + default: + ddata->panel_orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN; + break; + } + ddata->supplies[0].supply = "vpnl"; ddata->supplies[1].supply = "vddi"; err = devm_regulator_bulk_get(&dsi->dev, DCS_REGULATOR_SUPPLY_NUM, -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 09/56] drm/omap: dsi: unexport specific data transfer functions
After converting all DSI drivers, unexport the specific transfer functions. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/dss/dsi.c | 12 drivers/gpu/drm/omapdrm/dss/omapdss.h | 20 2 files changed, 32 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index 84e2eb0b51d7..0990777a42f7 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -4941,18 +4941,6 @@ static const struct omap_dss_device_ops dsi_ops = { .release_vc = dsi_release_vc, .transfer = omap_dsi_transfer, - - .dcs_write = dsi_vc_dcs_write, - .dcs_write_nosync = dsi_vc_dcs_write_nosync, - .dcs_read = dsi_vc_dcs_read, - - .gen_write = dsi_vc_generic_write, - .gen_write_nosync = dsi_vc_generic_write_nosync, - .gen_read = dsi_vc_generic_read, - - .bta_sync = dsi_vc_send_bta_sync, - - .set_max_rx_packet_size = dsi_vc_set_max_rx_packet_size, }, }; diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index ea7bf0970677..787e102eb068 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -309,26 +309,6 @@ struct omapdss_dsi_ops { /* data transfer */ ssize_t (*transfer)(struct omap_dss_device *dssdev, const struct mipi_dsi_msg *msg); - - int (*dcs_write)(struct omap_dss_device *dssdev, int channel, - const u8 *data, int len); - int (*dcs_write_nosync)(struct omap_dss_device *dssdev, int channel, - const u8 *data, int len); - int (*dcs_read)(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, - u8 *data, int len); - - int (*gen_write)(struct omap_dss_device *dssdev, int channel, - const u8 *data, int len); - int (*gen_write_nosync)(struct omap_dss_device *dssdev, int channel, - const u8 *data, int len); - int (*gen_read)(struct omap_dss_device *dssdev, int channel, - const u8 *reqdata, int reqlen, - u8 *data, int len); - - int (*bta_sync)(struct omap_dss_device *dssdev, int channel); - - int (*set_max_rx_packet_size)(struct omap_dss_device *dssdev, - int channel, u16 plen); }; struct omap_dss_device_ops { -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 37/51] drm/rockchip: Drop explicit drm_mode_config_cleanup call
On Fri, Feb 21, 2020 at 10:04 PM Daniel Vetter wrote: > > It's (almost, there's some iommu stuff without significance) right > above the drm_dev_put(). > > This is made possible by a preceeding patch which added a drmm_ > cleanup action to drm_mode_config_init(), hence all we need to do to > ensure that drm_mode_config_cleanup() is run on final drm_device > cleanup is check the new error code for _init(). > > Aside: Another driver with a bit much devm_kzalloc, which should > probably use drmm_kzalloc instead ... > > v2: Explain why this cleanup is possible (Laurent). > > Cc: Laurent Pinchart > Signed-off-by: Daniel Vetter > Cc: Sandy Huang > Cc: "Heiko Stübner" > Cc: linux-arm-ker...@lists.infradead.org > Cc: linux-rockc...@lists.infradead.org > --- > drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 10 +++--- > 1 file changed, 3 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c > b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c > index 20ecb1508a22..d0eba21eebc9 100644 > --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c > +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c > @@ -135,7 +135,9 @@ static int rockchip_drm_bind(struct device *dev) > if (ret) > goto err_free; > > - drm_mode_config_init(drm_dev); > + ret = drm_mode_config_init(drm_dev); > + if (ret) > + goto err_free; Shouldn't the goto label be err_mode_config_cleanup here? Otherwise this error path misses the call to rockchip_iommu_cleanup(). > > rockchip_drm_mode_config_init(drm_dev); > > @@ -174,11 +176,8 @@ static int rockchip_drm_bind(struct device *dev) > err_unbind_all: > component_unbind_all(dev, drm_dev); > err_mode_config_cleanup: > - drm_mode_config_cleanup(drm_dev); > rockchip_iommu_cleanup(drm_dev); > err_free: > - drm_dev->dev_private = NULL; > - dev_set_drvdata(dev, NULL); > drm_dev_put(drm_dev); > return ret; > } On Fri, Feb 21, 2020 at 10:04 PM Daniel Vetter wrote: > > It's (almost, there's some iommu stuff without significance) right > above the drm_dev_put(). > > This is made possible by a preceeding patch which added a drmm_ > cleanup action to drm_mode_config_init(), hence all we need to do to > ensure that drm_mode_config_cleanup() is run on final drm_device > cleanup is check the new error code for _init(). > > Aside: Another driver with a bit much devm_kzalloc, which should > probably use drmm_kzalloc instead ... > > v2: Explain why this cleanup is possible (Laurent). > > Cc: Laurent Pinchart > Signed-off-by: Daniel Vetter > Cc: Sandy Huang > Cc: "Heiko Stübner" > Cc: linux-arm-ker...@lists.infradead.org > Cc: linux-rockc...@lists.infradead.org > --- > drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 10 +++--- > 1 file changed, 3 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c > b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c > index 20ecb1508a22..d0eba21eebc9 100644 > --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c > +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c > @@ -135,7 +135,9 @@ static int rockchip_drm_bind(struct device *dev) > if (ret) > goto err_free; > > - drm_mode_config_init(drm_dev); > + ret = drm_mode_config_init(drm_dev); > + if (ret) > + goto err_free; > > rockchip_drm_mode_config_init(drm_dev); > > @@ -174,11 +176,8 @@ static int rockchip_drm_bind(struct device *dev) > err_unbind_all: > component_unbind_all(dev, drm_dev); > err_mode_config_cleanup: > - drm_mode_config_cleanup(drm_dev); > rockchip_iommu_cleanup(drm_dev); > err_free: > - drm_dev->dev_private = NULL; > - dev_set_drvdata(dev, NULL); > drm_dev_put(drm_dev); > return ret; > } > @@ -194,11 +193,8 @@ static void rockchip_drm_unbind(struct device *dev) > > drm_atomic_helper_shutdown(drm_dev); > component_unbind_all(dev, drm_dev); > - drm_mode_config_cleanup(drm_dev); > rockchip_iommu_cleanup(drm_dev); > > - drm_dev->dev_private = NULL; > - dev_set_drvdata(dev, NULL); > drm_dev_put(drm_dev); > } > > -- > 2.24.1 > > > ___ > Linux-rockchip mailing list > linux-rockc...@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-rockchip ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 10/56] drm/omap: dsi: drop virtual channel logic
This drops the virtual channel logic. Afterwards DSI clients request their channel number and get the virtual channel with the same number or -EBUSY if already in use. Signed-off-by: Sebastian Reichel --- .../gpu/drm/omapdrm/displays/panel-dsi-cm.c | 11 ++--- drivers/gpu/drm/omapdrm/dss/dsi.c | 46 --- drivers/gpu/drm/omapdrm/dss/omapdss.h | 4 +- 3 files changed, 12 insertions(+), 49 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 92f510a771fe..ba046a596044 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -769,19 +769,12 @@ static int dsicm_connect(struct omap_dss_device *src, struct device *dev = &ddata->pdev->dev; int r; - r = src->ops->dsi.request_vc(src, &ddata->channel); + r = src->ops->dsi.request_vc(src, ddata->channel); if (r) { dev_err(dev, "failed to get virtual channel\n"); return r; } - r = src->ops->dsi.set_vc_id(src, ddata->channel, TCH); - if (r) { - dev_err(dev, "failed to set VC_ID\n"); - src->ops->dsi.release_vc(src, ddata->channel); - return r; - } - ddata->src = src; return 0; } @@ -1216,6 +1209,8 @@ static int dsicm_probe_of(struct platform_device *pdev) struct display_timing timing; int err; + ddata->channel = TCH; + ddata->reset_gpio = devm_gpiod_get(&pdev->dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(ddata->reset_gpio)) { err = PTR_ERR(ddata->reset_gpio); diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index 0990777a42f7..8c223b808740 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -350,7 +350,6 @@ struct dsi_data { struct omap_dss_device *dssdev; enum fifo_size tx_fifo_size; enum fifo_size rx_fifo_size; - int vc_id; } vc[4]; struct mutex lock; @@ -2579,7 +2578,7 @@ static inline void dsi_vc_write_long_header(struct dsi_data *dsi, int channel, WARN_ON(!dsi_bus_is_locked(dsi)); - data_id = data_type | dsi->vc[channel].vc_id << 6; + data_id = data_type | channel << 6; val = FLD_VAL(data_id, 7, 0) | FLD_VAL(len, 23, 8) | FLD_VAL(ecc, 31, 24); @@ -2683,7 +2682,7 @@ static int dsi_vc_send_short(struct dsi_data *dsi, int channel, u8 data_type, return -EINVAL; } - data_id = data_type | dsi->vc[channel].vc_id << 6; + data_id = data_type | channel << 6; r = (data_id << 0) | (data << 8) | (ecc << 24); @@ -4783,45 +4782,19 @@ static enum omap_channel dsi_get_channel(struct dsi_data *dsi) } } -static int dsi_request_vc(struct omap_dss_device *dssdev, int *channel) +static int dsi_request_vc(struct omap_dss_device *dssdev, int channel) { struct dsi_data *dsi = to_dsi_data(dssdev); - int i; - - for (i = 0; i < ARRAY_SIZE(dsi->vc); i++) { - if (!dsi->vc[i].dssdev) { - dsi->vc[i].dssdev = dssdev; - *channel = i; - return 0; - } - } - DSSERR("cannot get VC for display %s", dssdev->name); - return -ENOSPC; -} - -static int dsi_set_vc_id(struct omap_dss_device *dssdev, int channel, int vc_id) -{ - struct dsi_data *dsi = to_dsi_data(dssdev); - - if (vc_id < 0 || vc_id > 3) { - DSSERR("VC ID out of range\n"); - return -EINVAL; - } - - if (channel < 0 || channel > 3) { - DSSERR("Virtual Channel out of range\n"); + if (channel < 0 || channel > 3) return -EINVAL; - } - if (dsi->vc[channel].dssdev != dssdev) { - DSSERR("Virtual Channel not allocated to display %s\n", - dssdev->name); - return -EINVAL; + if (dsi->vc[channel].dssdev) { + DSSERR("cannot get VC for display %s", dssdev->name); + return -EBUSY; } - dsi->vc[channel].vc_id = vc_id; - + dsi->vc[channel].dssdev = dssdev; return 0; } @@ -4832,7 +4805,6 @@ static void dsi_release_vc(struct omap_dss_device *dssdev, int channel) if ((channel >= 0 && channel <= 3) && dsi->vc[channel].dssdev == dssdev) { dsi->vc[channel].dssdev = NULL; - dsi->vc[channel].vc_id = 0; } } @@ -4937,7 +4909,6 @@ static const struct omap_dss_device_ops dsi_ops = { .enable_te = dsi_enable_te, .request_vc = dsi_request_vc, - .set_vc_id = dsi_set_vc_id, .release_vc = dsi_release_vc, .transfer = omap_dsi_transfer, @@ -5393,7
[PATCHv2 39/56] drm/omap: panel-dsi-cm: support unbinding
Now, that the driver implements the common DRM panel API the unbind no longer needs to be suppressed. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 00dc7b0a349b..8562f056585d 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -612,7 +612,7 @@ static int dsicm_probe(struct mipi_dsi_device *dsi) return r; } -static int __exit dsicm_remove(struct mipi_dsi_device *dsi) +static int dsicm_remove(struct mipi_dsi_device *dsi) { struct panel_drv_data *ddata = mipi_dsi_get_drvdata(dsi); @@ -642,11 +642,10 @@ MODULE_DEVICE_TABLE(of, dsicm_of_match); static struct mipi_dsi_driver dsicm_driver = { .probe = dsicm_probe, - .remove = __exit_p(dsicm_remove), + .remove = dsicm_remove, .driver = { .name = "panel-dsi-cm", .of_match_table = dsicm_of_match, - .suppress_bind_attrs = true, }, }; module_mipi_dsi_driver(dsicm_driver); -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 38/56] drm/omap: panel-dsi-cm: use DEVICE_ATTR_RO
Use DEVICE_ATTR_RO helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 803b7dada343..00dc7b0a349b 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -219,7 +219,7 @@ static const struct backlight_ops dsicm_bl_ops = { .update_status = dsicm_bl_update_status, }; -static ssize_t dsicm_num_errors_show(struct device *dev, +static ssize_t num_dsi_errors_show(struct device *dev, struct device_attribute *attr, char *buf) { struct panel_drv_data *ddata = dev_get_drvdata(dev); @@ -239,7 +239,7 @@ static ssize_t dsicm_num_errors_show(struct device *dev, return snprintf(buf, PAGE_SIZE, "%d\n", errors); } -static ssize_t dsicm_hw_revision_show(struct device *dev, +static ssize_t hw_revision_show(struct device *dev, struct device_attribute *attr, char *buf) { struct panel_drv_data *ddata = dev_get_drvdata(dev); @@ -259,8 +259,8 @@ static ssize_t dsicm_hw_revision_show(struct device *dev, return snprintf(buf, PAGE_SIZE, "%02x.%02x.%02x\n", id1, id2, id3); } -static DEVICE_ATTR(num_dsi_errors, S_IRUGO, dsicm_num_errors_show, NULL); -static DEVICE_ATTR(hw_revision, S_IRUGO, dsicm_hw_revision_show, NULL); +static DEVICE_ATTR_RO(num_dsi_errors); +static DEVICE_ATTR_RO(hw_revision); static struct attribute *dsicm_attrs[] = { &dev_attr_num_dsi_errors.attr, -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 25/56] drm/omap: dsi: lp/hs switching support for transfer()
Integrate low-power / high-speed bus switching into transfer function and drop the omapdrm specific enable_hs() callback. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 6 +++--- drivers/gpu/drm/omapdrm/dss/dsi.c | 13 +++-- drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 -- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 8ad407a4072e..79ac1f6b375a 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -269,7 +269,7 @@ static int dsicm_exit_ulps(struct panel_drv_data *ddata) return 0; src->ops->enable(src); - src->ops->dsi.enable_hs(src, ddata->dsi->channel, true); + ddata->dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; r = _dsicm_enable_te(ddata, true); if (r) { @@ -574,7 +574,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata) dsicm_hw_reset(ddata); - src->ops->dsi.enable_hs(src, ddata->dsi->channel, false); + ddata->dsi->mode_flags |= MIPI_DSI_MODE_LPM; r = dsicm_sleep_out(ddata); if (r) @@ -617,7 +617,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata) ddata->intro_printed = true; } - src->ops->dsi.enable_hs(src, ddata->dsi->channel, true); + ddata->dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; return 0; err: diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index 6c625b6d6d6b..15298ebb9d69 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -45,6 +45,9 @@ struct dsi_reg { u16 module; u16 idx; }; #define DSI_REG(mod, idx) ((const struct dsi_reg) { mod, idx }) +/* returns true iff both arguments logically differs */ +#define NEQV(a, b) (!(a) ^ !(b)) + /* DSI Protocol Engine */ #define DSI_PROTO 0 @@ -329,6 +332,7 @@ struct dsi_data { int irq; bool is_enabled; + bool in_lp_mode; struct clk *dss_clk; struct regmap *syscon; @@ -2431,6 +2435,8 @@ static void dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel, /* start the DDR clock by sending a NULL packet */ if (dsi->vm_timings.ddr_clk_always_on && enable) dsi_vc_send_null(dsi, channel); + + dsi->in_lp_mode = !enable; } static void dsi_vc_flush_long_data(struct dsi_data *dsi, int channel) @@ -4697,6 +4703,11 @@ static ssize_t omap_dsi_host_transfer(struct mipi_dsi_host *host, struct dsi_data *dsi = host_to_omap(host); struct omap_dss_device *dssdev = &dsi->output; + if (NEQV(msg->flags & MIPI_DSI_MSG_USE_LPM, dsi->in_lp_mode)) { + dsi_vc_enable_hs(dssdev, msg->channel, +!(msg->flags & MIPI_DSI_MSG_USE_LPM)); + } + switch (msg->type) { case MIPI_DSI_GENERIC_SHORT_WRITE_0_PARAM: case MIPI_DSI_GENERIC_SHORT_WRITE_1_PARAM: @@ -4757,8 +4768,6 @@ static const struct omap_dss_device_ops dsi_ops = { .disable = dsi_display_disable, - .enable_hs = dsi_vc_enable_hs, - .set_config = dsi_set_config, .enable_video_output = dsi_enable_video_output, diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index 2c6c32240e20..355aa235c23c 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -287,8 +287,6 @@ struct omapdss_dsi_ops { int (*set_config)(struct omap_dss_device *dssdev, const struct omap_dss_dsi_config *cfg); - void (*enable_hs)(struct omap_dss_device *dssdev, int channel, - bool enable); int (*enable_te)(struct omap_dss_device *dssdev, bool enable); int (*update)(struct omap_dss_device *dssdev, int channel, -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/hisilicon: Set preferred mode resolution and maximum resolution
On Tue, 25 Feb 2020 at 10:19, Xinliang Liu wrote: > > > On Wed, 19 Feb 2020 at 10:52, Tian Tao wrote: > >> set the preferred mode resolution to 1024 * 768 and maximum >> resolution to 1920 * 1200. >> >> Signed-off-by: Tian Tao >> Signed-off-by: Gong junjie >> --- >> drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 10 +- >> 1 file changed, 9 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 6d98fdc..82fc7d3 100644 >> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c >> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c >> @@ -11,8 +11,10 @@ >> * Jianhua Li >> */ >> >> +#include >> #include >> #include >> +#include >> #include >> >> #include "hibmc_drm_drv.h" >> @@ -20,7 +22,13 @@ >> >> static int hibmc_connector_get_modes(struct drm_connector *connector) >> { >> - return drm_add_modes_noedid(connector, 800, 600); >> + int count; >> + >> + drm_connector_update_edid_property(connector, NULL); >> > And as there is no edid for the connector, don't think call drm_connector_update_edid_property is required. > + count = drm_add_modes_noedid(connector, 1920, 1200); >> > > Hi Tao, maybe it's better like this: > count = drm_add_modes_noedid( connector , > conn->dev->mode_config.max_width, > conn->dev->mode_config.max_height); > > >> + drm_set_preferred_mode(connector, 1024, 768); >> + >> + return count; >> } >> >> static enum drm_mode_status hibmc_connector_mode_valid(struct >> drm_connector *connector, >> -- >> 2.7.4 >> >> ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 22/56] drm/omap: dsi: drop useless sync()
The DSI sync() function only locks the bus and then releases it again. Currently the only invocation is directly before update(), which locks the bus anyways. Signed-off-by: Sebastian Reichel --- .../gpu/drm/omapdrm/displays/panel-dsi-cm.c| 18 -- drivers/gpu/drm/omapdrm/dss/omapdss.h | 1 - drivers/gpu/drm/omapdrm/omap_crtc.c| 3 --- 3 files changed, 22 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 64f493c722c0..a45df247aad1 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -845,23 +845,6 @@ static int dsicm_update(struct omap_dss_device *dssdev, return r; } -static int dsicm_sync(struct omap_dss_device *dssdev) -{ - struct panel_drv_data *ddata = to_panel_data(dssdev); - struct omap_dss_device *src = ddata->src; - - dev_dbg(&ddata->dsi->dev, "sync\n"); - - mutex_lock(&ddata->lock); - src->ops->dsi.bus_lock(src); - src->ops->dsi.bus_unlock(src); - mutex_unlock(&ddata->lock); - - dev_dbg(&ddata->dsi->dev, "sync done\n"); - - return 0; -} - static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable) { struct omap_dss_device *src = ddata->src; @@ -950,7 +933,6 @@ static const struct omap_dss_device_ops dsicm_ops = { static const struct omap_dss_driver dsicm_dss_driver = { .update = dsicm_update, - .sync = dsicm_sync, }; static int dsicm_probe_of(struct mipi_dsi_device *dsi) diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index e6832bf22ed0..2c6c32240e20 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -384,7 +384,6 @@ struct omap_dss_device { struct omap_dss_driver { int (*update)(struct omap_dss_device *dssdev, u16 x, u16 y, u16 w, u16 h); - int (*sync)(struct omap_dss_device *dssdev); }; struct dss_device *omapdss_get_dss(void); diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c index fce7e944a280..3f78ce2f85a1 100644 --- a/drivers/gpu/drm/omapdrm/omap_crtc.c +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c @@ -379,9 +379,6 @@ static void omap_crtc_manual_display_update(struct work_struct *data) return; } - if (dssdrv->sync) - dssdrv->sync(dssdev); - ret = dssdrv->update(dssdev, 0, 0, mode->hdisplay, mode->vdisplay); if (ret < 0) { spin_lock_irq(&dev->event_lock); -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 1/3] drm/omap: Prepare DSS for probing without legacy platform data
In order to probe display subsystem (DSS) components with ti-sysc interconnect target module without legacy platform data and using devicetree, we need to update dss probing a bit. In the device tree, we will be defining the data also for the interconnect target modules as DSS really is a private interconnect. There is some information about that in 4460 TRM in "Figure 10-3. DSS Integration" for example where it mentions "32-bit interconnect (SLX)". The changes we need to make are: 1. Parse also device tree subnodes for the compatible property fixup 2. Update the component code to consider device tree subnodes Cc: dri-devel@lists.freedesktop.org Cc: Jyri Sarha Cc: Laurent Pinchart Cc: Tomi Valkeinen Signed-off-by: Tony Lindgren --- This is needed for dropping DSS platform data that I'll be posting seprately. If this looks OK, can you guys please test and ack? --- drivers/gpu/drm/omapdrm/dss/dss.c | 25 --- .../gpu/drm/omapdrm/dss/omapdss-boot-init.c | 25 +-- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c --- a/drivers/gpu/drm/omapdrm/dss/dss.c +++ b/drivers/gpu/drm/omapdrm/dss/dss.c @@ -1339,9 +1339,15 @@ static int dss_component_compare(struct device *dev, void *data) return dev == child; } +struct dss_component_match_data { + struct device *dev; + struct component_match **match; +}; + static int dss_add_child_component(struct device *dev, void *data) { - struct component_match **match = data; + struct dss_component_match_data *cmatch = data; + struct component_match **match = cmatch->match; /* * HACK @@ -1352,7 +1358,17 @@ static int dss_add_child_component(struct device *dev, void *data) if (strstr(dev_name(dev), "rfbi")) return 0; - component_match_add(dev->parent, match, dss_component_compare, dev); + /* +* Handle possible interconnect target modules defined within the DSS. +* The DSS components can be children of an interconnect target module +* after the device tree has been updated for the module data. +* See also omapdss_boot_init() for compatible fixup. +*/ + if (strstr(dev_name(dev), "target-module")) + return device_for_each_child(dev, cmatch, +dss_add_child_component); + + component_match_add(cmatch->dev, match, dss_component_compare, dev); return 0; } @@ -1395,6 +1411,7 @@ static int dss_probe_hardware(struct dss_device *dss) static int dss_probe(struct platform_device *pdev) { const struct soc_device_attribute *soc; + struct dss_component_match_data cmatch; struct component_match *match = NULL; struct resource *dss_mem; struct dss_device *dss; @@ -1472,7 +1489,9 @@ static int dss_probe(struct platform_device *pdev) omapdss_gather_components(&pdev->dev); - device_for_each_child(&pdev->dev, &match, dss_add_child_component); + cmatch.dev = &pdev->dev; + cmatch.match = &match; + device_for_each_child(&pdev->dev, &cmatch, dss_add_child_component); r = component_master_add_with_match(&pdev->dev, &dss_component_ops, match); if (r) diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c b/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c --- a/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c +++ b/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c @@ -183,9 +183,24 @@ static const struct of_device_id omapdss_of_fixups_whitelist[] __initconst = { {}, }; +static void __init omapdss_find_children(struct device_node *np) +{ + struct device_node *child; + + for_each_available_child_of_node(np, child) { + if (!of_find_property(child, "compatible", NULL)) + continue; + + omapdss_walk_device(child, true); + + if (of_device_is_compatible(child, "ti,sysc")) + omapdss_find_children(child); + } +} + static int __init omapdss_boot_init(void) { - struct device_node *dss, *child; + struct device_node *dss; INIT_LIST_HEAD(&dss_conv_list); @@ -195,13 +210,7 @@ static int __init omapdss_boot_init(void) return 0; omapdss_walk_device(dss, true); - - for_each_available_child_of_node(dss, child) { - if (!of_find_property(child, "compatible", NULL)) - continue; - - omapdss_walk_device(child, true); - } + omapdss_find_children(dss); while (!list_empty(&dss_conv_list)) { struct dss_conv_node *n; -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCHv2 00/56] drm/omap: Convert DSI code to use drm_mipi_dsi and drm_panel
* Sebastian Reichel [200224 23:22]: > This updates the existing omapdrm DSI code, so that it uses > common drm_mipi_dsi API and drm_panel. > > The patchset has been tested with Droid 4 using Linux console, X.org and > Weston. The patchset is based on Laurent Pinchartl's patch series [0] > and removes the last custom panel driver, so quite a few cleanups on the > omapdrm codebase were possible. > > [0] [PATCH v7 00/54] drm/omap: Replace custom display drivers with drm_bridge > and drm_panel > > https://lore.kernel.org/dri-devel/20200222150106.22919-1-laurent.pinch...@ideasonboard.com/ > git://linuxtv.org/pinchartl/media.git omapdrm/bridge/devel > > I pushed this patchset into the following branch: > > git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-n900.git > omapdrm/bridge/devel-with-dsi I gave your omapdrm/bridge/devel-with-dsi branch a quirk test on droid4, but get the following oops with mostly modular omap2_defconfig. BTW, I think there's also some refcount issue in general where the omapdrm related modules cannot be unloaded any longer? Regards, Tony 8< - Internal error: Oops: 805 [#1] PREEMPT SMP ARM Modules linked in: omapdss(+) omapdss_base drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm drm_panel_ors CPU: 0 PID: 811 Comm: modprobe Not tainted 5.6.0-rc2-00376-g163017c12d62a #1926 Hardware name: Generic OMAP4 (Flattened Device Tree) PC is at drm_bridge_remove+0x24/0x40 [drm] LR is at drm_bridge_remove+0x14/0x40 [drm] pc : []lr : []psr: 6013 sp : edc6fc88 ip : eda3a100 fp : bf38a5b4 r10: bf38c7d0 r9 : edc164b8 r8 : edc1606c r7 : edc1647c r6 : edc93010 r5 : bf2dc428 r4 : edc164b8 r3 : edc164fc r2 : r1 : r0 : bf2dc428 Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none Control: 10c5387d Table: adc7404a DAC: 0051 Process modprobe (pid: 811, stack limit = 0x(ptrval)) Stack: (0xedc6fc88 to 0xedc7) fc80: edc16040 fdfb edc93010 bf37dfd0 0080 edc2eb00 fca0: edc16040 edc93010 edc93010 bf392178 bf392178 fcc0: 001e c0624424 edc93010 c0efafa0 c0efafa4 c06222e4 fce0: edc93010 bf392178 bf392178 c0622880 c06243a0 c06243dc c0e93210 c06225cc fd00: bf38c450 a013 bf38a5b4 edc93010 bf392178 c0622880 c06243a0 fd20: c06243dc c0622878 bf392178 edc93010 c06228d8 edc94fb4 edc6e000 fd40: bf392178 c062069c edc50eb8 ee8dae58 edc94fb4 d759a07d ee8dae6c bf392178 fd60: edc50e80 c0e93210 c0621618 bf38f0c0 bf3922c0 0006 bf392178 fd80: bf3922c0 0006 c0623db0 c062344c 0002 bf3922c0 0006 c06244fc fda0: bf38a5b0 bf38a5a8 000be666 c0ec0540 bf39a000 bf392308 0002 fdc0: edc2c300 c01dc694 edc6ff30 c0102fec c0ebbcf4 0cc0 c0d75a70 fde0: edc2c2c0 c02b4538 c0d75a70 a013 a013 0008 c01de5bc 0002 fe00: 0001 c01dc694 edc6ff30 d759a07d edbe7400 bf3922c0 0002 d759a07d fe20: bf392308 bf3922c0 edbe7400 edc2c2c0 bf392308 c01de5f8 0002 edc2c2c0 fe40: bf3922c0 0002 edc2c2c0 c01e0b1c bf3922cc 7fff bf3922c0 c01dd34c fe60: bf3a44ee 004c1a8f bf3922c0 bf3923d4 bf3924b8 c0a05fa8 bf38d075 fe80: 0001 c0bddd78 c0bc76d8 bf38a03c 0002 fea0: 6e72656b 6c65 fec0: fee0: d759a07d 7fff edc6e000 0003 004c1a8f 7fff ff00: 017b 004d56a0 c01e1050 7fff 0003 c093c724 ff20: 0002 f137 000e3464 f138b0c6 f138f3c0 f137 000e3464 ff40: f1452a3c f14527a4 f1425e58 00022000 00025680 a084 00027a0b ff60: a074 003e 003f 0021 0025 0018 ff80: d759a07d 004dcb80 64a54c46 b6f6a510 017b 017b c0101204 ffa0: edc6e000 c0101000 64a54c46 b6f6a510 0003 004c1a8f 004dcb80 ffc0: 64a54c46 b6f6a510 017b 017b 004dcb80 0001 004d56a0 ffe0: 004dcb80 bea7ba90 0043d1a9 b6f1d0b8 6030 0003 [] (drm_bridge_remove [drm]) from [] (dsi_probe+0x3ac/0x55c [omapdss]) [] (dsi_probe [omapdss]) from [] (platform_drv_probe+0x48/0x98) [] (platform_drv_probe) from [] (really_probe+0x1dc/0x340) [] (really_probe) from [] (driver_probe_device+0x5c/0x160) [] (driver_probe_device) from [] (device_driver_attach+0x58/0x60) [] (device_driver_attach) from [] (__driver_attach+0x58/0xcc) [] (__driver_attach) from [] (bus_for_each_dev+0x78/0xb8) [] (bus_for_each_dev) from [] (bus_add_driver+0xf0/0x1d4) [] (bus_add_driver) from [] (driver_register+0x74/0x108) [] (driver_register) from [] (__platform_register_drivers+0x54/0xd0) [] (__platform_register_drivers) from [] (do_one_initcall+0x44/0x2a8) [] (do_one_initcall) from [] (do_init_module+0x5c/0x234) [] (do_init_module) from [] (load_module+0x22c4/0x2580) [] (load_module) from [] (sys_finit_mo
[PATCHv2 21/56] drm/omap: dsi: drop unused enable_te()
enable_te() is not used, so the custom API can be dropped. Signed-off-by: Sebastian Reichel --- .../gpu/drm/omapdrm/displays/panel-dsi-cm.c | 39 --- drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 - 2 files changed, 41 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index e4b24c67c45d..64f493c722c0 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -882,43 +882,6 @@ static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable) return r; } -static int dsicm_enable_te(struct omap_dss_device *dssdev, bool enable) -{ - struct panel_drv_data *ddata = to_panel_data(dssdev); - struct omap_dss_device *src = ddata->src; - int r; - - mutex_lock(&ddata->lock); - - if (ddata->te_enabled == enable) - goto end; - - src->ops->dsi.bus_lock(src); - - if (ddata->enabled) { - r = dsicm_wake_up(ddata); - if (r) - goto err; - - r = _dsicm_enable_te(ddata, enable); - if (r) - goto err; - } - - ddata->te_enabled = enable; - - src->ops->dsi.bus_unlock(src); -end: - mutex_unlock(&ddata->lock); - - return 0; -err: - src->ops->dsi.bus_unlock(src); - mutex_unlock(&ddata->lock); - - return r; -} - static void dsicm_ulps_work(struct work_struct *work) { struct panel_drv_data *ddata = container_of(work, struct panel_drv_data, @@ -988,8 +951,6 @@ static const struct omap_dss_device_ops dsicm_ops = { static const struct omap_dss_driver dsicm_dss_driver = { .update = dsicm_update, .sync = dsicm_sync, - - .enable_te = dsicm_enable_te, }; static int dsicm_probe_of(struct mipi_dsi_device *dsi) diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index a1e78ba665d8..e6832bf22ed0 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -385,8 +385,6 @@ struct omap_dss_driver { int (*update)(struct omap_dss_device *dssdev, u16 x, u16 y, u16 w, u16 h); int (*sync)(struct omap_dss_device *dssdev); - - int (*enable_te)(struct omap_dss_device *dssdev, bool enable); }; struct dss_device *omapdss_get_dss(void); -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 03/56] Revert "drm/omap: dss: Remove unused omap_dss_device operations"
From: Sebastian Reichel This reverts commit 4ff8e98879e6eeae9d125dfcf3b642075d00089d. --- drivers/gpu/drm/omapdrm/dss/base.c | 26 +++ drivers/gpu/drm/omapdrm/dss/omapdss.h | 6 drivers/gpu/drm/omapdrm/omap_encoder.c | 44 +++--- 3 files changed, 71 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/base.c b/drivers/gpu/drm/omapdrm/dss/base.c index c7650a7c155d..455b410f7401 100644 --- a/drivers/gpu/drm/omapdrm/dss/base.c +++ b/drivers/gpu/drm/omapdrm/dss/base.c @@ -234,6 +234,18 @@ void omapdss_device_disconnect(struct omap_dss_device *src, } EXPORT_SYMBOL_GPL(omapdss_device_disconnect); +void omapdss_device_pre_enable(struct omap_dss_device *dssdev) +{ + if (!dssdev) + return; + + omapdss_device_pre_enable(dssdev->next); + + if (dssdev->ops && dssdev->ops->pre_enable) + dssdev->ops->pre_enable(dssdev); +} +EXPORT_SYMBOL_GPL(omapdss_device_pre_enable); + void omapdss_device_enable(struct omap_dss_device *dssdev) { if (!dssdev) @@ -260,6 +272,20 @@ void omapdss_device_disable(struct omap_dss_device *dssdev) } EXPORT_SYMBOL_GPL(omapdss_device_disable); +void omapdss_device_post_disable(struct omap_dss_device *dssdev) +{ + if (!dssdev) + return; + + if (dssdev->ops && dssdev->ops->post_disable) + dssdev->ops->post_disable(dssdev); + + omapdss_device_post_disable(dssdev->next); + + dssdev->state = OMAP_DSS_DISPLAY_DISABLED; +} +EXPORT_SYMBOL_GPL(omapdss_device_post_disable); + /* - * Components Handling */ diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index ab19d4af8de7..cbbe10b2b60d 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -342,11 +342,15 @@ struct omap_dss_device_ops { void (*disconnect)(struct omap_dss_device *dssdev, struct omap_dss_device *dst); + void (*pre_enable)(struct omap_dss_device *dssdev); void (*enable)(struct omap_dss_device *dssdev); void (*disable)(struct omap_dss_device *dssdev); + void (*post_disable)(struct omap_dss_device *dssdev); int (*check_timings)(struct omap_dss_device *dssdev, struct drm_display_mode *mode); + void (*set_timings)(struct omap_dss_device *dssdev, + const struct drm_display_mode *mode); int (*get_modes)(struct omap_dss_device *dssdev, struct drm_connector *connector); @@ -445,8 +449,10 @@ int omapdss_device_connect(struct dss_device *dss, struct omap_dss_device *dst); void omapdss_device_disconnect(struct omap_dss_device *src, struct omap_dss_device *dst); +void omapdss_device_pre_enable(struct omap_dss_device *dssdev); void omapdss_device_enable(struct omap_dss_device *dssdev); void omapdss_device_disable(struct omap_dss_device *dssdev); +void omapdss_device_post_disable(struct omap_dss_device *dssdev); int omap_dss_get_num_overlay_managers(void); diff --git a/drivers/gpu/drm/omapdrm/omap_encoder.c b/drivers/gpu/drm/omapdrm/omap_encoder.c index ae4b867a67a3..18a79dde6815 100644 --- a/drivers/gpu/drm/omapdrm/omap_encoder.c +++ b/drivers/gpu/drm/omapdrm/omap_encoder.c @@ -113,8 +113,13 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder, bus_flags = connector->display_info.bus_flags; omap_encoder_update_videomode_flags(&vm, bus_flags); - /* Set timings for the dss manager. */ + /* Set timings for all devices in the display pipeline. */ dss_mgr_set_timings(output, &vm); + + for (dssdev = output; dssdev; dssdev = dssdev->next) { + if (dssdev->ops && dssdev->ops->set_timings) + dssdev->ops->set_timings(dssdev, adjusted_mode); + } } static void omap_encoder_disable(struct drm_encoder *encoder) @@ -127,10 +132,26 @@ static void omap_encoder_disable(struct drm_encoder *encoder) /* * Disable the chain of external devices, starting at the one at the -* internal encoder's output. This is used for DSI outputs only, as -* dssdev->next is NULL for all other outputs. +* internal encoder's output. */ omapdss_device_disable(dssdev->next); + + /* +* Disable the internal encoder. This will disable the DSS output. The +* DSI is treated as an exception as DSI pipelines still use the legacy +* flow where the pipeline output controls the encoder. +*/ + if (dssdev->type != OMAP_DISPLAY_TYPE_DSI) { + if (dssdev->ops && dssdev->ops->disable) + dssdev->ops->disable(dssdev); + dssdev->state = OMAP_DSS_DISPLAY_DISABLED; + } + + /* +
Re: [PATCH 6/7] drm/sun4i: de2: Don't return de2_fmt_info struct
Hi, On Mon, Feb 24, 2020 at 06:39:00PM +0100, Jernej Skrabec wrote: > Now that de2_fmt_info contains only DRM <-> HW format mapping, it > doesn't make sense to return pointer to structure when searching by DRM > format. Rework that to return only HW format instead. > > This doesn't make any functional change. > > Signed-off-by: Jernej Skrabec > --- > drivers/gpu/drm/sun4i/sun8i_mixer.c| 15 +++ > drivers/gpu/drm/sun4i/sun8i_mixer.h| 7 +-- > drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 10 +- > drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 12 ++-- > 4 files changed, 23 insertions(+), 21 deletions(-) > > diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c > b/drivers/gpu/drm/sun4i/sun8i_mixer.c > index e078ec96de2d..56cc037fd312 100644 > --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c > +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c > @@ -27,6 +27,11 @@ > #include "sun8i_vi_layer.h" > #include "sunxi_engine.h" > > +struct de2_fmt_info { > + u32 drm_fmt; > + u32 de2_fmt; > +}; > + > static const struct de2_fmt_info de2_formats[] = { > { > .drm_fmt = DRM_FORMAT_ARGB, > @@ -230,15 +235,17 @@ static const struct de2_fmt_info de2_formats[] = { > }, > }; > > -const struct de2_fmt_info *sun8i_mixer_format_info(u32 format) > +int sun8i_mixer_drm_format_to_hw(u32 format, u32 *hw_format) > { > unsigned int i; > > for (i = 0; i < ARRAY_SIZE(de2_formats); ++i) > - if (de2_formats[i].drm_fmt == format) > - return &de2_formats[i]; > + if (de2_formats[i].drm_fmt == format) { > + *hw_format = de2_formats[i].de2_fmt; > + return 0; > + } > > - return NULL; > + return -EINVAL; > } I'm not too sure about that one. It breaks the consistency with the other functions, and I don't really see a particular benefit to it? The rest of the series is Acked-by: Maxime Ripard Maxime signature.asc Description: PGP signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 24/56] drm/omap: panel-dsi-cm: use bulk regulator API
Use bulk regulator API to simplify the code. This also switches from _optional variant to normal variant, which will provide a dummy regulator (i.e. if some always-enabled regulator is not described in DT). Signed-off-by: Sebastian Reichel --- .../gpu/drm/omapdrm/displays/panel-dsi-cm.c | 65 ++- 1 file changed, 21 insertions(+), 44 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 199eac88a777..8ad407a4072e 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -32,6 +32,8 @@ #define DCS_GET_ID20xdb #define DCS_GET_ID30xdc +#define DCS_REGULATOR_SUPPLY_NUM 2 + struct panel_drv_data { struct mipi_dsi_device *dsi; @@ -54,8 +56,7 @@ struct panel_drv_data { struct gpio_desc *reset_gpio; struct gpio_desc *ext_te_gpio; - struct regulator *vpnl; - struct regulator *vddi; + struct regulator_bulk_data supplies[DCS_REGULATOR_SUPPLY_NUM]; bool use_dsi_backlight; @@ -557,28 +558,16 @@ static int dsicm_power_on(struct panel_drv_data *ddata) .lp_clk_max = 1000, }; - if (ddata->vpnl) { - r = regulator_enable(ddata->vpnl); - if (r) { - dev_err(&ddata->dsi->dev, - "failed to enable VPNL: %d\n", r); - return r; - } - } - - if (ddata->vddi) { - r = regulator_enable(ddata->vddi); - if (r) { - dev_err(&ddata->dsi->dev, - "failed to enable VDDI: %d\n", r); - goto err_vpnl; - } + r = regulator_bulk_enable(DCS_REGULATOR_SUPPLY_NUM, ddata->supplies); + if (r) { + dev_err(&ddata->dsi->dev, "failed to enable supplies: %d\n", r); + return r; } r = src->ops->dsi.set_config(src, &dsi_config); if (r) { dev_err(&ddata->dsi->dev, "failed to configure DSI\n"); - goto err_vddi; + goto err_regulators; } src->ops->enable(src); @@ -637,12 +626,10 @@ static int dsicm_power_on(struct panel_drv_data *ddata) dsicm_hw_reset(ddata); src->ops->dsi.disable(src, true, false); -err_vddi: - if (ddata->vddi) - regulator_disable(ddata->vddi); -err_vpnl: - if (ddata->vpnl) - regulator_disable(ddata->vpnl); +err_regulators: + r = regulator_bulk_disable(DCS_REGULATOR_SUPPLY_NUM, ddata->supplies); + if (r) + dev_err(&ddata->dsi->dev, "failed to disable supplies: %d\n", r); return r; } @@ -666,10 +653,9 @@ static void dsicm_power_off(struct panel_drv_data *ddata) src->ops->dsi.disable(src, true, false); - if (ddata->vddi) - regulator_disable(ddata->vddi); - if (ddata->vpnl) - regulator_disable(ddata->vpnl); + r = regulator_bulk_disable(DCS_REGULATOR_SUPPLY_NUM, ddata->supplies); + if (r) + dev_err(&ddata->dsi->dev, "failed to disable supplies: %d\n", r); ddata->enabled = false; } @@ -973,21 +959,12 @@ static int dsicm_probe_of(struct mipi_dsi_device *dsi) ddata->height_mm = 0; of_property_read_u32(node, "height-mm", &ddata->height_mm); - ddata->vpnl = devm_regulator_get_optional(&dsi->dev, "vpnl"); - if (IS_ERR(ddata->vpnl)) { - err = PTR_ERR(ddata->vpnl); - if (err == -EPROBE_DEFER) - return err; - ddata->vpnl = NULL; - } - - ddata->vddi = devm_regulator_get_optional(&dsi->dev, "vddi"); - if (IS_ERR(ddata->vddi)) { - err = PTR_ERR(ddata->vddi); - if (err == -EPROBE_DEFER) - return err; - ddata->vddi = NULL; - } + ddata->supplies[0].supply = "vpnl"; + ddata->supplies[1].supply = "vddi"; + err = devm_regulator_bulk_get(&dsi->dev, DCS_REGULATOR_SUPPLY_NUM, + ddata->supplies); + if (err) + return err; backlight = of_parse_phandle(node, "backlight", 0); if (backlight) { -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] RFC: drm/virtio: Dummy virtio GPU
The idea here is: if we run the vm headless, we don't really need to communicate with VMM, and we even don't need any VMM support for virtio-gpu. Of course, only 2d works. But it's enough for some use case. And this looks simpler than vkms. Signed-off-by: Lepton Wu --- drivers/gpu/drm/virtio/Kconfig | 9 ++ drivers/gpu/drm/virtio/Makefile| 3 + drivers/gpu/drm/virtio/virtgpu_dummy.c | 161 + 3 files changed, 173 insertions(+) create mode 100644 drivers/gpu/drm/virtio/virtgpu_dummy.c diff --git a/drivers/gpu/drm/virtio/Kconfig b/drivers/gpu/drm/virtio/Kconfig index eff3047052d4..9c18aace38ed 100644 --- a/drivers/gpu/drm/virtio/Kconfig +++ b/drivers/gpu/drm/virtio/Kconfig @@ -9,3 +9,12 @@ config DRM_VIRTIO_GPU QEMU based VMMs (like KVM or Xen). If unsure say M. + +config DRM_VIRTIO_GPU_DUMMY + tristate "Virtio dummy GPU driver" + depends on DRM_VIRTIO_GPU + help + This add a new virtio GPU device which handles the virtio ring buffers + inline so it doesn't rely on VMM to provide the virtio GPU device. + Currently it only handle VIRTIO_GPU_CMD_GET_DISPLAY_INFO which is enough + for a dummy 2D VGA device. diff --git a/drivers/gpu/drm/virtio/Makefile b/drivers/gpu/drm/virtio/Makefile index 92aa2b3d349d..26d8fee1bc41 100644 --- a/drivers/gpu/drm/virtio/Makefile +++ b/drivers/gpu/drm/virtio/Makefile @@ -8,4 +8,7 @@ virtio-gpu-y := virtgpu_drv.o virtgpu_kms.o virtgpu_gem.o \ virtgpu_fence.o virtgpu_object.o virtgpu_debugfs.o virtgpu_plane.o \ virtgpu_ioctl.o virtgpu_prime.o virtgpu_trace_points.o +virtio-gpu-dummy-y := virtgpu_dummy.o + obj-$(CONFIG_DRM_VIRTIO_GPU) += virtio-gpu.o +obj-$(CONFIG_DRM_VIRTIO_GPU_DUMMY) += virtio-gpu-dummy.o diff --git a/drivers/gpu/drm/virtio/virtgpu_dummy.c b/drivers/gpu/drm/virtio/virtgpu_dummy.c new file mode 100644 index ..8c2eb6fea47c --- /dev/null +++ b/drivers/gpu/drm/virtio/virtgpu_dummy.c @@ -0,0 +1,161 @@ +#include +#include +#include +#include +#include +#include + +#include "virtgpu_drv.h" + +static int virtgpu_dummy_width = 1024; +static int virtgpu_dummy_height = 768; + +MODULE_PARM_DESC(width, "Dummy VGA width"); +module_param_named(width, virtgpu_dummy_width, int, 0400); +MODULE_PARM_DESC(height, "Dummy VGA height"); +module_param_named(height, virtgpu_dummy_height, int, 0400); + +static struct bus_type dummy_bus = { + .name = "", +}; + +static struct dummy_gpu { + struct device *root; + struct virtio_device vdev; + unsigned char status; +} dummy; + +static u64 dummy_get_features(struct virtio_device *vdev) +{ + return 1ULL << VIRTIO_F_VERSION_1; +} + +static int dummy_finalize_features(struct virtio_device *vdev) +{ + return 0; +} + +static void dummy_get(struct virtio_device *vdev, unsigned int offset, + void *buf, unsigned len) +{ + static struct virtio_gpu_config config = { + .num_scanouts = 1, + }; + BUG_ON(offset + len > sizeof(config)); + memcpy(buf, (char *)&config + offset, len); +} + +static u8 dummy_get_status(struct virtio_device *vdev) +{ + struct dummy_gpu* gpu = container_of(vdev, struct dummy_gpu, vdev); + return gpu->status; +} + +static void dummy_set_status(struct virtio_device *vdev, u8 status) +{ + struct dummy_gpu* gpu = container_of(vdev, struct dummy_gpu, vdev); + BUG_ON(!status); + gpu->status = status; +} + +void process_cmd(struct vring_desc *desc, int idx) +{ + // FIXME, use chain to get resp buffer addr + char *buf = __va(desc[idx].addr); + struct virtio_gpu_vbuffer *vbuf = + (struct virtio_gpu_vbuffer *)(buf - sizeof(*vbuf)); + struct virtio_gpu_ctrl_hdr *cmd_p = (struct virtio_gpu_ctrl_hdr *)buf; + struct virtio_gpu_resp_display_info *resp; + BUG_ON(vbuf->buf != buf); + if (cmd_p->type != cpu_to_le32(VIRTIO_GPU_CMD_GET_DISPLAY_INFO)) + return; + BUG_ON(vbuf->resp_size != sizeof(struct virtio_gpu_resp_display_info)); + resp = (struct virtio_gpu_resp_display_info *)vbuf->resp_buf; + resp->pmodes[0].r.width = virtgpu_dummy_width; + resp->pmodes[0].r.height = virtgpu_dummy_height; + resp->pmodes[0].enabled = 1; +} + +static bool dummy_notify(struct virtqueue *vq) +{ + struct vring *r = (struct vring *)(vq + 1); + int used, avail; + // FIXME, handle multiple avail and also fix for big endian. + used = r->used->idx & (r->num - 1); + avail = (r->avail->idx - 1) & (r->num - 1); + r->used->ring[used].id = r->avail->ring[avail]; + r->used->idx++; + if (!strcmp(vq->name, "control")) + process_cmd(r->desc, r->avail->ring[avail]); + vq->callback(vq); + return true; +} + +static int dummy_find_vqs(struct virtio_device *vdev, unsigned nvqs, + struct virtqueue *vqs[], +
[PATCHv2 31/56] drm/omap: dsi: do ULPS in host driver
Move ULPS handling into the DSI host controller, so that we no longer need a custom API for the DSI client. Signed-off-by: Sebastian Reichel --- .../gpu/drm/omapdrm/displays/panel-dsi-cm.c | 273 +- drivers/gpu/drm/omapdrm/dss/dsi.c | 61 +++- drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 - 3 files changed, 62 insertions(+), 274 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 239a48910db7..1e33cf7c1448 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include @@ -69,21 +68,13 @@ struct panel_drv_data { bool intro_printed; - struct workqueue_struct *workqueue; - bool ulps_enabled; - unsigned int ulps_timeout; - struct delayed_work ulps_work; }; #define to_panel_data(p) container_of(p, struct panel_drv_data, dssdev) static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable); -static int dsicm_panel_reset(struct panel_drv_data *ddata); - -static void dsicm_ulps_work(struct work_struct *work); - static void dsicm_bl_power(struct panel_drv_data *ddata, bool enable) { struct backlight_device *backlight; @@ -207,94 +198,6 @@ static int dsicm_set_update_window(struct panel_drv_data *ddata, return 0; } -static void dsicm_queue_ulps_work(struct panel_drv_data *ddata) -{ - if (ddata->ulps_timeout > 0) - queue_delayed_work(ddata->workqueue, &ddata->ulps_work, - msecs_to_jiffies(ddata->ulps_timeout)); -} - -static void dsicm_cancel_ulps_work(struct panel_drv_data *ddata) -{ - cancel_delayed_work(&ddata->ulps_work); -} - -static int dsicm_enter_ulps(struct panel_drv_data *ddata) -{ - struct omap_dss_device *src = ddata->src; - int r; - - if (ddata->ulps_enabled) - return 0; - - dsicm_cancel_ulps_work(ddata); - - r = _dsicm_enable_te(ddata, false); - if (r) - goto err; - - src->ops->dsi.ulps(src, true); - - ddata->ulps_enabled = true; - - return 0; - -err: - dev_err(&ddata->dsi->dev, "enter ULPS failed"); - dsicm_panel_reset(ddata); - - ddata->ulps_enabled = false; - - dsicm_queue_ulps_work(ddata); - - return r; -} - -static int dsicm_exit_ulps(struct panel_drv_data *ddata) -{ - struct omap_dss_device *src = ddata->src; - int r; - - if (!ddata->ulps_enabled) - return 0; - - src->ops->dsi.ulps(src, false); - ddata->dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; - - r = _dsicm_enable_te(ddata, ddata->te_enabled); - if (r) { - dev_err(&ddata->dsi->dev, "failed to re-enable TE"); - goto err2; - } - - dsicm_queue_ulps_work(ddata); - - ddata->ulps_enabled = false; - - return 0; - -err2: - dev_err(&ddata->dsi->dev, "failed to exit ULPS"); - - r = dsicm_panel_reset(ddata); - if (!r) - ddata->ulps_enabled = false; - - dsicm_queue_ulps_work(ddata); - - return r; -} - -static int dsicm_wake_up(struct panel_drv_data *ddata) -{ - if (ddata->ulps_enabled) - return dsicm_exit_ulps(ddata); - - dsicm_cancel_ulps_work(ddata); - dsicm_queue_ulps_work(ddata); - return 0; -} - static int dsicm_bl_update_status(struct backlight_device *dev) { struct panel_drv_data *ddata = dev_get_drvdata(&dev->dev); @@ -312,11 +215,8 @@ static int dsicm_bl_update_status(struct backlight_device *dev) mutex_lock(&ddata->lock); if (ddata->enabled) { - r = dsicm_wake_up(ddata); - if (!r) { - r = dsicm_dcs_write_1(ddata, - MIPI_DCS_SET_DISPLAY_BRIGHTNESS, level); - } + r = dsicm_dcs_write_1(ddata, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, + level); } mutex_unlock(&ddata->lock); @@ -343,18 +243,12 @@ static ssize_t dsicm_num_errors_show(struct device *dev, { struct panel_drv_data *ddata = dev_get_drvdata(dev); u8 errors = 0; - int r; + int r = -ENODEV; mutex_lock(&ddata->lock); - if (ddata->enabled) { - r = dsicm_wake_up(ddata); - if (!r) - r = dsicm_dcs_read_1(ddata, DCS_READ_NUM_ERRORS, - &errors); - } else { - r = -ENODEV; - } + if (ddata->enabled) + r = dsicm_dcs_read_1(ddata, DCS_READ_NUM_ERRORS, &errors); mutex_unlock(&ddata->lock); @@ -369,17 +263,12 @@ static ssize_t dsicm_hw_revision_show(struct device *dev, { struct panel_drv_data *ddata = dev_get_drvdata(dev); u8 id1, id2, id3; -
Re: [PATCH] drm/hisilicon: Set preferred mode resolution and maximum resolution
On Wed, 19 Feb 2020 at 10:52, Tian Tao wrote: > set the preferred mode resolution to 1024 * 768 and maximum > resolution to 1920 * 1200. > > Signed-off-by: Tian Tao > Signed-off-by: Gong junjie > --- > drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 10 +- > 1 file changed, 9 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 6d98fdc..82fc7d3 100644 > --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c > +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c > @@ -11,8 +11,10 @@ > * Jianhua Li > */ > > +#include > #include > #include > +#include > #include > > #include "hibmc_drm_drv.h" > @@ -20,7 +22,13 @@ > > static int hibmc_connector_get_modes(struct drm_connector *connector) > { > - return drm_add_modes_noedid(connector, 800, 600); > + int count; > + > + drm_connector_update_edid_property(connector, NULL); > + count = drm_add_modes_noedid(connector, 1920, 1200); > Hi Tao, maybe it's better like this: count = drm_add_modes_noedid( connector , conn->dev->mode_config.max_width, conn->dev->mode_config.max_height); > + drm_set_preferred_mode(connector, 1024, 768); > + > + return count; > } > > static enum drm_mode_status hibmc_connector_mode_valid(struct > drm_connector *connector, > -- > 2.7.4 > > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 37/56] drm/omap: dsi: implement check timings
Implement check timings, which will check if its possible to configure the clocks for the provided mode using the same code as the set_config() hook. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/dss/dsi.c | 70 +++ 1 file changed, 44 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index a399d6857c0d..acbfffe83b3e 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -283,6 +283,11 @@ struct dsi_isr_tables { struct dsi_isr_data isr_table_cio[DSI_MAX_NR_ISRS]; }; +struct dsi_lp_clock_info { + unsigned long lp_clk; + u16 lp_clk_div; +}; + struct dsi_clk_calc_ctx { struct dsi_data *dsi; struct dss_pll *pll; @@ -297,16 +302,12 @@ struct dsi_clk_calc_ctx { struct dss_pll_clock_info dsi_cinfo; struct dispc_clock_info dispc_cinfo; + struct dsi_lp_clock_info user_lp_cinfo; struct videomode vm; struct omap_dss_dsi_videomode_timings dsi_vm; }; -struct dsi_lp_clock_info { - unsigned long lp_clk; - u16 lp_clk_div; -}; - struct dsi_module_id_data { u32 address; int id; @@ -4794,44 +4795,55 @@ static bool dsi_is_video_mode(struct omap_dss_device *dssdev) return (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE); } -static int dsi_set_config(struct omap_dss_device *dssdev, - const struct drm_display_mode *mode) +static int __dsi_calc_config(struct dsi_data *dsi, + const struct drm_display_mode *mode, + struct dsi_clk_calc_ctx *ctx) { - struct dsi_data *dsi = to_dsi_data(dssdev); - struct dsi_clk_calc_ctx ctx; - struct videomode vm; struct omap_dss_dsi_config cfg = dsi->config; + struct videomode vm; bool ok; int r; drm_display_mode_to_videomode(mode, &vm); - cfg.vm = &vm; - - mutex_lock(&dsi->lock); + cfg.vm = &vm; cfg.mode = dsi->mode; cfg.pixel_format = dsi->pix_fmt; if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) - ok = dsi_vm_calc(dsi, &cfg, &ctx); + ok = dsi_vm_calc(dsi, &cfg, ctx); else - ok = dsi_cm_calc(dsi, &cfg, &ctx); + ok = dsi_cm_calc(dsi, &cfg, ctx); - if (!ok) { - DSSERR("failed to find suitable DSI clock settings\n"); - r = -EINVAL; - goto err; - } + if (!ok) + return -EINVAL; + + dsi_pll_calc_dsi_fck(dsi, &ctx->dsi_cinfo); - dsi_pll_calc_dsi_fck(dsi, &ctx.dsi_cinfo); + r = dsi_lp_clock_calc(ctx->dsi_cinfo.clkout[HSDIV_DSI], + cfg.lp_clk_min, cfg.lp_clk_max, &ctx->user_lp_cinfo); + if (r) + return r; + + return 0; +} - r = dsi_lp_clock_calc(ctx.dsi_cinfo.clkout[HSDIV_DSI], - cfg.lp_clk_min, cfg.lp_clk_max, &dsi->user_lp_cinfo); +static int dsi_set_config(struct omap_dss_device *dssdev, + const struct drm_display_mode *mode) +{ + struct dsi_data *dsi = to_dsi_data(dssdev); + struct dsi_clk_calc_ctx ctx; + int r; + + mutex_lock(&dsi->lock); + + r = __dsi_calc_config(dsi, mode, &ctx); if (r) { - DSSERR("failed to find suitable DSI LP clock settings\n"); + DSSERR("failed to find suitable DSI clock settings\n"); goto err; } + dsi->user_lp_cinfo = ctx.user_lp_cinfo; dsi->user_dsi_cinfo = ctx.dsi_cinfo; dsi->user_dispc_cinfo = ctx.dispc_cinfo; @@ -5008,11 +5020,17 @@ static void dsi_set_timings(struct omap_dss_device *dssdev, static int dsi_check_timings(struct omap_dss_device *dssdev, struct drm_display_mode *mode) { + struct dsi_data *dsi = to_dsi_data(dssdev); + struct dsi_clk_calc_ctx ctx; + int r; + DSSDBG("dsi_check_timings\n"); - /* TODO */ + mutex_lock(&dsi->lock); + r = __dsi_calc_config(dsi, mode, &ctx); + mutex_unlock(&dsi->lock); - return 0; + return r; } static int dsi_connect(struct omap_dss_device *src, -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 45/56] drm/omap: dsi: Register a drm_bridge
In order to integrate with a chain of drm_bridge, the internal DSI output has to expose its operations through the drm_bridge API. Register a bridge at initialisation time to do so and remove the omap_dss_device operations that are now unused. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/dss/dsi.c | 128 +++--- 1 file changed, 83 insertions(+), 45 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index f629e6b1025b..0d6162875b30 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -36,6 +36,7 @@ #include #include +#include #include #include @@ -440,6 +441,7 @@ struct dsi_data { struct omap_dss_dsi_videomode_timings vm_timings; struct omap_dss_device output; + struct drm_bridge bridge; }; struct dsi_packet_sent_handler_data { @@ -452,6 +454,9 @@ static bool dsi_perf; module_param(dsi_perf, bool, 0644); #endif +#define drm_bridge_to_dsi(bridge) \ + container_of(bridge, struct dsi_data, bridge) + static inline struct dsi_data *to_dsi_data(struct omap_dss_device *dssdev) { return dev_get_drvdata(dssdev->dev); @@ -5010,50 +5015,7 @@ static int dsi_get_clocks(struct dsi_data *dsi) return 0; } -static void dsi_set_timings(struct omap_dss_device *dssdev, - const struct drm_display_mode *mode) -{ - DSSDBG("dsi_set_timings\n"); - dsi_set_config(dssdev, mode); -} - -static int dsi_check_timings(struct omap_dss_device *dssdev, -struct drm_display_mode *mode) -{ - struct dsi_data *dsi = to_dsi_data(dssdev); - struct dsi_clk_calc_ctx ctx; - int r; - - DSSDBG("dsi_check_timings\n"); - - mutex_lock(&dsi->lock); - r = __dsi_calc_config(dsi, mode, &ctx); - mutex_unlock(&dsi->lock); - - return r; -} - -static int dsi_connect(struct omap_dss_device *src, - struct omap_dss_device *dst) -{ - return omapdss_device_connect(dst->dss, dst, dst->next); -} - -static void dsi_disconnect(struct omap_dss_device *src, - struct omap_dss_device *dst) -{ - omapdss_device_disconnect(dst, dst->next); -} - static const struct omap_dss_device_ops dsi_ops = { - .connect = dsi_connect, - .disconnect = dsi_disconnect, - .enable = dsi_enable_video_outputs, - .disable = dsi_disable_video_outputs, - - .check_timings = dsi_check_timings, - .set_timings = dsi_set_timings, - .dsi = { .update = dsi_update_all, .is_video_mode = dsi_is_video_mode, @@ -5394,6 +5356,77 @@ static const struct component_ops dsi_component_ops = { .unbind = dsi_unbind, }; +/* - + * DRM Bridge Operations + */ + +static int dsi_bridge_attach(struct drm_bridge *bridge, +enum drm_bridge_attach_flags flags) +{ + struct dsi_data *dsi = drm_bridge_to_dsi(bridge); + + if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) + return -EINVAL; + + return drm_bridge_attach(bridge->encoder, dsi->output.next_bridge, +bridge, flags); +} + +static enum drm_mode_status +dsi_bridge_mode_valid(struct drm_bridge *bridge, + const struct drm_display_mode *mode) +{ + struct dsi_data *dsi = drm_bridge_to_dsi(bridge); + struct dsi_clk_calc_ctx ctx; + int r; + + mutex_lock(&dsi->lock); + r = __dsi_calc_config(dsi, mode, &ctx); + mutex_unlock(&dsi->lock); + + return r ? MODE_CLOCK_RANGE : MODE_OK; +} + +static void dsi_bridge_mode_set(struct drm_bridge *bridge, + const struct drm_display_mode *mode, + const struct drm_display_mode *adjusted_mode) +{ + struct dsi_data *dsi = drm_bridge_to_dsi(bridge); + dsi_set_config(&dsi->output, adjusted_mode); +} + +static void dsi_bridge_enable(struct drm_bridge *bridge) +{ + struct dsi_data *dsi = drm_bridge_to_dsi(bridge); + dsi_enable_video_outputs(&dsi->output); +} + +static void dsi_bridge_disable(struct drm_bridge *bridge) +{ + struct dsi_data *dsi = drm_bridge_to_dsi(bridge); + dsi_disable_video_outputs(&dsi->output); +} + +static const struct drm_bridge_funcs dsi_bridge_funcs = { + .attach = dsi_bridge_attach, + .mode_valid = dsi_bridge_mode_valid, + .mode_set = dsi_bridge_mode_set, + .enable = dsi_bridge_enable, + .disable = dsi_bridge_disable, +}; + +static void dsi_bridge_init(struct dsi_data *dsi) +{ + dsi->bridge.funcs = &dsi_bridge_funcs; + dsi->bridge.of_node = dsi->host.dev->of_node; + dsi->bridge.type = DRM_MODE_CONNECTOR_DSI; +} + +static void dsi_bridge_cleanup(struct dsi_data *dsi) +{ + drm_bridge_remove(&dsi->bridge); +} + /* ---
[PATCHv2 53/56] drm/omap: simplify DSI manual update code
Move dsi_ops into the main structure, since all other ops are gone. Instead of checking the device type we can simply check if dsi_ops are set. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/dss/dsi.c | 10 -- drivers/gpu/drm/omapdrm/dss/omapdss.h | 6 +- drivers/gpu/drm/omapdrm/omap_crtc.c | 16 3 files changed, 9 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index 0d6162875b30..e8924af4c30f 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -5015,11 +5015,9 @@ static int dsi_get_clocks(struct dsi_data *dsi) return 0; } -static const struct omap_dss_device_ops dsi_ops = { - .dsi = { - .update = dsi_update_all, - .is_video_mode = dsi_is_video_mode, - }, +static const struct omapdss_dsi_ops dsi_ops = { + .update = dsi_update_all, + .is_video_mode = dsi_is_video_mode, }; static irqreturn_t omap_dsi_te_irq_handler(int irq, void *dev_id) @@ -5445,7 +5443,7 @@ static int dsi_init_output(struct dsi_data *dsi) out->type = OMAP_DISPLAY_TYPE_DSI; out->name = dsi->module_id == 0 ? "dsi.0" : "dsi.1"; out->dispc_channel = dsi_get_channel(dsi); - out->ops = &dsi_ops; + out->dsi_ops = &dsi_ops; out->owner = THIS_MODULE; out->of_port = 0; out->bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index 4ad1b63c1b07..fb045eca03a6 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -274,10 +274,6 @@ struct omapdss_dsi_ops { bool (*is_video_mode)(struct omap_dss_device *dssdev); }; -struct omap_dss_device_ops { - const struct omapdss_dsi_ops dsi; -}; - struct omap_dss_device { struct device *dev; @@ -299,7 +295,7 @@ struct omap_dss_device { const char *name; - const struct omap_dss_device_ops *ops; + const struct omapdss_dsi_ops *dsi_ops; u32 bus_flags; /* OMAP DSS output specific fields */ diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c index af62f6075602..e94b69871a32 100644 --- a/drivers/gpu/drm/omapdrm/omap_crtc.c +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c @@ -366,17 +366,10 @@ static void omap_crtc_manual_display_update(struct work_struct *data) struct drm_device *dev = omap_crtc->base.dev; int ret; - if (!dssdev) { - dev_err_once(dev->dev, "missing display dssdev!"); + if (!dssdev || !dssdev->dsi_ops || !dssdev->dsi_ops->update) return; - } - - if (dssdev->type != OMAP_DISPLAY_TYPE_DSI || !dssdev->ops->dsi.update) { - dev_err_once(dev->dev, "no DSI update callback found!"); - return; - } - ret = dssdev->ops->dsi.update(dssdev); + ret = dssdev->dsi_ops->update(dssdev); if (ret < 0) { spin_lock_irq(&dev->event_lock); omap_crtc->pending = false; @@ -549,11 +542,10 @@ static bool omap_crtc_is_manually_updated(struct drm_crtc *crtc) struct omap_crtc *omap_crtc = to_omap_crtc(crtc); struct omap_dss_device *dssdev = omap_crtc->pipe->output; - if (dssdev->type != OMAP_DISPLAY_TYPE_DSI || - !dssdev->ops->dsi.is_video_mode) + if (!dssdev || !dssdev->dsi_ops || !dssdev->dsi_ops->is_video_mode) return false; - if (dssdev->ops->dsi.is_video_mode(dssdev)) + if (dssdev->dsi_ops->is_video_mode(dssdev)) return false; DBG("detected manually updated display!"); -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 6/7] drm/sun4i: de2: Don't return de2_fmt_info struct
Now that de2_fmt_info contains only DRM <-> HW format mapping, it doesn't make sense to return pointer to structure when searching by DRM format. Rework that to return only HW format instead. This doesn't make any functional change. Signed-off-by: Jernej Skrabec --- drivers/gpu/drm/sun4i/sun8i_mixer.c| 15 +++ drivers/gpu/drm/sun4i/sun8i_mixer.h| 7 +-- drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 10 +- drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 12 ++-- 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c index e078ec96de2d..56cc037fd312 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c @@ -27,6 +27,11 @@ #include "sun8i_vi_layer.h" #include "sunxi_engine.h" +struct de2_fmt_info { + u32 drm_fmt; + u32 de2_fmt; +}; + static const struct de2_fmt_info de2_formats[] = { { .drm_fmt = DRM_FORMAT_ARGB, @@ -230,15 +235,17 @@ static const struct de2_fmt_info de2_formats[] = { }, }; -const struct de2_fmt_info *sun8i_mixer_format_info(u32 format) +int sun8i_mixer_drm_format_to_hw(u32 format, u32 *hw_format) { unsigned int i; for (i = 0; i < ARRAY_SIZE(de2_formats); ++i) - if (de2_formats[i].drm_fmt == format) - return &de2_formats[i]; + if (de2_formats[i].drm_fmt == format) { + *hw_format = de2_formats[i].de2_fmt; + return 0; + } - return NULL; + return -EINVAL; } static void sun8i_mixer_commit(struct sunxi_engine *engine) diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.h b/drivers/gpu/drm/sun4i/sun8i_mixer.h index 0dd4a347fa06..7576b523fdbb 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.h +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.h @@ -143,11 +143,6 @@ #define SUN50I_MIXER_CDC0_EN 0xd #define SUN50I_MIXER_CDC1_EN 0xd8000 -struct de2_fmt_info { - u32 drm_fmt; - u32 de2_fmt; -}; - /** * struct sun8i_mixer_cfg - mixer HW configuration * @vi_num: number of VI channels @@ -207,5 +202,5 @@ sun8i_channel_base(struct sun8i_mixer *mixer, int channel) return DE2_CH_BASE + channel * DE2_CH_SIZE; } -const struct de2_fmt_info *sun8i_mixer_format_info(u32 format); +int sun8i_mixer_drm_format_to_hw(u32 format, u32 *hw_format); #endif /* _SUN8I_MIXER_H_ */ diff --git a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c index 99ee19a00415..a64aaea1ba74 100644 --- a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c +++ b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c @@ -174,20 +174,20 @@ static int sun8i_ui_layer_update_formats(struct sun8i_mixer *mixer, int channel, int overlay, struct drm_plane *plane) { struct drm_plane_state *state = plane->state; - const struct de2_fmt_info *fmt_info; const struct drm_format_info *fmt; - u32 val, ch_base; + u32 val, ch_base, hw_fmt; + int ret; ch_base = sun8i_channel_base(mixer, channel); fmt = state->fb->format; - fmt_info = sun8i_mixer_format_info(fmt->format); - if (!fmt_info || fmt->is_yuv) { + ret = sun8i_mixer_drm_format_to_hw(fmt->format, &hw_fmt); + if (ret || fmt->is_yuv) { DRM_DEBUG_DRIVER("Invalid format\n"); return -EINVAL; } - val = fmt_info->de2_fmt << SUN8I_MIXER_CHAN_UI_LAYER_ATTR_FBFMT_OFFSET; + val = hw_fmt << SUN8I_MIXER_CHAN_UI_LAYER_ATTR_FBFMT_OFFSET; regmap_update_bits(mixer->engine.regs, SUN8I_MIXER_CHAN_UI_LAYER_ATTR(ch_base, overlay), SUN8I_MIXER_CHAN_UI_LAYER_ATTR_FBFMT_MASK, val); diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c index d783c2bfc77e..b1e1ba2da663 100644 --- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c +++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c @@ -231,20 +231,20 @@ static int sun8i_vi_layer_update_formats(struct sun8i_mixer *mixer, int channel, int overlay, struct drm_plane *plane) { struct drm_plane_state *state = plane->state; - const struct de2_fmt_info *fmt_info; + u32 val, ch_base, csc_mode, hw_fmt; const struct drm_format_info *fmt; - u32 val, ch_base, csc_mode; + int ret; ch_base = sun8i_channel_base(mixer, channel); fmt = state->fb->format; - fmt_info = sun8i_mixer_format_info(fmt->format); - if (!fmt_info) { + ret = sun8i_mixer_drm_format_to_hw(fmt->format, &hw_fmt); + if (ret) { DRM_DEBUG_DRIVER("Invalid format\n"); - return -EINVAL; + return ret; } - val = fmt_info->de2_fmt << SUN8I_MIXER_CHAN_VI_LAYER_ATTR_FBFM
[PATCHv2 52/56] drm/omap: drop dssdev display field
All displays are using drm_panel instead off dssdev now, so this field is always 0 and can be dropped. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/dss/base.c| 2 +- drivers/gpu/drm/omapdrm/dss/omapdss.h | 6 -- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/base.c b/drivers/gpu/drm/omapdrm/dss/base.c index d62713b241d2..d9a5e7b9d401 100644 --- a/drivers/gpu/drm/omapdrm/dss/base.c +++ b/drivers/gpu/drm/omapdrm/dss/base.c @@ -198,7 +198,7 @@ void omapdss_device_disconnect(struct omap_dss_device *src, } if (!dst->id && !omapdss_device_is_connected(dst)) { - WARN_ON(!dst->display); + WARN_ON(1); return; } diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index 0ee042228c96..4ad1b63c1b07 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -297,12 +297,6 @@ struct omap_dss_device { */ enum omap_display_type type; - /* -* True if the device is a display (panel or connector) at the end of -* the pipeline, false otherwise. -*/ - bool display; - const char *name; const struct omap_dss_device_ops *ops; -- 2.25.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCHv2 29/56] drm/omap: dsi: untangle ulps ops from enable/disable
Create a custom function pointer for ULPS and use it instead of reusing disable/enable functions for ULPS mode switch. This allows us to use the common disable/enable functions pointers for DSI. Signed-off-by: Sebastian Reichel --- .../gpu/drm/omapdrm/displays/panel-dsi-cm.c | 8 ++-- drivers/gpu/drm/omapdrm/dss/dsi.c | 38 ++- drivers/gpu/drm/omapdrm/dss/omapdss.h | 5 +-- 3 files changed, 34 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 42a4a69b03fd..239a48910db7 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -233,7 +233,7 @@ static int dsicm_enter_ulps(struct panel_drv_data *ddata) if (r) goto err; - src->ops->dsi.disable(src, false, true); + src->ops->dsi.ulps(src, true); ddata->ulps_enabled = true; @@ -258,7 +258,7 @@ static int dsicm_exit_ulps(struct panel_drv_data *ddata) if (!ddata->ulps_enabled) return 0; - src->ops->enable(src); + src->ops->dsi.ulps(src, false); ddata->dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; r = _dsicm_enable_te(ddata, ddata->te_enabled); @@ -586,7 +586,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata) dsicm_hw_reset(ddata); - src->ops->dsi.disable(src, true, false); + src->ops->disable(src); err_regulators: r = regulator_bulk_disable(DCS_REGULATOR_SUPPLY_NUM, ddata->supplies); if (r) @@ -612,7 +612,7 @@ static void dsicm_power_off(struct panel_drv_data *ddata) dsicm_hw_reset(ddata); } - src->ops->dsi.disable(src, true, false); + src->ops->disable(src); r = regulator_bulk_disable(DCS_REGULATOR_SUPPLY_NUM, ddata->supplies); if (r) diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index ce45021c99ce..684d52079e89 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -4062,13 +4062,10 @@ static void dsi_display_uninit_dsi(struct dsi_data *dsi, bool disconnect_lanes, } } -static void dsi_display_enable(struct omap_dss_device *dssdev) +static void dsi_display_ulps_enable(struct dsi_data *dsi) { - struct dsi_data *dsi = to_dsi_data(dssdev); int r; - DSSDBG("dsi_display_enable\n"); - WARN_ON(!dsi_bus_is_locked(dsi)); mutex_lock(&dsi->lock); @@ -4091,16 +4088,19 @@ static void dsi_display_enable(struct omap_dss_device *dssdev) dsi_runtime_put(dsi); err_get_dsi: mutex_unlock(&dsi->lock); - DSSDBG("dsi_display_enable FAILED\n"); + DSSDBG("dsi_display_ulps_enable FAILED\n"); } -static void dsi_display_disable(struct omap_dss_device *dssdev, - bool disconnect_lanes, bool enter_ulps) +static void dsi_display_enable(struct omap_dss_device *dssdev) { struct dsi_data *dsi = to_dsi_data(dssdev); + DSSDBG("dsi_display_enable\n"); + dsi_display_ulps_enable(dsi); +} - DSSDBG("dsi_display_disable\n"); - +static void dsi_display_ulps_disable(struct dsi_data *dsi, + bool disconnect_lanes, bool enter_ulps) +{ WARN_ON(!dsi_bus_is_locked(dsi)); mutex_lock(&dsi->lock); @@ -4117,6 +4117,23 @@ static void dsi_display_disable(struct omap_dss_device *dssdev, mutex_unlock(&dsi->lock); } +static void dsi_display_disable(struct omap_dss_device *dssdev) +{ + struct dsi_data *dsi = to_dsi_data(dssdev); + DSSDBG("dsi_display_disable\n"); + dsi_display_ulps_disable(dsi, true, false); +} + +static void dsi_ulps(struct omap_dss_device *dssdev, bool enable) +{ + struct dsi_data *dsi = to_dsi_data(dssdev); + DSSDBG("dsi_ulps\n"); + if (enable) + dsi_display_ulps_disable(dsi, false, true); + else + dsi_display_ulps_enable(dsi); +} + static int dsi_enable_te(struct dsi_data *dsi, bool enable) { dsi->te_enabled = enable; @@ -4818,9 +4835,10 @@ static const struct omap_dss_device_ops dsi_ops = { .connect = dsi_connect, .disconnect = dsi_disconnect, .enable = dsi_display_enable, + .disable = dsi_display_disable, .dsi = { - .disable = dsi_display_disable, + .ulps = dsi_ulps, .set_config = dsi_set_config, diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index 8ff99c00c708..484bdb01871f 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -280,10 +280,9 @@ struct omap_dss_writeback_info { }; struct omapdss_dsi_ops { - void (*disable)(struct omap_dss_device *dssdev, bool disconnect_lanes, - bool enter_ulps); - /* bus configuration */ + void (*ulps)(struct omap_dss_device *
Re: [PATCH 6/7] drm/sun4i: de2: Don't return de2_fmt_info struct
On Tue, Feb 25, 2020 at 4:35 PM Maxime Ripard wrote: > > Hi, > > On Mon, Feb 24, 2020 at 06:39:00PM +0100, Jernej Skrabec wrote: > > Now that de2_fmt_info contains only DRM <-> HW format mapping, it > > doesn't make sense to return pointer to structure when searching by DRM > > format. Rework that to return only HW format instead. > > > > This doesn't make any functional change. > > > > Signed-off-by: Jernej Skrabec > > --- > > drivers/gpu/drm/sun4i/sun8i_mixer.c| 15 +++ > > drivers/gpu/drm/sun4i/sun8i_mixer.h| 7 +-- > > drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 10 +- > > drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 12 ++-- > > 4 files changed, 23 insertions(+), 21 deletions(-) > > > > diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c > > b/drivers/gpu/drm/sun4i/sun8i_mixer.c > > index e078ec96de2d..56cc037fd312 100644 > > --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c > > +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c > > @@ -27,6 +27,11 @@ > > #include "sun8i_vi_layer.h" > > #include "sunxi_engine.h" > > > > +struct de2_fmt_info { > > + u32 drm_fmt; > > + u32 de2_fmt; > > +}; > > + > > static const struct de2_fmt_info de2_formats[] = { > > { > > .drm_fmt = DRM_FORMAT_ARGB, > > @@ -230,15 +235,17 @@ static const struct de2_fmt_info de2_formats[] = { > > }, > > }; > > > > -const struct de2_fmt_info *sun8i_mixer_format_info(u32 format) > > +int sun8i_mixer_drm_format_to_hw(u32 format, u32 *hw_format) > > { > > unsigned int i; > > > > for (i = 0; i < ARRAY_SIZE(de2_formats); ++i) > > - if (de2_formats[i].drm_fmt == format) > > - return &de2_formats[i]; > > + if (de2_formats[i].drm_fmt == format) { > > + *hw_format = de2_formats[i].de2_fmt; > > + return 0; > > + } > > > > - return NULL; > > + return -EINVAL; > > } > > I'm not too sure about that one. It breaks the consistency with the > other functions, and I don't really see a particular benefit to it? I guess we could just define an "invalid" value, and have the function return that if can't find a match? I'm guessing 0x0 is valid, so maybe 0x or 0xdeadbeef ? That would keep consistency with everything else all the while removing the level of indirection you wanted to. ChenYu > The rest of the series is > Acked-by: Maxime Ripard > > Maxime ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v10 09/12] dt-bindings: display: bridge: lvds-codec: Add new bus-width prop
On Tue, 25 Feb 2020 00:31:39 +0200 Laurent Pinchart wrote: > Hi Boris, > > Thank you for the patch. > > On Tue, Jan 28, 2020 at 02:55:11PM +0100, Boris Brezillon wrote: > > Add the bus-width property to describe the input bus format. > > > > v10: > > * Add changelog to the commit message > > * Add Rob's R-b > > > > v8 -> v9: > > * No changes > > > > v7: > > * Rebase on top of lvds-codec changes > > * Drop the data-mapping property > > > > v4 -> v6: > > * Not part of the series > > > > v3: > > * New patch > > > > Signed-off-by: Boris Brezillon > > Reviewed-by: Rob Herring > > --- > > .../devicetree/bindings/display/bridge/lvds-codec.yaml| 8 > > 1 file changed, 8 insertions(+) > > > > diff --git > > a/Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml > > b/Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml > > index 8f373029f5d2..7c4e42f4de61 100644 > > --- a/Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml > > +++ b/Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml > > @@ -55,6 +55,14 @@ properties: > > description: | > >For LVDS encoders, port 0 is the parallel input > >For LVDS decoders, port 0 is the LVDS input > > +properties: > > + bus-width: > > +allOf: > > + - $ref: /schemas/types.yaml#/definitions/uint32 > > + - enum: [18, 24] > > + - default: 24 > > + description: > > +Number of data lines used to transmit the RGB data. > > This is a bit unclear. First of all, depending on whether the node is an > LVDS encoder or decoder, port@0 is either a parallel input or an LVDS > input. The property mentiones RGB data, does it mean it apply to LVDS > encoders only ? Or should it be in port@1 for LVDS decoders ? Right, I only considered the encoder case here. For the decoder case, we don't need a bus-width prop yet, as the bus format output is currently enforced by the bus format input of the next component in the chain (panel/next-bridge), but that might change if we start dealing with panel/bridges supporting several input formats and expecting the LVDS encoder/decoder to select one. What we do need for the decoder case though, is a data-mapping prop, otherwise this LVDS bridge exposes a FIXED in-format and the previous element in the chain has to use its 'default' output format (which might not be appropriate). Maybe we should go for Sam's approach and expose a data-mapping prop on both ends of the bridge (that implies describing RGB/DPI bus width using the data-mapping prop), this way we wouldn't have to distinguish the encoder/decoder case. > > Then, I'm not sure what the property describes. Is it the number of data > lanes that the chip has ? Or the number of lanes routed on the board ? It's the number of lanes routed on the board. I'll clarify that. > Should it be specified only if the number of lanes on the board is > different than the maximum number of lanes of the hardware ? You mean default number of lanes (24)? Well, I guess defining it explicitly is not a bad thing, so, even if the default is already 24, I don't see a problem setting bus-width = <24>. Actually, maybe that's even better if we force new users to explicitly define the number of lanes exposed on the DPI interface, but we definitely need this default value if we want to keep things backward compatible. Not sure how to express that (it's not mandatory, it's not optional, it's recommended :-)). > A more > detailed description is needed. > > Updating the example would also be useful. I can do that too. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 3/3] drm/pci: Unexport drm_get_pci_dev
Hi Am 22.02.20 um 18:54 schrieb Daniel Vetter: > Only user left is the shadow attach for legacy drivers. > > Signed-off-by: Daniel Vetter > --- > drivers/gpu/drm/drm_pci.c | 22 +++--- > include/drm/drm_pci.h | 11 --- > 2 files changed, 3 insertions(+), 30 deletions(-) > > diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c > index c6bb98729a26..cc5af271a1b1 100644 > --- a/drivers/gpu/drm/drm_pci.c > +++ b/drivers/gpu/drm/drm_pci.c > @@ -75,7 +75,6 @@ drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, > size_t size, size_t ali > > return dmah; > } > - > EXPORT_SYMBOL(drm_pci_alloc); > > /** > @@ -191,23 +190,9 @@ void drm_pci_agp_destroy(struct drm_device *dev) > } > } > > -/** > - * drm_get_pci_dev - Register a PCI device with the DRM subsystem > - * @pdev: PCI device > - * @ent: entry from the PCI ID table that matches @pdev > - * @driver: DRM device driver > - * > - * Attempt to gets inter module "drm" information. If we are first > - * then register the character device and inter module information. > - * Try and register, if we fail to register, backout previous work. > - * > - * NOTE: This function is deprecated, please use drm_dev_alloc() and > - * drm_dev_register() instead and remove your &drm_driver.load callback. > - * > - * Return: 0 on success or a negative error code on failure. > - */ > -int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent, > - struct drm_driver *driver) > +static int drm_get_pci_dev(struct pci_dev *pdev, > +const struct pci_device_id *ent, > +struct drm_driver *driver) > { > struct drm_device *dev; > int ret; > @@ -250,7 +235,6 @@ int drm_get_pci_dev(struct pci_dev *pdev, const struct > pci_device_id *ent, > drm_dev_put(dev); > return ret; > } > -EXPORT_SYMBOL(drm_get_pci_dev); > > #ifdef CONFIG_DRM_LEGACY drm_get_pci_dev() is now only used by some legacy code. It should be protected by CONFIG_DRM_LEGACY. With this change Reviewed-by: Thomas Zimmermann > > diff --git a/include/drm/drm_pci.h b/include/drm/drm_pci.h > index 9031e217b506..3941b0255ecf 100644 > --- a/include/drm/drm_pci.h > +++ b/include/drm/drm_pci.h > @@ -45,10 +45,6 @@ struct drm_dma_handle *drm_pci_alloc(struct drm_device > *dev, size_t size, >size_t align); > void drm_pci_free(struct drm_device *dev, struct drm_dma_handle * dmah); > > -int drm_get_pci_dev(struct pci_dev *pdev, > - const struct pci_device_id *ent, > - struct drm_driver *driver); > - > #else > > static inline struct drm_dma_handle *drm_pci_alloc(struct drm_device *dev, > @@ -62,13 +58,6 @@ static inline void drm_pci_free(struct drm_device *dev, > { > } > > -static inline int drm_get_pci_dev(struct pci_dev *pdev, > - const struct pci_device_id *ent, > - struct drm_driver *driver) > -{ > - return -ENOSYS; > -} > - > #endif > > #endif /* _DRM_PCI_H_ */ > -- 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 signature.asc Description: OpenPGP digital signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 3/3] drm/panel: add panel driver for Elida KD35T133 panels
From: Heiko Stuebner Panel driver for the KD35T133 display from Elida, used for example in the rk3326-based Odroid Go Advance handheld. changes in v2: - rename dsi_generic_write_seq macro to dsi_dcs_write_seq to honor the underlying mipi_dsi_dcs_write (Robin) Signed-off-by: Heiko Stuebner --- drivers/gpu/drm/panel/Kconfig| 10 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-elida-kd35t133.c | 352 +++ 3 files changed, 363 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-elida-kd35t133.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index db7ba062027e..56149fdbdf53 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -50,6 +50,16 @@ config DRM_PANEL_SIMPLE that it can be automatically turned off when the panel goes into a low power state. +config DRM_PANEL_ELIDA_KD35T133 + tristate "Elida KD35T133 panel driver" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y here if you want to enable support for the Elida + KD35T133 controller for 320x480 LCD panels with MIPI-DSI + system interfaces. + config DRM_PANEL_FEIYANG_FY07024DI26A30D tristate "Feiyang FY07024DI26A30-D MIPI-DSI LCD panel" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 276907410a45..63189c015ba5 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -3,6 +3,7 @@ obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o +obj-$(CONFIG_DRM_PANEL_ELIDA_KD35T133) += panel-elida-kd35t133.o obj-$(CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D) += panel-feiyang-fy07024di26a30d.o obj-$(CONFIG_DRM_PANEL_ILITEK_IL9322) += panel-ilitek-ili9322.o obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9881C) += panel-ilitek-ili9881c.o diff --git a/drivers/gpu/drm/panel/panel-elida-kd35t133.c b/drivers/gpu/drm/panel/panel-elida-kd35t133.c new file mode 100644 index ..424fb3998d2f --- /dev/null +++ b/drivers/gpu/drm/panel/panel-elida-kd35t133.c @@ -0,0 +1,352 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Elida kd35t133 5.5" MIPI-DSI panel driver + * Copyright (C) 2020 Theobroma Systems Design und Consulting GmbH + * + * based on + * + * Rockteck jh057n00900 5.5" MIPI-DSI panel driver + * Copyright (C) Purism SPC 2019 + */ + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +/* Manufacturer specific Commands send via DSI */ +#define KD35T133_CMD_INTERFACEMODECTRL 0xb0 +#define KD35T133_CMD_FRAMERATECTRL 0xb1 +#define KD35T133_CMD_DISPLAYINVERSIONCTRL 0xb4 +#define KD35T133_CMD_DISPLAYFUNCTIONCTRL 0xb6 +#define KD35T133_CMD_POWERCONTROL1 0xc0 +#define KD35T133_CMD_POWERCONTROL2 0xc1 +#define KD35T133_CMD_VCOMCONTROL 0xc5 +#define KD35T133_CMD_POSITIVEGAMMA 0xe0 +#define KD35T133_CMD_NEGATIVEGAMMA 0xe1 +#define KD35T133_CMD_SETIMAGEFUNCTION 0xe9 +#define KD35T133_CMD_ADJUSTCONTROL30xf7 + +struct kd35t133 { + struct device *dev; + struct drm_panel panel; + struct gpio_desc *reset_gpio; + struct regulator *vdd; + struct regulator *iovcc; + bool prepared; +}; + +static inline struct kd35t133 *panel_to_kd35t133(struct drm_panel *panel) +{ + return container_of(panel, struct kd35t133, panel); +} + +#define dsi_dcs_write_seq(dsi, cmd, seq...) do { \ + static const u8 d[] = { seq }; \ + int ret;\ + ret = mipi_dsi_dcs_write(dsi, cmd, d, ARRAY_SIZE(d)); \ + if (ret < 0)\ + return ret; \ + } while (0) + +static int kd35t133_init_sequence(struct kd35t133 *ctx) +{ + struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); + struct device *dev = ctx->dev; + + /* +* Init sequence was supplied by the panel vendor with minimal +* documentation. +*/ + dsi_dcs_write_seq(dsi, KD35T133_CMD_POSITIVEGAMMA, + 0x00, 0x13, 0x18, 0x04, 0x0f, 0x06, 0x3a, 0x56, + 0x4d, 0x03, 0x0a, 0x06, 0x30, 0x3e, 0x0f); + dsi_dcs_write_seq(dsi, KD35T133_CMD_NEGATIVEGAMMA, + 0x00, 0x13, 0x18, 0x01, 0x11, 0x06, 0x38, 0x34, + 0x4d, 0x06, 0x0d, 0x0b, 0x31, 0x37, 0x0f); + dsi_dcs_write_seq(dsi, KD35T133_CMD_POWERCONTROL1, 0x18, 0x17);
[PATCH v2 1/3] dt-bindings: Add vendor prefix for Elida
From: Heiko Stuebner Shenzen Elida Technology Co. Ltd. is a Chinese TFT manufacturer. Signed-off-by: Heiko Stuebner --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index 9e67944bec9c..38d3149d3adc 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -285,6 +285,8 @@ patternProperties: description: Elan Microelectronic Corp. "^elgin,.*": description: Elgin S/A. + "^elida,.*": +description: Shenzhen Elida Technology Co., Ltd. "^embest,.*": description: Shenzhen Embest Technology Co., Ltd. "^emlid,.*": -- 2.24.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 2/3] dt-bindings: display: panel: Add binding document for Elida KD35T133
From: Heiko Stuebner The KD35T133 is a 3.5" 320x480 DSI display used in the RK3326-based Odroid Go Advance handheld device. Signed-off-by: Heiko Stuebner --- .../display/panel/elida,kd35t133.yaml | 49 +++ 1 file changed, 49 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/elida,kd35t133.yaml diff --git a/Documentation/devicetree/bindings/display/panel/elida,kd35t133.yaml b/Documentation/devicetree/bindings/display/panel/elida,kd35t133.yaml new file mode 100644 index ..4bd74eaa61be --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/elida,kd35t133.yaml @@ -0,0 +1,49 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/elida,kd35t133.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Elida KD35T133 3.5in 320x480 DSI panel + +maintainers: + - Heiko Stuebner + +allOf: + - $ref: panel-common.yaml# + +properties: + compatible: +const: elida,kd35t133 + reg: true + backlight: true + reset-gpios: true + iovcc-supply: + description: regulator that supplies the iovcc voltage + vdd-supply: + description: regulator that supplies the vdd voltage + +required: + - compatible + - reg + - backlight + - iovcc-supply + - vdd-supply + +additionalProperties: false + +examples: + - | +dsi@ff45 { +#address-cells = <1>; +#size-cells = <0>; +panel@0 { +compatible = "elida,kd35t133"; +reg = <0>; +backlight = <&backlight>; +iovcc-supply = <&vcc_1v8>; +vdd-supply = <&vcc3v3_lcd>; +}; +}; + +... -- 2.24.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v8 4/7] dt-bindings: display: mediatek: dpi sample data in dual edge support
Add property "pclk-sample" to config the dpi sample on falling (0), rising (1), both falling and rising (2). Signed-off-by: Jitao Shi --- .../devicetree/bindings/display/mediatek/mediatek,dpi.txt | 4 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.txt b/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.txt index a7b1b8bfb65e..f362fff51437 100644 --- a/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.txt +++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.txt @@ -20,6 +20,9 @@ Required properties: Optional properties: - pinctrl-names: Contain "gpiomode" and "dpimode". pinctrl-names see Documentation/devicetree/bindings/pinctrlpinctrl-bindings.txt +- pclk-sample: 0: sample in falling edge, 1: sample in rising edge, 2: sample + in both falling and rising edge. + pclk-sample see Documentation/devicetree/bindings/media/video-interfaces.txt. Example: @@ -37,6 +40,7 @@ dpi0: dpi@1401d000 { port { dpi0_out: endpoint { + pclk-sample = 0; remote-endpoint = <&hdmi0_in>; }; }; -- 2.21.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v8 3/7] dt-bindings: display: mediatek: control dpi pins mode to avoid leakage
Add property "pinctrl-names" to swap pin mode between gpio and dpi mode. Set pin mode to gpio oupput-low to avoid leakage current when dpi disable. Signed-off-by: Jitao Shi --- .../devicetree/bindings/display/mediatek/mediatek,dpi.txt | 7 +++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.txt b/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.txt index 58914cf681b8..a7b1b8bfb65e 100644 --- a/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.txt +++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.txt @@ -17,6 +17,10 @@ Required properties: Documentation/devicetree/bindings/graph.txt. This port should be connected to the input port of an attached HDMI or LVDS encoder chip. +Optional properties: +- pinctrl-names: Contain "gpiomode" and "dpimode". + pinctrl-names see Documentation/devicetree/bindings/pinctrlpinctrl-bindings.txt + Example: dpi0: dpi@1401d000 { @@ -27,6 +31,9 @@ dpi0: dpi@1401d000 { <&mmsys CLK_MM_DPI_ENGINE>, <&apmixedsys CLK_APMIXED_TVDPLL>; clock-names = "pixel", "engine", "pll"; + pinctrl-names = "gpiomode", "dpimode"; + pinctrl-0 = <&dpi_pin_gpio>; + pinctrl-1 = <&dpi_pin_func>; port { dpi0_out: endpoint { -- 2.21.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel