drm: Clean up the 1366x768 fixup codes
Subsystems (2)
PATCH v2 1/1 drm: Clean up the 1366x768 fixup codes
This is just a cleanup, no functional change.
The fixup code for 1366x768 in drm_mode_create_from_cmdline_mode() is basically a copy of the existing code in drm_edid.c. Make the latter code public so that it can be called from the former function.
---v1->v2: Fix the wrong line removal of drm_mode_set_crtcinfo() call
drivers/gpu/drm/drm_crtc_internal.h | 3 +++ drivers/gpu/drm/drm_edid.c | 6 +++--- drivers/gpu/drm/drm_modes.c | 8 ++------ 3 files changed, 8 insertions(+), 9 deletions(-)
drivers/gpu/drm/drm_crtc_internal.h +3 -0
@@ -199,3 +199,6 @@ int drm_mode_cursor2_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv);int drm_mode_page_flip_ioctl (struct drm_device *dev,void *data,struct drm_file *file_priv); + +/* drm_edid.c */ +void drm_mode_fixup_1366x768 (struct drm_display_mode *mode);
drivers/gpu/drm/drm_edid.c +3 -3
@@ -2152,7 +2152,7 @@ drm_dmt_modes_for_range(struct drm_connector *connector, struct edid *edid,/* fix up 1366x768 mode from 1368x768; * GFT/CVT can't express 1366 width which isn't dividable by 8 */ -static void fixup_mode_1366x768 (struct drm_display_mode *mode) +void drm_mode_fixup_1366x768 (struct drm_display_mode *mode) {if (mode->hdisplay ==1368 && mode->vdisplay ==768 ) { mode->hdisplay =1366 ;
@@ -2176,7 +2176,7 @@ drm_gtf_modes_for_range(struct drm_connector *connector, struct edid *edid,if (!newmode)return modes; -fixup_mode_1366x768 (newmode); +drm_mode_fixup_1366x768 (newmode);if (!mode_in_range (newmode, edid, timing) || !valid_inferred_mode (connector, newmode)) {drm_mode_destroy (dev, newmode);
@@ -2205,7 +2205,7 @@ drm_cvt_modes_for_range(struct drm_connector *connector, struct edid *edid,if (!newmode)return modes; -fixup_mode_1366x768 (newmode); +drm_mode_fixup_1366x768 (newmode);if (!mode_in_range (newmode, edid, timing) || !valid_inferred_mode (connector, newmode)) {drm_mode_destroy (dev, newmode);
drivers/gpu/drm/drm_modes.c +2 -6
@@ -1461,12 +1461,8 @@ drm_mode_create_from_cmdline_mode(struct drm_device *dev, mode->type |=DRM_MODE_TYPE_USERDEF ;/* fix up 1368x768: GFT/CVT can't express 1366 width due to alignment */ -if (cmd->xres ==1366 && mode->hdisplay ==1368 ) { - mode->hdisplay =1366 ; - mode->hsync_start--; - mode->hsync_end--; -drm_mode_set_name (mode); - } +if (cmd->xres ==1366 ) +drm_mode_fixup_1366x768 (mode);drm_mode_set_crtcinfo (mode,CRTC_INTERLACE_HALVE_V );return mode; }
Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 9 lines · Takashi Iwai
This is just a cleanup, no functional change.
The fixup code for 1366x768 in
drm_mode_create_from_cmdline_mode()is basically a copy of the existing code indrm_edid.c. Make the latter code public so that it can be called from the former function.Signed-off-by Takashi Iwai <[email protected]>---
v1->v2: Fix the wrong line removal ofdrm_mode_set_crtcinfo()call
We prefer to include the changelog in the commit message proper. But it can be hoisted up easily enough when pushing.
lgtm
Quoted 69 lines
drivers/gpu/drm/drm_crtc_internal.h | 3 +++ drivers/gpu/drm/drm_edid.c | 6 +++--- drivers/gpu/drm/drm_modes.c | 8 ++------ 3 files changed, 8 insertions(+), 9 deletions(-)drivers/gpu/drm/drm_crtc_internal.h +3
-0@@ -199,3 +199,6 @@ int drm_mode_cursor2_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv);int drm_mode_page_flip_ioctl (struct drm_device *dev,void *data,struct drm_file *file_priv); + +/* drm_edid.c */ +void drm_mode_fixup_1366x768 (struct drm_display_mode *mode);drivers/gpu/drm/drm_edid.c +3
-3@@ -2152,7 +2152,7 @@ drm_dmt_modes_for_range(struct drm_connector *connector, struct edid *edid,/* fix up 1366x768 mode from 1368x768; * GFT/CVT can't express 1366 width which isn't dividable by 8 */ -static void fixup_mode_1366x768 (struct drm_display_mode *mode) +void drm_mode_fixup_1366x768 (struct drm_display_mode *mode) {if (mode->hdisplay ==1368 && mode->vdisplay ==768 ) { mode->hdisplay =1366 ;@@ -2176,7 +2176,7 @@ drm_gtf_modes_for_range(struct drm_connector *connector, struct edid *edid,if (!newmode)return modes; -fixup_mode_1366x768 (newmode); +drm_mode_fixup_1366x768 (newmode);if (!mode_in_range (newmode, edid, timing) || !valid_inferred_mode (connector, newmode)) {drm_mode_destroy (dev, newmode);@@ -2205,7 +2205,7 @@ drm_cvt_modes_for_range(struct drm_connector *connector, struct edid *edid,if (!newmode)return modes; -fixup_mode_1366x768 (newmode); +drm_mode_fixup_1366x768 (newmode);if (!mode_in_range (newmode, edid, timing) || !valid_inferred_mode (connector, newmode)) {drm_mode_destroy (dev, newmode);drivers/gpu/drm/drm_modes.c +2
-6@@ -1461,12 +1461,8 @@ drm_mode_create_from_cmdline_mode(struct drm_device *dev, mode->type |=DRM_MODE_TYPE_USERDEF ;/* fix up 1368x768: GFT/CVT can't express 1366 width due to alignment */ -if (cmd->xres ==1366 && mode->hdisplay ==1368 ) { - mode->hdisplay =1366 ; - mode->hsync_start--; - mode->hsync_end--; -drm_mode_set_name (mode); - } +if (cmd->xres ==1366 ) +drm_mode_fixup_1366x768 (mode);drm_mode_set_crtcinfo (mode,CRTC_INTERLACE_HALVE_V );return mode; }Signature · 1 line
2.11.0
Signature · 2 lines
Ville Syrjälä Intel OTC
Quoted 11 lines · Ville Syrjälä
Quoted 9 lines · Takashi Iwai
This is just a cleanup, no functional change.
The fixup code for 1366x768 in
drm_mode_create_from_cmdline_mode()is basically a copy of the existing code indrm_edid.c. Make the latter code public so that it can be called from the former function.Signed-off-by Takashi Iwai <[email protected]>---
v1->v2: Fix the wrong line removal ofdrm_mode_set_crtcinfo()call
Quoted 5 lines
We prefer to include the changelog in the commit message proper. But it can be hoisted up easily enough when pushing.
lgtm
Reviewed-by Ville Syrjälä <[email protected]>
Ville, can you pls also apply&push this to drm-misc.git?
Thanks, Daniel
Quoted 74 lines
Quoted 70 lines
drivers/gpu/drm/drm_crtc_internal.h | 3 +++ drivers/gpu/drm/drm_edid.c | 6 +++--- drivers/gpu/drm/drm_modes.c | 8 ++------ 3 files changed, 8 insertions(+), 9 deletions(-)drivers/gpu/drm/drm_crtc_internal.h +3
-0@@ -199,3 +199,6 @@ int drm_mode_cursor2_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv);int drm_mode_page_flip_ioctl (struct drm_device *dev,void *data,struct drm_file *file_priv); + +/* drm_edid.c */ +void drm_mode_fixup_1366x768 (struct drm_display_mode *mode);drivers/gpu/drm/drm_edid.c +3
-3@@ -2152,7 +2152,7 @@ drm_dmt_modes_for_range(struct drm_connector *connector, struct edid *edid,/* fix up 1366x768 mode from 1368x768; * GFT/CVT can't express 1366 width which isn't dividable by 8 */ -static void fixup_mode_1366x768 (struct drm_display_mode *mode) +void drm_mode_fixup_1366x768 (struct drm_display_mode *mode) {if (mode->hdisplay ==1368 && mode->vdisplay ==768 ) { mode->hdisplay =1366 ;@@ -2176,7 +2176,7 @@ drm_gtf_modes_for_range(struct drm_connector *connector, struct edid *edid,if (!newmode)return modes; -fixup_mode_1366x768 (newmode); +drm_mode_fixup_1366x768 (newmode);if (!mode_in_range (newmode, edid, timing) || !valid_inferred_mode (connector, newmode)) {drm_mode_destroy (dev, newmode);@@ -2205,7 +2205,7 @@ drm_cvt_modes_for_range(struct drm_connector *connector, struct edid *edid,if (!newmode)return modes; -fixup_mode_1366x768 (newmode); +drm_mode_fixup_1366x768 (newmode);if (!mode_in_range (newmode, edid, timing) || !valid_inferred_mode (connector, newmode)) {drm_mode_destroy (dev, newmode);drivers/gpu/drm/drm_modes.c +2
-6@@ -1461,12 +1461,8 @@ drm_mode_create_from_cmdline_mode(struct drm_device *dev, mode->type |=DRM_MODE_TYPE_USERDEF ;/* fix up 1368x768: GFT/CVT can't express 1366 width due to alignment */ -if (cmd->xres ==1366 && mode->hdisplay ==1368 ) { - mode->hdisplay =1366 ; - mode->hsync_start--; - mode->hsync_end--; -drm_mode_set_name (mode); - } +if (cmd->xres ==1366 ) +drm_mode_fixup_1366x768 (mode);drm_mode_set_crtcinfo (mode,CRTC_INTERLACE_HALVE_V );return mode; }Signature · 1 line
2.11.0Signature · 2 lines
Ville Syrjälä Intel OTC
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Quoted 12 lines · Daniel Vetter
Quoted 11 lines · Ville Syrjälä
Quoted 9 lines · Takashi Iwai
This is just a cleanup, no functional change.
The fixup code for 1366x768 in
drm_mode_create_from_cmdline_mode()is basically a copy of the existing code indrm_edid.c. Make the latter code public so that it can be called from the former function.Signed-off-by Takashi Iwai <[email protected]>---
v1->v2: Fix the wrong line removal ofdrm_mode_set_crtcinfo()call
Quoted 7 lines
Quoted 5 lines
We prefer to include the changelog in the commit message proper. But it can be hoisted up easily enough when pushing.
lgtm
Reviewed-by Ville Syrjälä <[email protected]>Ville, can you pls also apply&push this to drm-misc.git?
This would need a backmerge of the preceding fix into drm-misc-next.
Quoted 81 lines
Thanks, Daniel
Quoted 74 lines
Quoted 70 lines
drivers/gpu/drm/drm_crtc_internal.h | 3 +++ drivers/gpu/drm/drm_edid.c | 6 +++--- drivers/gpu/drm/drm_modes.c | 8 ++------ 3 files changed, 8 insertions(+), 9 deletions(-)drivers/gpu/drm/drm_crtc_internal.h +3
-0@@ -199,3 +199,6 @@ int drm_mode_cursor2_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv);int drm_mode_page_flip_ioctl (struct drm_device *dev,void *data,struct drm_file *file_priv); + +/* drm_edid.c */ +void drm_mode_fixup_1366x768 (struct drm_display_mode *mode);drivers/gpu/drm/drm_edid.c +3
-3@@ -2152,7 +2152,7 @@ drm_dmt_modes_for_range(struct drm_connector *connector, struct edid *edid,/* fix up 1366x768 mode from 1368x768; * GFT/CVT can't express 1366 width which isn't dividable by 8 */ -static void fixup_mode_1366x768 (struct drm_display_mode *mode) +void drm_mode_fixup_1366x768 (struct drm_display_mode *mode) {if (mode->hdisplay ==1368 && mode->vdisplay ==768 ) { mode->hdisplay =1366 ;@@ -2176,7 +2176,7 @@ drm_gtf_modes_for_range(struct drm_connector *connector, struct edid *edid,if (!newmode)return modes; -fixup_mode_1366x768 (newmode); +drm_mode_fixup_1366x768 (newmode);if (!mode_in_range (newmode, edid, timing) || !valid_inferred_mode (connector, newmode)) {drm_mode_destroy (dev, newmode);@@ -2205,7 +2205,7 @@ drm_cvt_modes_for_range(struct drm_connector *connector, struct edid *edid,if (!newmode)return modes; -fixup_mode_1366x768 (newmode); +drm_mode_fixup_1366x768 (newmode);if (!mode_in_range (newmode, edid, timing) || !valid_inferred_mode (connector, newmode)) {drm_mode_destroy (dev, newmode);drivers/gpu/drm/drm_modes.c +2
-6@@ -1461,12 +1461,8 @@ drm_mode_create_from_cmdline_mode(struct drm_device *dev, mode->type |=DRM_MODE_TYPE_USERDEF ;/* fix up 1368x768: GFT/CVT can't express 1366 width due to alignment */ -if (cmd->xres ==1366 && mode->hdisplay ==1368 ) { - mode->hdisplay =1366 ; - mode->hsync_start--; - mode->hsync_end--; -drm_mode_set_name (mode); - } +if (cmd->xres ==1366 ) +drm_mode_fixup_1366x768 (mode);drm_mode_set_crtcinfo (mode,CRTC_INTERLACE_HALVE_V );return mode; }Signature · 1 line
2.11.0Signature · 2 lines
Ville Syrjälä Intel OTCSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 16 lines · Ville Syrjälä
Quoted 15 lines · Daniel Vetter
Quoted 14 lines · Ville Syrjälä
Quoted 9 lines · Takashi Iwai
This is just a cleanup, no functional change.
The fixup code for 1366x768 in
drm_mode_create_from_cmdline_mode()is basically a copy of the existing code indrm_edid.c. Make the latter code public so that it can be called from the former function.Signed-off-by Takashi Iwai <[email protected]>---
v1->v2: Fix the wrong line removal ofdrm_mode_set_crtcinfo()callWe prefer to include the changelog in the commit message proper. But it can be hoisted up easily enough when pushing.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
lgtm
Reviewed-by Ville Syrjälä <[email protected]>Ville, can you pls also apply&push this to drm-misc.git?
This would need a backmerge of the preceding fix into drm-misc-next.
Ok, that should happen after -rc6 is out, we already need it for something else. I'll forget about this one here now and assume you'll handle it :-) -Daniel
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
Quoted 11 lines · Ville Syrjälä
Quoted 9 lines · Takashi Iwai
This is just a cleanup, no functional change.
The fixup code for 1366x768 in
drm_mode_create_from_cmdline_mode()is basically a copy of the existing code indrm_edid.c. Make the latter code public so that it can be called from the former function.Signed-off-by Takashi Iwai <[email protected]>---
v1->v2: Fix the wrong line removal ofdrm_mode_set_crtcinfo()call
Quoted 5 lines
We prefer to include the changelog in the commit message proper. But it can be hoisted up easily enough when pushing.
lgtm
Reviewed-by Ville Syrjälä <[email protected]>
sparse wasn't entirely happy [1] but I fixed that up while pushing to drm-misc-next. Thanks for the patch.
[1] ../drivers/gpu/drm/drm_edid.c:2156:6: warning: symbol 'drm_mode_fixup_1366x768' was not declared. Should it be static?
Quoted 78 lines
Quoted 70 lines
drivers/gpu/drm/drm_crtc_internal.h | 3 +++ drivers/gpu/drm/drm_edid.c | 6 +++--- drivers/gpu/drm/drm_modes.c | 8 ++------ 3 files changed, 8 insertions(+), 9 deletions(-)drivers/gpu/drm/drm_crtc_internal.h +3
-0@@ -199,3 +199,6 @@ int drm_mode_cursor2_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv);int drm_mode_page_flip_ioctl (struct drm_device *dev,void *data,struct drm_file *file_priv); + +/* drm_edid.c */ +void drm_mode_fixup_1366x768 (struct drm_display_mode *mode);drivers/gpu/drm/drm_edid.c +3
-3@@ -2152,7 +2152,7 @@ drm_dmt_modes_for_range(struct drm_connector *connector, struct edid *edid,/* fix up 1366x768 mode from 1368x768; * GFT/CVT can't express 1366 width which isn't dividable by 8 */ -static void fixup_mode_1366x768 (struct drm_display_mode *mode) +void drm_mode_fixup_1366x768 (struct drm_display_mode *mode) {if (mode->hdisplay ==1368 && mode->vdisplay ==768 ) { mode->hdisplay =1366 ;@@ -2176,7 +2176,7 @@ drm_gtf_modes_for_range(struct drm_connector *connector, struct edid *edid,if (!newmode)return modes; -fixup_mode_1366x768 (newmode); +drm_mode_fixup_1366x768 (newmode);if (!mode_in_range (newmode, edid, timing) || !valid_inferred_mode (connector, newmode)) {drm_mode_destroy (dev, newmode);@@ -2205,7 +2205,7 @@ drm_cvt_modes_for_range(struct drm_connector *connector, struct edid *edid,if (!newmode)return modes; -fixup_mode_1366x768 (newmode); +drm_mode_fixup_1366x768 (newmode);if (!mode_in_range (newmode, edid, timing) || !valid_inferred_mode (connector, newmode)) {drm_mode_destroy (dev, newmode);drivers/gpu/drm/drm_modes.c +2
-6@@ -1461,12 +1461,8 @@ drm_mode_create_from_cmdline_mode(struct drm_device *dev, mode->type |=DRM_MODE_TYPE_USERDEF ;/* fix up 1368x768: GFT/CVT can't express 1366 width due to alignment */ -if (cmd->xres ==1366 && mode->hdisplay ==1368 ) { - mode->hdisplay =1366 ; - mode->hsync_start--; - mode->hsync_end--; -drm_mode_set_name (mode); - } +if (cmd->xres ==1366 ) +drm_mode_fixup_1366x768 (mode);drm_mode_set_crtcinfo (mode,CRTC_INTERLACE_HALVE_V );return mode; }Signature · 1 line
2.11.0Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel