]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
drm: Shrink drm_display_mode timings
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 28 Apr 2020 17:19:32 +0000 (20:19 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 27 May 2020 11:31:42 +0000 (14:31 +0300)
Store the timings (apart from the clock) as u16. The uapi mode
struct already uses u16 for everything so using something bigger
internally doesn't really help us.

Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200428171940.19552-9-ville.syrjala@linux.intel.com
drivers/gpu/drm/drm_modes.c
include/drm/drm_modes.h

index e3d5f011f7bd4c2b22ea84acc5ca5f134810a1f6..77d68120931ae2ebda9a8313785433451b6a1d97 100644 (file)
@@ -1901,13 +1901,6 @@ EXPORT_SYMBOL(drm_mode_create_from_cmdline_mode);
 void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out,
                               const struct drm_display_mode *in)
 {
-       WARN(in->hdisplay > USHRT_MAX || in->hsync_start > USHRT_MAX ||
-            in->hsync_end > USHRT_MAX || in->htotal > USHRT_MAX ||
-            in->hskew > USHRT_MAX || in->vdisplay > USHRT_MAX ||
-            in->vsync_start > USHRT_MAX || in->vsync_end > USHRT_MAX ||
-            in->vtotal > USHRT_MAX || in->vscan > USHRT_MAX,
-            "timing values too large for mode info\n");
-
        out->clock = in->clock;
        out->hdisplay = in->hdisplay;
        out->hsync_start = in->hsync_start;
index 5266d890c4b079ee635a7af11481844d12a2ebfb..a72e755b238d67acd205ba46a64b77e9e64ef50f 100644 (file)
@@ -279,16 +279,16 @@ struct drm_display_mode {
         * Pixel clock in kHz.
         */
        int clock;              /* in kHz */
-       int hdisplay;
-       int hsync_start;
-       int hsync_end;
-       int htotal;
-       int hskew;
-       int vdisplay;
-       int vsync_start;
-       int vsync_end;
-       int vtotal;
-       int vscan;
+       u16 hdisplay;
+       u16 hsync_start;
+       u16 hsync_end;
+       u16 htotal;
+       u16 hskew;
+       u16 vdisplay;
+       u16 vsync_start;
+       u16 vsync_end;
+       u16 vtotal;
+       u16 vscan;
        /**
         * @flags:
         *
@@ -357,19 +357,19 @@ struct drm_display_mode {
         * difference is exactly a factor of 10.
         */
        int crtc_clock;
-       int crtc_hdisplay;
-       int crtc_hblank_start;
-       int crtc_hblank_end;
-       int crtc_hsync_start;
-       int crtc_hsync_end;
-       int crtc_htotal;
-       int crtc_hskew;
-       int crtc_vdisplay;
-       int crtc_vblank_start;
-       int crtc_vblank_end;
-       int crtc_vsync_start;
-       int crtc_vsync_end;
-       int crtc_vtotal;
+       u16 crtc_hdisplay;
+       u16 crtc_hblank_start;
+       u16 crtc_hblank_end;
+       u16 crtc_hsync_start;
+       u16 crtc_hsync_end;
+       u16 crtc_htotal;
+       u16 crtc_hskew;
+       u16 crtc_vdisplay;
+       u16 crtc_vblank_start;
+       u16 crtc_vblank_end;
+       u16 crtc_vsync_start;
+       u16 crtc_vsync_end;
+       u16 crtc_vtotal;
 
        /**
         * @private_flags: