drm: fixes when i2c encoder slave mode_fixup is null.
Subsystems (2)
PATCH 1/1 drm: fixes when i2c encoder slave mode_fixup is null.
Avoid i2c slave encoder drivers to copy/paste code to implement functions that will only return true.
--- drivers/gpu/drm/drm_encoder_slave.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/drm_encoder_slave.c +2 -0
@@ -140,6 +140,8 @@ bool drm_i2c_encoder_mode_fixup(struct drm_encoder *encoder,const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { + if(!get_slave_funcs(encoder)->mode_fixup) + return true; return get_slave_funcs(encoder)->mode_fixup(encoder, mode, adjusted_mode); }EXPORT_SYMBOL (drm_i2c_encoder_mode_fixup );
--
2.5.0
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 4 lines · Carlos Palminha
Avoid i2c slave encoder drivers to copy/paste code to implement functions that will only return true.
Signed-off-by Carlos Palminha <[email protected]>
lgtm, applied to drm-misc. sil164_drv.c seems to have a dummy mode_fixup function that's now uneeded. Can you pls follow up with a patch to remove that one?
Thanks, Daniel
Quoted 20 lines
--- drivers/gpu/drm/drm_encoder_slave.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/drm_encoder_slave.c +2
-1@@ -140,6 +140,8 @@ bool drm_i2c_encoder_mode_fixup(struct drm_encoder *encoder,const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { + if(!get_slave_funcs(encoder)->mode_fixup) + return true; return get_slave_funcs(encoder)->mode_fixup(encoder, mode, adjusted_mode); }EXPORT_SYMBOL (drm_i2c_encoder_mode_fixup ); --2.5.0
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
thanks daniel.
I'll check all i2c slave encoders and submit a patch set.
Quoted 16 lines · Daniel Vetter
Quoted 4 lines · Carlos Palminha
Avoid i2c slave encoder drivers to copy/paste code to implement functions that will only return true.
Signed-off-by Carlos Palminha <[email protected]>lgtm, applied to drm-misc.
sil164_drv.cseems to have a dummymode_fixupfunction that's now uneeded. Can you pls follow up with a patch to remove that one?Thanks, Daniel
Quoted 4 lines
--- drivers/gpu/drm/drm_encoder_slave.c | 2 ++ 1 file changed, 2 insertions(+)
Quoted 17 lines
Quoted 14 lines
drivers/gpu/drm/drm_encoder_slave.c +2
-1@@ -140,6 +140,8 @@ bool drm_i2c_encoder_mode_fixup(struct drm_encoder *encoder,const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { + if(!get_slave_funcs(encoder)->mode_fixup) + return true; return get_slave_funcs(encoder)->mode_fixup(encoder, mode, adjusted_mode); }EXPORT_SYMBOL (drm_i2c_encoder_mode_fixup ); --Quoted 2 lines
2.5.0
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 16 lines · Daniel Vetter
Quoted 4 lines · Carlos Palminha
Avoid i2c slave encoder drivers to copy/paste code to implement functions that will only return true.
Signed-off-by Carlos Palminha <[email protected]>lgtm, applied to drm-misc.
sil164_drv.cseems to have a dummymode_fixupfunction that's now uneeded. Can you pls follow up with a patch to remove that one?Thanks, Daniel
Quoted 4 lines
--- drivers/gpu/drm/drm_encoder_slave.c | 2 ++ 1 file changed, 2 insertions(+)
Quoted 9 lines
drivers/gpu/drm/drm_encoder_slave.c bool drm_i2c_encoder_mode_fixup(struct drm_encoder *encoder, · line 143
Quoted 9 lines
drivers/gpu/drm/drm_encoder_slave.c +1
-0@@ -140,6 +140,8 @@ bool drm_i2c_encoder_mode_fixup(struct drm_encoder *encoder, const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { + if(!get_slave_funcs(encoder)->mode_fixup)
^
Please apply an ocd-space there. ;)
BR,
Jani.
Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/drm_encoder_slave.c +1
-1+return true;return get_slave_funcs (encoder)->mode_fixup (encoder, mode, adjusted_mode); }EXPORT_SYMBOL (drm_i2c_encoder_mode_fixup); --2.5.0
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel