forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/gpu/drm/gma500/accel_2d.c
....@@ -1,43 +1,31 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /**************************************************************************
23 * Copyright (c) 2007-2011, Intel Corporation.
34 * All Rights Reserved.
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms and conditions of the GNU General Public License,
7
- * version 2, as published by the Free Software Foundation.
8
- *
9
- * This program is distributed in the hope it will be useful, but WITHOUT
10
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
- * more details.
13
- *
14
- * You should have received a copy of the GNU General Public License along with
15
- * this program; if not, write to the Free Software Foundation, Inc.,
16
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
175 *
186 * Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to
197 * develop this driver.
208 *
219 **************************************************************************/
2210
23
-#include <linux/module.h>
24
-#include <linux/kernel.h>
25
-#include <linux/errno.h>
26
-#include <linux/string.h>
27
-#include <linux/mm.h>
28
-#include <linux/tty.h>
29
-#include <linux/slab.h>
30
-#include <linux/delay.h>
31
-#include <linux/init.h>
3211 #include <linux/console.h>
12
+#include <linux/delay.h>
13
+#include <linux/errno.h>
14
+#include <linux/init.h>
15
+#include <linux/kernel.h>
16
+#include <linux/mm.h>
17
+#include <linux/module.h>
18
+#include <linux/slab.h>
19
+#include <linux/string.h>
20
+#include <linux/tty.h>
3321
34
-#include <drm/drmP.h>
3522 #include <drm/drm.h>
3623 #include <drm/drm_crtc.h>
24
+#include <drm/drm_fb_helper.h>
25
+#include <drm/drm_fourcc.h>
3726
3827 #include "psb_drv.h"
3928 #include "psb_reg.h"
40
-#include "framebuffer.h"
4129
4230 /**
4331 * psb_spank - reset the 2D engine
....@@ -238,11 +226,10 @@
238226 static void psbfb_copyarea_accel(struct fb_info *info,
239227 const struct fb_copyarea *a)
240228 {
241
- struct psb_fbdev *fbdev = info->par;
242
- struct psb_framebuffer *psbfb = &fbdev->pfb;
243
- struct drm_device *dev = psbfb->base.dev;
244
- struct drm_framebuffer *fb = fbdev->psb_fb_helper.fb;
245
- struct drm_psb_private *dev_priv = dev->dev_private;
229
+ struct drm_fb_helper *fb_helper = info->par;
230
+ struct drm_framebuffer *fb = fb_helper->fb;
231
+ struct drm_device *dev;
232
+ struct drm_psb_private *dev_priv;
246233 uint32_t offset;
247234 uint32_t stride;
248235 uint32_t src_format;
....@@ -251,6 +238,8 @@
251238 if (!fb)
252239 return;
253240
241
+ dev = fb->dev;
242
+ dev_priv = dev->dev_private;
254243 offset = to_gtt_range(fb->obj[0])->offset;
255244 stride = fb->pitches[0];
256245
....@@ -321,9 +310,9 @@
321310 */
322311 int psbfb_sync(struct fb_info *info)
323312 {
324
- struct psb_fbdev *fbdev = info->par;
325
- struct psb_framebuffer *psbfb = &fbdev->pfb;
326
- struct drm_device *dev = psbfb->base.dev;
313
+ struct drm_fb_helper *fb_helper = info->par;
314
+ struct drm_framebuffer *fb = fb_helper->fb;
315
+ struct drm_device *dev = fb->dev;
327316 struct drm_psb_private *dev_priv = dev->dev_private;
328317 unsigned long _end = jiffies + HZ;
329318 int busy = 0;