From: Lothar Waßmann LW@KARO-electronics.de
The 'de-active' and 'pixelclk-active' DT properties are evaluated by of_parse_display_timing() called from of_get_drm_display_mode(), but later lost in the conversion from videomode.flags to drm_display_mode.flags. Enhance of_get_drm_display_mode() to also return the bus flags in a separate variable, so that they can be passed on to the ipu-di driver.
Signed-off-by: Lothar Waßmann LW@KARO-electronics.de Signed-off-by: Philipp Zabel p.zabel@pengutronix.de --- Changes since v4: - Rebased onto imx-drm/next after atomic modeset changes --- drivers/gpu/drm/drm_modes.c | 5 ++++- drivers/gpu/drm/imx/imx-ldb.c | 9 ++++++++- drivers/gpu/drm/imx/parallel-display.c | 10 +++++++--- include/drm/drm_modes.h | 2 +- 4 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index 51804e5..1570487 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -687,7 +687,8 @@ EXPORT_SYMBOL_GPL(drm_bus_flags_from_videomode); * 0 on success, a negative errno code when no of videomode node was found. */ int of_get_drm_display_mode(struct device_node *np, - struct drm_display_mode *dmode, int index) + struct drm_display_mode *dmode, u32 *bus_flags, + int index) { struct videomode vm; int ret; @@ -697,6 +698,8 @@ int of_get_drm_display_mode(struct device_node *np, return ret;
drm_display_mode_from_videomode(&vm, dmode); + if (bus_flags) + drm_bus_flags_from_videomode(&vm, bus_flags);
pr_debug("%s: got %dx%d display mode from %s\n", of_node_full_name(np), vm.hactive, vm.vactive, np->name); diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c index 5d2831d..dc2b420 100644 --- a/drivers/gpu/drm/imx/imx-ldb.c +++ b/drivers/gpu/drm/imx/imx-ldb.c @@ -66,6 +66,7 @@ struct imx_ldb_channel { struct drm_display_mode mode; int mode_valid; u32 bus_format; + u32 bus_flags; };
static inline struct imx_ldb_channel *con_to_imx_ldb_ch(struct drm_connector *c) @@ -382,8 +383,13 @@ static int imx_ldb_encoder_atomic_check(struct drm_encoder *encoder, u32 bus_format = imx_ldb_ch->bus_format;
/* Bus format description in DT overrides connector display info. */ - if (!bus_format && di->num_bus_formats) + if (!bus_format && di->num_bus_formats) { bus_format = di->bus_formats[0]; + imx_crtc_state->bus_flags = di->bus_flags; + } else { + bus_format = imx_ldb_ch->bus_format; + imx_crtc_state->bus_flags = imx_ldb_ch->bus_flags; + } switch (bus_format) { case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG: imx_crtc_state->bus_format = MEDIA_BUS_FMT_RGB666_1X18; @@ -677,6 +683,7 @@ static int imx_ldb_bind(struct device *dev, struct device *master, void *data) /* fallback to display-timings node */ ret = of_get_drm_display_mode(child, &channel->mode, + &channel->bus_flags, OF_USE_NATIVE_MODE); if (!ret) channel->mode_valid = 1; diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c index 4abac21..0b96653 100644 --- a/drivers/gpu/drm/imx/parallel-display.c +++ b/drivers/gpu/drm/imx/parallel-display.c @@ -33,6 +33,7 @@ struct imx_parallel_display { void *edid; int edid_len; u32 bus_format; + u32 bus_flags; struct drm_display_mode mode; struct drm_panel *panel; }; @@ -79,6 +80,7 @@ static int imx_pd_connector_get_modes(struct drm_connector *connector) return -EINVAL;
ret = of_get_drm_display_mode(np, &imxpd->mode, + &imxpd->bus_flags, OF_USE_NATIVE_MODE); if (ret) return ret; @@ -124,11 +126,13 @@ static int imx_pd_encoder_atomic_check(struct drm_encoder *encoder, struct drm_display_info *di = &conn_state->connector->display_info; struct imx_parallel_display *imxpd = enc_to_imxpd(encoder);
- imx_crtc_state->bus_flags = di->bus_flags; - if (!imxpd->bus_format && di->num_bus_formats) + if (!imxpd->bus_format && di->num_bus_formats) { + imx_crtc_state->bus_flags = di->bus_flags; imx_crtc_state->bus_format = di->bus_formats[0]; - else + } else { + imx_crtc_state->bus_flags = imxpd->bus_flags; imx_crtc_state->bus_format = imxpd->bus_format; + } imx_crtc_state->di_hsync_pin = 2; imx_crtc_state->di_vsync_pin = 3;
diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h index a8164d2..48e1a56 100644 --- a/include/drm/drm_modes.h +++ b/include/drm/drm_modes.h @@ -459,7 +459,7 @@ void drm_display_mode_to_videomode(const struct drm_display_mode *dmode, struct videomode *vm); void drm_bus_flags_from_videomode(const struct videomode *vm, u32 *bus_flags); int of_get_drm_display_mode(struct device_node *np, - struct drm_display_mode *dmode, + struct drm_display_mode *dmode, u32 *bus_flags, int index);
void drm_mode_set_name(struct drm_display_mode *mode);
Hi Lothar,
Am Dienstag, den 12.07.2016, 18:50 +0200 schrieb Philipp Zabel:
From: Lothar Waßmann LW@KARO-electronics.de
The 'de-active' and 'pixelclk-active' DT properties are evaluated by of_parse_display_timing() called from of_get_drm_display_mode(), but later lost in the conversion from videomode.flags to drm_display_mode.flags. Enhance of_get_drm_display_mode() to also return the bus flags in a separate variable, so that they can be passed on to the ipu-di driver.
Signed-off-by: Lothar Waßmann LW@KARO-electronics.de Signed-off-by: Philipp Zabel p.zabel@pengutronix.de
Changes since v4:
- Rebased onto imx-drm/next after atomic modeset changes
could you double check git://git.pengutronix.de/git/pza/linux.git imx-drm/next works for you? Let me know if you agree with my changes to your patch.
regards Philipp
Hi,
On Thu, 14 Jul 2016 11:47:52 +0200 Philipp Zabel wrote:
Hi Lothar,
Am Dienstag, den 12.07.2016, 18:50 +0200 schrieb Philipp Zabel:
From: Lothar Waßmann LW@KARO-electronics.de
The 'de-active' and 'pixelclk-active' DT properties are evaluated by of_parse_display_timing() called from of_get_drm_display_mode(), but later lost in the conversion from videomode.flags to drm_display_mode.flags. Enhance of_get_drm_display_mode() to also return the bus flags in a separate variable, so that they can be passed on to the ipu-di driver.
Signed-off-by: Lothar Waßmann LW@KARO-electronics.de Signed-off-by: Philipp Zabel p.zabel@pengutronix.de
Changes since v4:
- Rebased onto imx-drm/next after atomic modeset changes
could you double check git://git.pengutronix.de/git/pza/linux.git imx-drm/next works for you? Let me know if you agree with my changes to your patch.
I'm just back from vacation and will check this soon.
Lothar Waßmann
On Tue, Jul 12, 2016 at 06:50:36PM +0200, Philipp Zabel wrote:
From: Lothar Waßmann LW@KARO-electronics.de
The 'de-active' and 'pixelclk-active' DT properties are evaluated by of_parse_display_timing() called from of_get_drm_display_mode(), but later lost in the conversion from videomode.flags to drm_display_mode.flags. Enhance of_get_drm_display_mode() to also return the bus flags in a separate variable, so that they can be passed on to the ipu-di driver.
Signed-off-by: Lothar Waßmann LW@KARO-electronics.de Signed-off-by: Philipp Zabel p.zabel@pengutronix.de
Changes since v4:
- Rebased onto imx-drm/next after atomic modeset changes
drivers/gpu/drm/drm_modes.c | 5 ++++- drivers/gpu/drm/imx/imx-ldb.c | 9 ++++++++- drivers/gpu/drm/imx/parallel-display.c | 10 +++++++--- include/drm/drm_modes.h | 2 +- 4 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index 51804e5..1570487 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -687,7 +687,8 @@ EXPORT_SYMBOL_GPL(drm_bus_flags_from_videomode);
- 0 on success, a negative errno code when no of videomode node was found.
*/ int of_get_drm_display_mode(struct device_node *np,
struct drm_display_mode *dmode, int index)
struct drm_display_mode *dmode, u32 *bus_flags,
Failed to update the kerneldoc. Please provide a fixup patch. Also I think checking this should be part of review. Just run
$ make htmldocs
and make sure the output is looking good and there's no warnings. -Daniel
int index)
{ struct videomode vm; int ret; @@ -697,6 +698,8 @@ int of_get_drm_display_mode(struct device_node *np, return ret;
drm_display_mode_from_videomode(&vm, dmode);
if (bus_flags)
drm_bus_flags_from_videomode(&vm, bus_flags);
pr_debug("%s: got %dx%d display mode from %s\n", of_node_full_name(np), vm.hactive, vm.vactive, np->name);
diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c index 5d2831d..dc2b420 100644 --- a/drivers/gpu/drm/imx/imx-ldb.c +++ b/drivers/gpu/drm/imx/imx-ldb.c @@ -66,6 +66,7 @@ struct imx_ldb_channel { struct drm_display_mode mode; int mode_valid; u32 bus_format;
- u32 bus_flags;
};
static inline struct imx_ldb_channel *con_to_imx_ldb_ch(struct drm_connector *c) @@ -382,8 +383,13 @@ static int imx_ldb_encoder_atomic_check(struct drm_encoder *encoder, u32 bus_format = imx_ldb_ch->bus_format;
/* Bus format description in DT overrides connector display info. */
- if (!bus_format && di->num_bus_formats)
- if (!bus_format && di->num_bus_formats) { bus_format = di->bus_formats[0];
imx_crtc_state->bus_flags = di->bus_flags;
- } else {
bus_format = imx_ldb_ch->bus_format;
imx_crtc_state->bus_flags = imx_ldb_ch->bus_flags;
- } switch (bus_format) { case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG: imx_crtc_state->bus_format = MEDIA_BUS_FMT_RGB666_1X18;
@@ -677,6 +683,7 @@ static int imx_ldb_bind(struct device *dev, struct device *master, void *data) /* fallback to display-timings node */ ret = of_get_drm_display_mode(child, &channel->mode,
&channel->bus_flags, OF_USE_NATIVE_MODE); if (!ret) channel->mode_valid = 1;
diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c index 4abac21..0b96653 100644 --- a/drivers/gpu/drm/imx/parallel-display.c +++ b/drivers/gpu/drm/imx/parallel-display.c @@ -33,6 +33,7 @@ struct imx_parallel_display { void *edid; int edid_len; u32 bus_format;
- u32 bus_flags; struct drm_display_mode mode; struct drm_panel *panel;
}; @@ -79,6 +80,7 @@ static int imx_pd_connector_get_modes(struct drm_connector *connector) return -EINVAL;
ret = of_get_drm_display_mode(np, &imxpd->mode,
if (ret) return ret;&imxpd->bus_flags, OF_USE_NATIVE_MODE);
@@ -124,11 +126,13 @@ static int imx_pd_encoder_atomic_check(struct drm_encoder *encoder, struct drm_display_info *di = &conn_state->connector->display_info; struct imx_parallel_display *imxpd = enc_to_imxpd(encoder);
- imx_crtc_state->bus_flags = di->bus_flags;
- if (!imxpd->bus_format && di->num_bus_formats)
- if (!imxpd->bus_format && di->num_bus_formats) {
imx_crtc_state->bus_format = di->bus_formats[0];imx_crtc_state->bus_flags = di->bus_flags;
- else
- } else {
imx_crtc_state->bus_format = imxpd->bus_format;imx_crtc_state->bus_flags = imxpd->bus_flags;
- } imx_crtc_state->di_hsync_pin = 2; imx_crtc_state->di_vsync_pin = 3;
diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h index a8164d2..48e1a56 100644 --- a/include/drm/drm_modes.h +++ b/include/drm/drm_modes.h @@ -459,7 +459,7 @@ void drm_display_mode_to_videomode(const struct drm_display_mode *dmode, struct videomode *vm); void drm_bus_flags_from_videomode(const struct videomode *vm, u32 *bus_flags); int of_get_drm_display_mode(struct device_node *np,
struct drm_display_mode *dmode,
struct drm_display_mode *dmode, u32 *bus_flags, int index);
void drm_mode_set_name(struct drm_display_mode *mode);
2.8.1
Describe the new parameter 'bus_flags' to of_get_drm_display_mode() in the kerneldoc comments and add kerneldoc comments to the new function drm_bus_flags_from_videomode().
Signed-off-by: Lothar Waßmann LW@KARO-electronics.de --- drivers/gpu/drm/drm_modes.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index 1570487..e4c65bb 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -657,6 +657,15 @@ void drm_display_mode_to_videomode(const struct drm_display_mode *dmode, } EXPORT_SYMBOL_GPL(drm_display_mode_to_videomode);
+/** + * drm_bus_flags_from_videomode - extract rmation about pixelclk and + * DE polarity from videomode and store it in a separate variable + * @vm: videomode structure to use + * @bus_flags: information about pixelclk and DE polarity will be stored here + * + * Sets DRM_BUS_FLAG_DE_(LOW|HIGH) and DRM_BUS_FLAG_PIXDATA_(POS|NEG)EDGE + * in @bus_flags according to DISPLAY_FLAGS found in @vm + */ void drm_bus_flags_from_videomode(const struct videomode *vm, u32 *bus_flags) { *bus_flags = 0; @@ -677,6 +686,7 @@ EXPORT_SYMBOL_GPL(drm_bus_flags_from_videomode); * of_get_drm_display_mode - get a drm_display_mode from devicetree * @np: device_node with the timing specification * @dmode: will be set to the return value + * @bus_flags: information about pixelclk and DE polarity * @index: index into the list of display timings in devicetree * * This function is expensive and should only be used, if only one mode is to be
Hi Lothar,
Am Dienstag, den 16.08.2016, 13:12 +0200 schrieb Lothar Waßmann:
Describe the new parameter 'bus_flags' to of_get_drm_display_mode() in the kerneldoc comments and add kerneldoc comments to the new function drm_bus_flags_from_videomode().
Signed-off-by: Lothar Waßmann LW@KARO-electronics.de
drivers/gpu/drm/drm_modes.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index 1570487..e4c65bb 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -657,6 +657,15 @@ void drm_display_mode_to_videomode(const struct drm_display_mode *dmode, } EXPORT_SYMBOL_GPL(drm_display_mode_to_videomode);
+/**
- drm_bus_flags_from_videomode - extract rmation about pixelclk and
^ missing letters here
- DE polarity from videomode and store it in a separate variable
- @vm: videomode structure to use
- @bus_flags: information about pixelclk and DE polarity will be stored here
- Sets DRM_BUS_FLAG_DE_(LOW|HIGH) and DRM_BUS_FLAG_PIXDATA_(POS|NEG)EDGE
- in @bus_flags according to DISPLAY_FLAGS found in @vm
- */
void drm_bus_flags_from_videomode(const struct videomode *vm, u32 *bus_flags) { *bus_flags = 0; @@ -677,6 +686,7 @@ EXPORT_SYMBOL_GPL(drm_bus_flags_from_videomode);
- of_get_drm_display_mode - get a drm_display_mode from devicetree
- @np: device_node with the timing specification
- @dmode: will be set to the return value
- @bus_flags: information about pixelclk and DE polarity
- @index: index into the list of display timings in devicetree
- This function is expensive and should only be used, if only one mode is to be
Hi,
On Tue, 16 Aug 2016 13:41:20 +0200 Lucas Stach wrote:
Hi Lothar,
Am Dienstag, den 16.08.2016, 13:12 +0200 schrieb Lothar Waßmann:
Describe the new parameter 'bus_flags' to of_get_drm_display_mode() in the kerneldoc comments and add kerneldoc comments to the new function drm_bus_flags_from_videomode().
Signed-off-by: Lothar Waßmann LW@KARO-electronics.de
drivers/gpu/drm/drm_modes.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index 1570487..e4c65bb 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -657,6 +657,15 @@ void drm_display_mode_to_videomode(const struct drm_display_mode *dmode, } EXPORT_SYMBOL_GPL(drm_display_mode_to_videomode);
+/**
- drm_bus_flags_from_videomode - extract rmation about pixelclk and
^ missing letters here
OOOPS! Just found them under my keyboard. ;) Should I resubmit or can whoever picks this up fix it when applying?
Lothar Waßmann
On Tue, Aug 16, 2016 at 2:35 PM, Lothar Waßmann LW@karo-electronics.de wrote:
On Tue, 16 Aug 2016 13:41:20 +0200 Lucas Stach wrote:
Hi Lothar,
Am Dienstag, den 16.08.2016, 13:12 +0200 schrieb Lothar Waßmann:
Describe the new parameter 'bus_flags' to of_get_drm_display_mode() in the kerneldoc comments and add kerneldoc comments to the new function drm_bus_flags_from_videomode().
Signed-off-by: Lothar Waßmann LW@KARO-electronics.de
drivers/gpu/drm/drm_modes.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index 1570487..e4c65bb 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -657,6 +657,15 @@ void drm_display_mode_to_videomode(const struct drm_display_mode *dmode, } EXPORT_SYMBOL_GPL(drm_display_mode_to_videomode);
+/**
- drm_bus_flags_from_videomode - extract rmation about pixelclk and
^ missing letters here
OOOPS! Just found them under my keyboard. ;) Should I resubmit or can whoever picks this up fix it when applying?
Resubmit would be appreciated by me ;-) -Daniel
dri-devel@lists.freedesktop.org