forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
....@@ -26,13 +26,13 @@
2626 *
2727 **************************************************************************/
2828
29
-#include <linux/export.h>
29
+#include <linux/pci.h>
3030
31
-#include <drm/drmP.h>
31
+#include <drm/drm_fourcc.h>
32
+#include <drm/ttm/ttm_placement.h>
33
+
3234 #include "vmwgfx_drv.h"
3335 #include "vmwgfx_kms.h"
34
-
35
-#include <drm/ttm/ttm_placement.h>
3636
3737 #define VMW_DIRTY_DELAY (HZ / 30)
3838
....@@ -498,7 +498,7 @@
498498
499499 static int vmw_fb_kms_framebuffer(struct fb_info *info)
500500 {
501
- struct drm_mode_fb_cmd2 mode_cmd;
501
+ struct drm_mode_fb_cmd2 mode_cmd = {0};
502502 struct vmw_fb_par *par = info->par;
503503 struct fb_var_screeninfo *var = &info->var;
504504 struct drm_framebuffer *cur_fb;
....@@ -624,7 +624,7 @@
624624 }
625625
626626
627
-static struct fb_ops vmw_fb_ops = {
627
+static const struct fb_ops vmw_fb_ops = {
628628 .owner = THIS_MODULE,
629629 .fb_check_var = vmw_fb_check_var,
630630 .fb_set_par = vmw_fb_set_par,
....@@ -642,12 +642,11 @@
642642 struct vmw_fb_par *par;
643643 struct fb_info *info;
644644 unsigned fb_width, fb_height;
645
- unsigned fb_bpp, fb_depth, fb_offset, fb_pitch, fb_size;
645
+ unsigned int fb_bpp, fb_pitch, fb_size;
646646 struct drm_display_mode *init_mode;
647647 int ret;
648648
649649 fb_bpp = 32;
650
- fb_depth = 24;
651650
652651 /* XXX As shouldn't these be as well. */
653652 fb_width = min(vmw_priv->fb_max_width, (unsigned)2048);
....@@ -655,7 +654,6 @@
655654
656655 fb_pitch = fb_width * fb_bpp / 8;
657656 fb_size = fb_pitch * fb_height;
658
- fb_offset = vmw_read(vmw_priv, SVGA_REG_FB_OFFSET);
659657
660658 info = framebuffer_alloc(sizeof(*par), device);
661659 if (!info)