The KMS helpers (drm_atomic_helper_check_modeset/mode_fixup) pass
encoder->bridge directly to drm_bridge_mode_fixup, which expects a
valid pointer, or NULL (in which case it just returns).
Clear encoder->bridge if a bridge is not found, instead of keeping
the ERR_PTR value.
Since other drm_bridge functions also follow this pattern of checking
for a non-NULL pointer, we can drop the ifs around the calls and just
pass the pointer directly.
Fixes: 894f5a9f4b4a ("drm/sun4i: Add bridge support")
Signed-off-by: Chen-Yu Tsai <redacted>
---
drivers/gpu/drm/sun4i/sun4i_rgb.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
From: Maxime Ripard <hidden> Date: 2016-08-30 12:56:26
Hi,
On Tue, Aug 30, 2016 at 08:22:23PM +0800, Chen-Yu Tsai wrote:
quoted hunk
The KMS helpers (drm_atomic_helper_check_modeset/mode_fixup) pass
encoder->bridge directly to drm_bridge_mode_fixup, which expects a
valid pointer, or NULL (in which case it just returns).
Clear encoder->bridge if a bridge is not found, instead of keeping
the ERR_PTR value.
Since other drm_bridge functions also follow this pattern of checking
for a non-NULL pointer, we can drop the ifs around the calls and just
pass the pointer directly.
Fixes: 894f5a9f4b4a ("drm/sun4i: Add bridge support")
Signed-off-by: Chen-Yu Tsai <redacted>
---
drivers/gpu/drm/sun4i/sun4i_rgb.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
On Tue, Aug 30, 2016 at 8:56 PM, Maxime Ripard
[off-list ref] wrote:
Hi,
On Tue, Aug 30, 2016 at 08:22:23PM +0800, Chen-Yu Tsai wrote:
quoted
The KMS helpers (drm_atomic_helper_check_modeset/mode_fixup) pass
encoder->bridge directly to drm_bridge_mode_fixup, which expects a
valid pointer, or NULL (in which case it just returns).
Clear encoder->bridge if a bridge is not found, instead of keeping
the ERR_PTR value.
Since other drm_bridge functions also follow this pattern of checking
for a non-NULL pointer, we can drop the ifs around the calls and just
pass the pointer directly.
Fixes: 894f5a9f4b4a ("drm/sun4i: Add bridge support")
Signed-off-by: Chen-Yu Tsai <redacted>
---
drivers/gpu/drm/sun4i/sun4i_rgb.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
Hi Maxime,
On Tue, Aug 30, 2016 at 11:51 PM, Chen-Yu Tsai [off-list ref] wrote:
On Tue, Aug 30, 2016 at 8:56 PM, Maxime Ripard
[off-list ref] wrote:
quoted
Hi,
On Tue, Aug 30, 2016 at 08:22:23PM +0800, Chen-Yu Tsai wrote:
quoted
The KMS helpers (drm_atomic_helper_check_modeset/mode_fixup) pass
encoder->bridge directly to drm_bridge_mode_fixup, which expects a
valid pointer, or NULL (in which case it just returns).
Clear encoder->bridge if a bridge is not found, instead of keeping
the ERR_PTR value.
Since other drm_bridge functions also follow this pattern of checking
for a non-NULL pointer, we can drop the ifs around the calls and just
pass the pointer directly.
Fixes: 894f5a9f4b4a ("drm/sun4i: Add bridge support")
Signed-off-by: Chen-Yu Tsai <redacted>
---
drivers/gpu/drm/sun4i/sun4i_rgb.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
From: Maxime Ripard <hidden> Date: 2016-08-31 15:40:14
On Tue, Aug 30, 2016 at 11:51:26PM +0800, Chen-Yu Tsai wrote:
On Tue, Aug 30, 2016 at 8:56 PM, Maxime Ripard
[off-list ref] wrote:
quoted
Hi,
On Tue, Aug 30, 2016 at 08:22:23PM +0800, Chen-Yu Tsai wrote:
quoted
The KMS helpers (drm_atomic_helper_check_modeset/mode_fixup) pass
encoder->bridge directly to drm_bridge_mode_fixup, which expects a
valid pointer, or NULL (in which case it just returns).
Clear encoder->bridge if a bridge is not found, instead of keeping
the ERR_PTR value.
Since other drm_bridge functions also follow this pattern of checking
for a non-NULL pointer, we can drop the ifs around the calls and just
pass the pointer directly.
Fixes: 894f5a9f4b4a ("drm/sun4i: Add bridge support")
Signed-off-by: Chen-Yu Tsai <redacted>
---
drivers/gpu/drm/sun4i/sun4i_rgb.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
From: Daniel Vetter <hidden> Date: 2016-08-31 16:28:10
On Wed, Aug 31, 2016 at 05:40:02PM +0200, Maxime Ripard wrote:
On Tue, Aug 30, 2016 at 11:51:26PM +0800, Chen-Yu Tsai wrote:
quoted
On Tue, Aug 30, 2016 at 8:56 PM, Maxime Ripard
[off-list ref] wrote:
quoted
Hi,
On Tue, Aug 30, 2016 at 08:22:23PM +0800, Chen-Yu Tsai wrote:
quoted
The KMS helpers (drm_atomic_helper_check_modeset/mode_fixup) pass
encoder->bridge directly to drm_bridge_mode_fixup, which expects a
valid pointer, or NULL (in which case it just returns).
Clear encoder->bridge if a bridge is not found, instead of keeping
the ERR_PTR value.
Since other drm_bridge functions also follow this pattern of checking
for a non-NULL pointer, we can drop the ifs around the calls and just
pass the pointer directly.
Fixes: 894f5a9f4b4a ("drm/sun4i: Add bridge support")
Signed-off-by: Chen-Yu Tsai <redacted>
---
drivers/gpu/drm/sun4i/sun4i_rgb.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
I'd rather keep those changes, it makes it obvious that it's something
optionnal, that can be set to NULL.
OK.
quoted
quoted
if (!IS_ERR(tcon->panel))
drm_panel_disable(tcon->panel);
@@ -230,6 +228,9 @@ int sun4i_rgb_init(struct drm_device *drm) return 0; }+ if (IS_ERR(encoder->bridge))+ encoder->bridge = NULL;+
And that could be the else condition of the if statement below.
That would be a bit confusing, changing it after calling drm_encoder_init.
The code says it ok to do though.
The magic really happens only after the encoder has been attached to
something, so it's really safe.
s/attached/registered using drm_dev_register(). Which should
happen _way_ later for all drivers which have gotten rid of their ->load
callback and implemented the recommend driver load sequence.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
From: Maxime Ripard <hidden> Date: 2016-08-31 16:43:05
On Wed, Aug 31, 2016 at 06:27:08PM +0200, Daniel Vetter wrote:
quoted
quoted
quoted
quoted
+ if (IS_ERR(encoder->bridge))
+ encoder->bridge = NULL;
+
And that could be the else condition of the if statement below.
That would be a bit confusing, changing it after calling drm_encoder_init.
The code says it ok to do though.
The magic really happens only after the encoder has been attached to
something, so it's really safe.
s/attached/registered using drm_dev_register(). Which should
happen _way_ later for all drivers which have gotten rid of their ->load
callback and implemented the recommend driver load sequence.