Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1569191 > unrolled thread
| Started by | John Keeping <john@metanate.com> |
|---|---|
| First post | 2017-01-29 15:10 +0100 |
| Last post | 2017-01-29 16:30 +0100 |
| Articles | 6 on this page of 26 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH v3 00/24] drm/rockchip: MIPI fixes & improvements John Keeping <john@metanate.com> - 2017-01-29 15:10 +0100
[PATCH v3 08/24] drm/rockchip: dw-mipi-dsi: respect message flags John Keeping <john@metanate.com> - 2017-01-29 15:10 +0100
Re: [PATCH v3 08/24] drm/rockchip: dw-mipi-dsi: respect message flags Sean Paul <seanpaul@chromium.org> - 2017-01-30 19:30 +0100
[PATCH v3 01/24] drm/rockchip: dw-mipi-dsi: don't configure hardware in mode_set for MIPI John Keeping <john@metanate.com> - 2017-01-29 15:10 +0100
Re: [PATCH v3 01/24] drm/rockchip: dw-mipi-dsi: don't configure hardware in mode_set for MIPI Sean Paul <seanpaul@chromium.org> - 2017-01-30 16:40 +0100
[PATCH v3 24/24] drm/rockchip: dw-mipi-dsi: support read commands John Keeping <john@metanate.com> - 2017-01-29 15:50 +0100
Re: [PATCH v3 24/24] drm/rockchip: dw-mipi-dsi: support read commands Sean Paul <seanpaul@chromium.org> - 2017-01-30 16:40 +0100
Re: [PATCH v3 24/24] drm/rockchip: dw-mipi-dsi: support read commands John Keeping <john@metanate.com> - 2017-01-30 19:40 +0100
[PATCH v3 11/24] drm/rockchip: dw-mipi-dsi: prepare panel after phy init John Keeping <john@metanate.com> - 2017-01-29 15:50 +0100
[PATCH v3 05/24] drm/rockchip: dw-mipi-dsi: fix generic packet status check John Keeping <john@metanate.com> - 2017-01-29 15:50 +0100
Re: [PATCH v3 05/24] drm/rockchip: dw-mipi-dsi: fix generic packet status check Sean Paul <seanpaul@chromium.org> - 2017-01-30 19:30 +0100
[PATCH v3 07/24] drm/rockchip: dw-mipi-dsi: include bad value in error message John Keeping <john@metanate.com> - 2017-01-29 15:50 +0100
Re: [PATCH v3 07/24] drm/rockchip: dw-mipi-dsi: include bad value in error message Sean Paul <seanpaul@chromium.org> - 2017-01-30 19:10 +0100
[PATCH v3 20/24] drm/rockchip: vop: test for P{H,V}SYNC John Keeping <john@metanate.com> - 2017-01-29 15:50 +0100
[PATCH v3 12/24] drm/rockchip: dw-mipi-dsi: allow commands in panel_disable John Keeping <john@metanate.com> - 2017-01-29 15:50 +0100
[PATCH v3 13/24] drm/rockchip: dw-mipi-dsi: fix escape clock rate John Keeping <john@metanate.com> - 2017-01-29 15:50 +0100
[PATCH v3 18/24] drm/rockchip: dw-mipi-dsi: use specific poll helper John Keeping <john@metanate.com> - 2017-01-29 15:50 +0100
[PATCH v3 04/24] drm/rockchip: dw-mipi-dsi: fix command header writes John Keeping <john@metanate.com> - 2017-01-29 15:50 +0100
Re: [PATCH v3 04/24] drm/rockchip: dw-mipi-dsi: fix command header writes Sean Paul <seanpaul@chromium.org> - 2017-01-30 17:00 +0100
[PATCH v3 15/24] drm/rockchip: dw-mipi-dsi: configure PHY before enabling John Keeping <john@metanate.com> - 2017-01-29 15:50 +0100
[PATCH v3 19/24] drm/rockchip: dw-mipi-dsi: use positive check for N{H,V}SYNC John Keeping <john@metanate.com> - 2017-01-29 16:20 +0100
[PATCH v3 17/24] drm/rockchip: dw-mipi-dsi: improve PLL configuration John Keeping <john@metanate.com> - 2017-01-29 16:20 +0100
[PATCH v3 23/24] drm/rockchip: dw-mipi-dsi: add reset control John Keeping <john@metanate.com> - 2017-01-29 16:30 +0100
[PATCH v3 03/24] drm/rockchip: dw-mipi-dsi: remove mode_set hook John Keeping <john@metanate.com> - 2017-01-29 16:30 +0100
Re: [PATCH v3 03/24] drm/rockchip: dw-mipi-dsi: remove mode_set hook Sean Paul <seanpaul@chromium.org> - 2017-01-30 16:50 +0100
[PATCH v3 22/24] drm/rockchip: dw-mipi-dsi: support non-burst modes John Keeping <john@metanate.com> - 2017-01-29 16:30 +0100
Page 2 of 2 — ← Prev page 1 [2]
| From | John Keeping <john@metanate.com> |
|---|---|
| Date | 2017-01-29 16:20 +0100 |
| Subject | [PATCH v3 19/24] drm/rockchip: dw-mipi-dsi: use positive check for N{H,V}SYNC |
| Message-ID | <t4ZqN-cH-3@gated-at.bofh.it> |
| In reply to | #1569191 |
This matches other drivers. Signed-off-by: John Keeping <john@metanate.com> --- Unchanged in v3 Unchanged in v2 drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c index be395c3c5c06..f5b15377ef85 100644 --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c @@ -774,9 +774,9 @@ static void dw_mipi_dsi_dpi_config(struct dw_mipi_dsi *dsi, break; } - if (!(mode->flags & DRM_MODE_FLAG_PVSYNC)) + if (mode->flags & DRM_MODE_FLAG_NVSYNC) val |= VSYNC_ACTIVE_LOW; - if (!(mode->flags & DRM_MODE_FLAG_PHSYNC)) + if (mode->flags & DRM_MODE_FLAG_NHSYNC) val |= HSYNC_ACTIVE_LOW; dsi_write(dsi, DSI_DPI_VCID, DPI_VID(dsi->channel)); -- 2.11.0.197.gb556de5.dirty
[toc] | [prev] | [next] | [standalone]
| From | John Keeping <john@metanate.com> |
|---|---|
| Date | 2017-01-29 16:20 +0100 |
| Subject | [PATCH v3 17/24] drm/rockchip: dw-mipi-dsi: improve PLL configuration |
| Message-ID | <t4ZqO-cH-29@gated-at.bofh.it> |
| In reply to | #1569191 |
The multiplication ratio for the PLL is required to be even due to the
use of a "by 2 pre-scaler". Currently we are likely to end up with an
odd multiplier even though there is an equivalent set of parameters with
an even multiplier.
For example, using the 324MHz bit rate with a reference clock of 24MHz
we end up with M = 27, N = 2 whereas the example in the PHY databook
gives M = 54, N = 4 for this bit rate and reference clock.
By walking down through the available multiplier instead of up we are
more likely to hit an even multiplier. With the above example we do now
get M = 54, N = 4 as given by the databook.
While doing this, change the loop limits to encode the actual limits on
the divisor, which are:
40MHz >= (pllref / N) >= 5MHz
Signed-off-by: John Keeping <john@metanate.com>
---
Unchanged in v3
Unchanged in v2
drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
index 85edf6dd2bac..dcb66a21e1f1 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
@@ -522,7 +522,7 @@ static int dw_mipi_dsi_get_lane_bps(struct dw_mipi_dsi *dsi,
pllref = DIV_ROUND_UP(clk_get_rate(dsi->pllref_clk), USEC_PER_SEC);
tmp = pllref;
- for (i = 1; i < 6; i++) {
+ for (i = pllref / 5; i > (pllref / 40); i--) {
pre = pllref / i;
if ((tmp > (target_mbps % pre)) && (target_mbps / pre < 512)) {
tmp = target_mbps % pre;
--
2.11.0.197.gb556de5.dirty
[toc] | [prev] | [next] | [standalone]
| From | John Keeping <john@metanate.com> |
|---|---|
| Date | 2017-01-29 16:30 +0100 |
| Subject | [PATCH v3 23/24] drm/rockchip: dw-mipi-dsi: add reset control |
| Message-ID | <t4ZAt-ge-5@gated-at.bofh.it> |
| In reply to | #1569191 |
In order to fully reset the state of the MIPI controller we must assert
this reset.
This is slightly more complicated than it could be in order to maintain
compatibility with device trees that do not specify the reset property.
Signed-off-by: John Keeping <john@metanate.com>
Reviewed-by: Chris Zhong <zyw@rock-chips.com>
---
v3:
- Add Chris' Reviewed-by
Unchanged in v2
drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
index 58cb8ace2fe8..cf3ca6b0cbdb 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
@@ -13,6 +13,7 @@
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/regmap.h>
+#include <linux/reset.h>
#include <linux/mfd/syscon.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_crtc.h>
@@ -1124,6 +1125,7 @@ static int dw_mipi_dsi_bind(struct device *dev, struct device *master,
of_match_device(dw_mipi_dsi_dt_ids, dev);
const struct dw_mipi_dsi_plat_data *pdata = of_id->data;
struct platform_device *pdev = to_platform_device(dev);
+ struct reset_control *apb_rst;
struct drm_device *drm = data;
struct dw_mipi_dsi *dsi;
struct resource *res;
@@ -1162,6 +1164,34 @@ static int dw_mipi_dsi_bind(struct device *dev, struct device *master,
return ret;
}
+ /*
+ * Note that the reset was not defined in the initial device tree, so
+ * we have to be prepared for it not being found.
+ */
+ apb_rst = devm_reset_control_get(dev, "apb");
+ if (IS_ERR(apb_rst)) {
+ if (PTR_ERR(apb_rst) == -ENODEV) {
+ apb_rst = NULL;
+ } else {
+ dev_err(dev, "Unable to get reset control: %d\n", ret);
+ return PTR_ERR(apb_rst);
+ }
+ }
+
+ if (apb_rst) {
+ ret = clk_prepare_enable(dsi->pclk);
+ if (ret) {
+ dev_err(dev, "%s: Failed to enable pclk\n", __func__);
+ return ret;
+ }
+
+ reset_control_assert(apb_rst);
+ usleep_range(10, 20);
+ reset_control_deassert(apb_rst);
+
+ clk_disable_unprepare(dsi->pclk);
+ }
+
ret = clk_prepare_enable(dsi->pllref_clk);
if (ret) {
dev_err(dev, "%s: Failed to enable pllref_clk\n", __func__);
--
2.11.0.197.gb556de5.dirty
[toc] | [prev] | [next] | [standalone]
| From | John Keeping <john@metanate.com> |
|---|---|
| Date | 2017-01-29 16:30 +0100 |
| Subject | [PATCH v3 03/24] drm/rockchip: dw-mipi-dsi: remove mode_set hook |
| Message-ID | <t4ZAu-ge-19@gated-at.bofh.it> |
| In reply to | #1569191 |
This is not needed since we can access the mode via the CRTC from the
enable hook. Also remove the "mode" field that is no longer used.
Signed-off-by: John Keeping <john@metanate.com>
Reviewed-by: Chris Zhong <zyw@rock-chips.com>
---
v3:
- Add Chris' Reviewed-by
New in v2
drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
index cdbd25087e83..bd92e58b64f3 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
@@ -286,7 +286,6 @@ struct dw_mipi_dsi {
u32 format;
u16 input_div;
u16 feedback_div;
- struct drm_display_mode *mode;
const struct dw_mipi_dsi_plat_data *pdata;
};
@@ -816,15 +815,6 @@ static void dw_mipi_dsi_clear_err(struct dw_mipi_dsi *dsi)
dsi_write(dsi, DSI_INT_MSK1, 0);
}
-static void dw_mipi_dsi_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
-{
- struct dw_mipi_dsi *dsi = encoder_to_dsi(encoder);
-
- dsi->mode = adjusted_mode;
-}
-
static void dw_mipi_dsi_encoder_disable(struct drm_encoder *encoder)
{
struct dw_mipi_dsi *dsi = encoder_to_dsi(encoder);
@@ -854,7 +844,7 @@ static void dw_mipi_dsi_encoder_disable(struct drm_encoder *encoder)
static void dw_mipi_dsi_encoder_enable(struct drm_encoder *encoder)
{
struct dw_mipi_dsi *dsi = encoder_to_dsi(encoder);
- struct drm_display_mode *mode = dsi->mode;
+ struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode;
int mux = drm_of_encoder_active_endpoint_id(dsi->dev->of_node, encoder);
u32 val;
int ret;
@@ -930,7 +920,6 @@ dw_mipi_dsi_encoder_atomic_check(struct drm_encoder *encoder,
static struct drm_encoder_helper_funcs
dw_mipi_dsi_encoder_helper_funcs = {
.enable = dw_mipi_dsi_encoder_enable,
- .mode_set = dw_mipi_dsi_encoder_mode_set,
.disable = dw_mipi_dsi_encoder_disable,
.atomic_check = dw_mipi_dsi_encoder_atomic_check,
};
--
2.11.0.197.gb556de5.dirty
[toc] | [prev] | [next] | [standalone]
| From | Sean Paul <seanpaul@chromium.org> |
|---|---|
| Date | 2017-01-30 16:50 +0100 |
| Subject | Re: [PATCH v3 03/24] drm/rockchip: dw-mipi-dsi: remove mode_set hook |
| Message-ID | <t5mno-5Iu-13@gated-at.bofh.it> |
| In reply to | #1569214 |
On Sun, Jan 29, 2017 at 01:24:23PM +0000, John Keeping wrote:
> This is not needed since we can access the mode via the CRTC from the
> enable hook. Also remove the "mode" field that is no longer used.
>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
> Signed-off-by: John Keeping <john@metanate.com>
> Reviewed-by: Chris Zhong <zyw@rock-chips.com>
> ---
> v3:
> - Add Chris' Reviewed-by
> New in v2
>
> drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 13 +------------
> 1 file changed, 1 insertion(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
> index cdbd25087e83..bd92e58b64f3 100644
> --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
> +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
> @@ -286,7 +286,6 @@ struct dw_mipi_dsi {
> u32 format;
> u16 input_div;
> u16 feedback_div;
> - struct drm_display_mode *mode;
>
> const struct dw_mipi_dsi_plat_data *pdata;
> };
> @@ -816,15 +815,6 @@ static void dw_mipi_dsi_clear_err(struct dw_mipi_dsi *dsi)
> dsi_write(dsi, DSI_INT_MSK1, 0);
> }
>
> -static void dw_mipi_dsi_encoder_mode_set(struct drm_encoder *encoder,
> - struct drm_display_mode *mode,
> - struct drm_display_mode *adjusted_mode)
> -{
> - struct dw_mipi_dsi *dsi = encoder_to_dsi(encoder);
> -
> - dsi->mode = adjusted_mode;
> -}
> -
> static void dw_mipi_dsi_encoder_disable(struct drm_encoder *encoder)
> {
> struct dw_mipi_dsi *dsi = encoder_to_dsi(encoder);
> @@ -854,7 +844,7 @@ static void dw_mipi_dsi_encoder_disable(struct drm_encoder *encoder)
> static void dw_mipi_dsi_encoder_enable(struct drm_encoder *encoder)
> {
> struct dw_mipi_dsi *dsi = encoder_to_dsi(encoder);
> - struct drm_display_mode *mode = dsi->mode;
> + struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode;
> int mux = drm_of_encoder_active_endpoint_id(dsi->dev->of_node, encoder);
> u32 val;
> int ret;
> @@ -930,7 +920,6 @@ dw_mipi_dsi_encoder_atomic_check(struct drm_encoder *encoder,
> static struct drm_encoder_helper_funcs
> dw_mipi_dsi_encoder_helper_funcs = {
> .enable = dw_mipi_dsi_encoder_enable,
> - .mode_set = dw_mipi_dsi_encoder_mode_set,
> .disable = dw_mipi_dsi_encoder_disable,
> .atomic_check = dw_mipi_dsi_encoder_atomic_check,
> };
> --
> 2.11.0.197.gb556de5.dirty
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Sean Paul, Software Engineer, Google / Chromium OS
[toc] | [prev] | [next] | [standalone]
| From | John Keeping <john@metanate.com> |
|---|---|
| Date | 2017-01-29 16:30 +0100 |
| Subject | [PATCH v3 22/24] drm/rockchip: dw-mipi-dsi: support non-burst modes |
| Message-ID | <t4ZAu-ge-23@gated-at.bofh.it> |
| In reply to | #1569191 |
Signed-off-by: John Keeping <john@metanate.com>
Reviewed-by: Chris Zhong <zyw@rock-chips.com>
---
v3:
- Add Chris' Reviewed-by
Unchanged in v2
drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
index 5bad92e2370e..58cb8ace2fe8 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
@@ -82,6 +82,7 @@
#define FRAME_BTA_ACK BIT(14)
#define ENABLE_LOW_POWER (0x3f << 8)
#define ENABLE_LOW_POWER_MASK (0x3f << 8)
+#define VID_MODE_TYPE_NON_BURST_SYNC_EVENTS 0x1
#define VID_MODE_TYPE_BURST_SYNC_PULSES 0x2
#define VID_MODE_TYPE_MASK 0x3
@@ -286,6 +287,7 @@ struct dw_mipi_dsi {
u32 format;
u16 input_div;
u16 feedback_div;
+ unsigned long mode_flags;
const struct dw_mipi_dsi_plat_data *pdata;
};
@@ -551,15 +553,10 @@ static int dw_mipi_dsi_host_attach(struct mipi_dsi_host *host,
return -EINVAL;
}
- if (!(device->mode_flags & MIPI_DSI_MODE_VIDEO_BURST) ||
- !(device->mode_flags & MIPI_DSI_MODE_VIDEO_SYNC_PULSE)) {
- dev_err(dsi->dev, "device mode is unsupported\n");
- return -EINVAL;
- }
-
dsi->lanes = device->lanes;
dsi->channel = device->channel;
dsi->format = device->format;
+ dsi->mode_flags = device->mode_flags;
dsi->panel = of_drm_find_panel(device->dev.of_node);
if (dsi->panel)
return drm_panel_attach(dsi->panel, &dsi->connector);
@@ -716,7 +713,12 @@ static void dw_mipi_dsi_video_mode_config(struct dw_mipi_dsi *dsi)
{
u32 val;
- val = VID_MODE_TYPE_BURST_SYNC_PULSES | ENABLE_LOW_POWER;
+ val = ENABLE_LOW_POWER;
+
+ if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_BURST)
+ val |= VID_MODE_TYPE_BURST_SYNC_PULSES;
+ else if (!(dsi->mode_flags & MIPI_DSI_MODE_VIDEO_SYNC_PULSE))
+ val |= VID_MODE_TYPE_NON_BURST_SYNC_EVENTS;
dsi_write(dsi, DSI_VID_MODE_CFG, val);
}
--
2.11.0.197.gb556de5.dirty
[toc] | [prev] | [standalone]
Page 2 of 2 — ← Prev page 1 [2]
Back to top | Article view | linux.kernel
csiph-web