]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
Revert "drm: xilinx: crtc: Add crtc set config helper"
authorHyun Kwon <hyun.kwon@xilinx.com>
Tue, 1 Aug 2017 17:07:25 +0000 (10:07 -0700)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 2 Aug 2017 06:45:54 +0000 (08:45 +0200)
This reverts commit 589d1b61a232
("drm: xilinx: crtc: Add crtc set config helper").

This patch results in the fbconsole looking strange. For example,
if fbconsole is set to 1080p, while modeset changes to 4k, it ends up
with 2 fbconsole next to each other.

Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com>
CC: Preetesh Parekh <preetesh.parekh@xilinx.com>
CC: Christian Kohn <christian.kohn@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/gpu/drm/xilinx/xilinx_drm_crtc.c
drivers/gpu/drm/xilinx/xilinx_drm_drv.c
drivers/gpu/drm/xilinx/xilinx_drm_drv.h
drivers/gpu/drm/xilinx/xilinx_drm_fb.c
drivers/gpu/drm/xilinx/xilinx_drm_fb.h

index ef4499e39a15caae1c5d008434781be870136340..1ceb7e935968183b65eea8b3388b2d0a772360e7 100644 (file)
@@ -285,16 +285,6 @@ void xilinx_drm_crtc_destroy(struct drm_crtc *base_crtc)
        xilinx_drm_plane_remove_manager(crtc->plane_manager);
 }
 
-/* crtc set config helper */
-static int xilinx_drm_crtc_helper_set_config(struct drm_mode_set *set)
-{
-       struct drm_device *drm = set->crtc->dev;
-
-       xilinx_drm_set_config(drm, set);
-
-       return drm_crtc_helper_set_config(set);
-}
-
 /* cancel page flip functions */
 void xilinx_drm_crtc_cancel_page_flip(struct drm_crtc *base_crtc,
                                      struct drm_file *file)
@@ -461,7 +451,7 @@ unsigned int xilinx_drm_crtc_get_align(struct drm_crtc *base_crtc)
 
 static struct drm_crtc_funcs xilinx_drm_crtc_funcs = {
        .destroy        = xilinx_drm_crtc_destroy,
-       .set_config     = xilinx_drm_crtc_helper_set_config,
+       .set_config     = drm_crtc_helper_set_config,
        .page_flip      = xilinx_drm_crtc_page_flip,
 };
 
index 13a4321ebe73c91438792b56adba96031a32af2c..b85ebc673b7cbb01b6081ff7203e0f137196bc65 100644 (file)
@@ -147,14 +147,6 @@ unsigned int xilinx_drm_get_align(struct drm_device *drm)
        return xilinx_drm_crtc_get_align(private->crtc);
 }
 
-void xilinx_drm_set_config(struct drm_device *drm, struct drm_mode_set *set)
-{
-       struct xilinx_drm_private *private = drm->dev_private;
-
-       if (private && private->fb)
-               xilinx_drm_fb_set_config(private->fb, set);
-}
-
 /* poll changed handler */
 static void xilinx_drm_output_poll_changed(struct drm_device *drm)
 {
index 223fc80c9b9384f1f4412ee23fab6247a7f7b3c1..b8c42d0f73e32dd052374a7e4f126d664b7b7d66 100644 (file)
@@ -57,11 +57,9 @@ static inline void xilinx_drm_set(void __iomem *base, int offset, u32 set)
 }
 
 struct drm_device;
-struct drm_mode_set;
 
 bool xilinx_drm_check_format(struct drm_device *drm, uint32_t fourcc);
 uint32_t xilinx_drm_get_format(struct drm_device *drm);
 unsigned int xilinx_drm_get_align(struct drm_device *drm);
-void xilinx_drm_set_config(struct drm_device *drm, struct drm_mode_set *set);
 
 #endif /* _XILINX_DRM_H_ */
index 60ce6e572dd0b57704607a1d9d08f9d43772d8a0..8856806287dc51cef15478c793ea3f4c419fab7b 100644 (file)
@@ -38,8 +38,6 @@ struct xilinx_drm_fbdev {
        struct xilinx_drm_fb    *fb;
        unsigned int align;
        unsigned int vres_mult;
-       struct drm_display_mode old_mode;
-       bool mode_backup;
 };
 
 static inline struct xilinx_drm_fbdev *to_fbdev(struct drm_fb_helper *fb_helper)
@@ -169,30 +167,6 @@ static int xilinx_drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
        return ret;
 }
 
-/**
- * xilinx_drm_fb_set_config - synchronize resolution changes with fbdev
- * @fb_helper: fb helper structure
- * @set: mode set configuration
- */
-void xilinx_drm_fb_set_config(struct drm_fb_helper *fb_helper,
-                               struct drm_mode_set *set)
-{
-       if (fb_helper && set) {
-               struct xilinx_drm_fbdev *fbdev = to_fbdev(fb_helper);
-
-               if (fbdev && fb_helper->crtc_info &&
-                   fb_helper->crtc_info[0].mode_set.mode && set->mode) {
-                       if (!fbdev->mode_backup) {
-                               fbdev->old_mode =
-                                       *fb_helper->crtc_info[0].mode_set.mode;
-                               fbdev->mode_backup = true;
-                       }
-                       drm_mode_copy(fb_helper->crtc_info[0].mode_set.mode,
-                                       set->mode);
-               }
-       }
-}
-
 static int
 xilinx_drm_fb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
 {
@@ -441,19 +415,10 @@ void xilinx_drm_fb_fini(struct drm_fb_helper *fb_helper)
  */
 void xilinx_drm_fb_restore_mode(struct drm_fb_helper *fb_helper)
 {
-       struct xilinx_drm_fbdev *fbdev = to_fbdev(fb_helper);
+       if (!fb_helper)
+               return;
 
-       /* restore old display mode */
-       if (fb_helper && fbdev && fbdev->mode_backup &&
-           fb_helper->crtc_info &&
-           fb_helper->crtc_info[0].mode_set.mode) {
-               drm_mode_copy(fb_helper->crtc_info[0].mode_set.mode,
-                               &(fbdev->old_mode));
-               fbdev->mode_backup = false;
-       }
-
-       if (fb_helper)
-               drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper);
+       drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper);
 }
 
 /**
@@ -538,13 +503,8 @@ err_gem_object_unreference:
  */
 void xilinx_drm_fb_hotplug_event(struct drm_fb_helper *fb_helper)
 {
-       if (fb_helper) {
-               struct xilinx_drm_fbdev *fbdev = to_fbdev(fb_helper);
-
-               if (fbdev)
-                       fbdev->mode_backup = false;
-       }
+       if (!fb_helper)
+               return;
 
-       if (fb_helper)
-               drm_fb_helper_hotplug_event(fb_helper);
+       drm_fb_helper_hotplug_event(fb_helper);
 }
index 1632ba6c586d406b3585df219fa5073d74d5e524..c0681bddbfd746e22f7a7e19ea2ba656e9a22495 100644 (file)
@@ -34,7 +34,5 @@ struct drm_framebuffer *
 xilinx_drm_fb_create(struct drm_device *drm, struct drm_file *file_priv,
                     const struct drm_mode_fb_cmd2 *mode_cmd);
 void xilinx_drm_fb_hotplug_event(struct drm_fb_helper *fb_helper);
-void xilinx_drm_fb_set_config(struct drm_fb_helper *fb_helper,
-                               struct drm_mode_set *set);
 
 #endif /* _XILINX_DRM_FB_H_ */