Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1559816 > unrolled thread
| Started by | Takashi Iwai <tiwai@suse.de> |
|---|---|
| First post | 2017-01-16 16:00 +0100 |
| Last post | 2017-01-16 21:20 +0100 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] drm: Clean up the 1366x768 fixup codes Takashi Iwai <tiwai@suse.de> - 2017-01-16 16:00 +0100
Re: [PATCH] drm: Clean up the 1366x768 fixup codes Gustavo Padovan <gustavo@padovan.org> - 2017-01-16 20:50 +0100
Re: [PATCH] drm: Clean up the 1366x768 fixup codes Takashi Iwai <tiwai@suse.de> - 2017-01-16 21:20 +0100
| From | Takashi Iwai <tiwai@suse.de> |
|---|---|
| Date | 2017-01-16 16:00 +0100 |
| Subject | [PATCH] drm: Clean up the 1366x768 fixup codes |
| Message-ID | <t0gVk-1Kl-29@gated-at.bofh.it> |
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.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
drivers/gpu/drm/drm_crtc_internal.h | 3 +++
drivers/gpu/drm/drm_edid.c | 6 +++---
drivers/gpu/drm/drm_modes.c | 9 ++-------
3 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/drm_crtc_internal.h b/drivers/gpu/drm/drm_crtc_internal.h
index cdf6860c9d22..01bde7103ad6 100644
--- a/drivers/gpu/drm/drm_crtc_internal.h
+++ b/drivers/gpu/drm/drm_crtc_internal.h
@@ -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);
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 336be31ff3de..739a19cb27d9 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -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);
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index e6b19bc9021a..860f4d1ffbde 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -1461,13 +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);
- }
- drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);
+ if (cmd->xres == 1366)
+ drm_mode_fixup_1366x768(mode);
return mode;
}
EXPORT_SYMBOL(drm_mode_create_from_cmdline_mode);
--
2.11.0
[toc] | [next] | [standalone]
| From | Gustavo Padovan <gustavo@padovan.org> |
|---|---|
| Date | 2017-01-16 20:50 +0100 |
| Message-ID | <t0lrX-58K-11@gated-at.bofh.it> |
| In reply to | #1559816 |
Hi Takashi,
2017-01-16 Takashi Iwai <tiwai@suse.de>:
> 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.
>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
> drivers/gpu/drm/drm_crtc_internal.h | 3 +++
> drivers/gpu/drm/drm_edid.c | 6 +++---
> drivers/gpu/drm/drm_modes.c | 9 ++-------
> 3 files changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_crtc_internal.h b/drivers/gpu/drm/drm_crtc_internal.h
> index cdf6860c9d22..01bde7103ad6 100644
> --- a/drivers/gpu/drm/drm_crtc_internal.h
> +++ b/drivers/gpu/drm/drm_crtc_internal.h
> @@ -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);
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 336be31ff3de..739a19cb27d9 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -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);
> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> index e6b19bc9021a..860f4d1ffbde 100644
> --- a/drivers/gpu/drm/drm_modes.c
> +++ b/drivers/gpu/drm/drm_modes.c
> @@ -1461,13 +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);
> - }
> - drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);
At a glance removing the call to drm_mode_set_crtcinfo() seems a
functional change to me. I'm not sure why you removed it.
Gustavo
[toc] | [prev] | [next] | [standalone]
| From | Takashi Iwai <tiwai@suse.de> |
|---|---|
| Date | 2017-01-16 21:20 +0100 |
| Message-ID | <t0lV0-5Di-11@gated-at.bofh.it> |
| In reply to | #1560017 |
On Mon, 16 Jan 2017 20:16:04 +0100,
Gustavo Padovan wrote:
>
> Hi Takashi,
>
> 2017-01-16 Takashi Iwai <tiwai@suse.de>:
>
> > 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.
> >
> > Signed-off-by: Takashi Iwai <tiwai@suse.de>
> > ---
> > drivers/gpu/drm/drm_crtc_internal.h | 3 +++
> > drivers/gpu/drm/drm_edid.c | 6 +++---
> > drivers/gpu/drm/drm_modes.c | 9 ++-------
> > 3 files changed, 8 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_crtc_internal.h b/drivers/gpu/drm/drm_crtc_internal.h
> > index cdf6860c9d22..01bde7103ad6 100644
> > --- a/drivers/gpu/drm/drm_crtc_internal.h
> > +++ b/drivers/gpu/drm/drm_crtc_internal.h
> > @@ -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);
> > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> > index 336be31ff3de..739a19cb27d9 100644
> > --- a/drivers/gpu/drm/drm_edid.c
> > +++ b/drivers/gpu/drm/drm_edid.c
> > @@ -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);
> > diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> > index e6b19bc9021a..860f4d1ffbde 100644
> > --- a/drivers/gpu/drm/drm_modes.c
> > +++ b/drivers/gpu/drm/drm_modes.c
> > @@ -1461,13 +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);
> > - }
> > - drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);
>
> At a glance removing the call to drm_mode_set_crtcinfo() seems a
> functional change to me. I'm not sure why you removed it.
Oops, of course it's wrong. It shouldn't have been deleted.
Will resubmit the proper patch.
Thanks for catching!
Takashi
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web