.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /************************************************************************** |
---|
2 | 3 | * Copyright (c) 2007-2011, Intel Corporation. |
---|
3 | 4 | * 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. |
---|
17 | 5 | * |
---|
18 | 6 | * Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to |
---|
19 | 7 | * develop this driver. |
---|
20 | 8 | * |
---|
21 | 9 | **************************************************************************/ |
---|
22 | 10 | |
---|
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> |
---|
32 | 11 | #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> |
---|
33 | 21 | |
---|
34 | | -#include <drm/drmP.h> |
---|
35 | 22 | #include <drm/drm.h> |
---|
36 | 23 | #include <drm/drm_crtc.h> |
---|
| 24 | +#include <drm/drm_fb_helper.h> |
---|
| 25 | +#include <drm/drm_fourcc.h> |
---|
37 | 26 | |
---|
38 | 27 | #include "psb_drv.h" |
---|
39 | 28 | #include "psb_reg.h" |
---|
40 | | -#include "framebuffer.h" |
---|
41 | 29 | |
---|
42 | 30 | /** |
---|
43 | 31 | * psb_spank - reset the 2D engine |
---|
.. | .. |
---|
238 | 226 | static void psbfb_copyarea_accel(struct fb_info *info, |
---|
239 | 227 | const struct fb_copyarea *a) |
---|
240 | 228 | { |
---|
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; |
---|
246 | 233 | uint32_t offset; |
---|
247 | 234 | uint32_t stride; |
---|
248 | 235 | uint32_t src_format; |
---|
.. | .. |
---|
251 | 238 | if (!fb) |
---|
252 | 239 | return; |
---|
253 | 240 | |
---|
| 241 | + dev = fb->dev; |
---|
| 242 | + dev_priv = dev->dev_private; |
---|
254 | 243 | offset = to_gtt_range(fb->obj[0])->offset; |
---|
255 | 244 | stride = fb->pitches[0]; |
---|
256 | 245 | |
---|
.. | .. |
---|
321 | 310 | */ |
---|
322 | 311 | int psbfb_sync(struct fb_info *info) |
---|
323 | 312 | { |
---|
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; |
---|
327 | 316 | struct drm_psb_private *dev_priv = dev->dev_private; |
---|
328 | 317 | unsigned long _end = jiffies + HZ; |
---|
329 | 318 | int busy = 0; |
---|