.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ |
---|
3 | 4 | * Author: Rob Clark <rob@ti.com> |
---|
4 | | - * |
---|
5 | | - * This program is free software; you can redistribute it and/or modify it |
---|
6 | | - * under the terms of the GNU General Public License version 2 as published by |
---|
7 | | - * the Free Software Foundation. |
---|
8 | | - * |
---|
9 | | - * This program is distributed in the hope that 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, see <http://www.gnu.org/licenses/>. |
---|
16 | 5 | */ |
---|
17 | 6 | |
---|
18 | 7 | #include <drm/drm_crtc.h> |
---|
| 8 | +#include <drm/drm_util.h> |
---|
19 | 9 | #include <drm/drm_fb_helper.h> |
---|
| 10 | +#include <drm/drm_file.h> |
---|
| 11 | +#include <drm/drm_fourcc.h> |
---|
20 | 12 | |
---|
21 | 13 | #include "omap_drv.h" |
---|
22 | 14 | |
---|
.. | .. |
---|
78 | 70 | return drm_fb_helper_pan_display(var, fbi); |
---|
79 | 71 | } |
---|
80 | 72 | |
---|
81 | | -static struct fb_ops omap_fb_ops = { |
---|
| 73 | +static const struct fb_ops omap_fb_ops = { |
---|
82 | 74 | .owner = THIS_MODULE, |
---|
83 | 75 | |
---|
84 | 76 | .fb_check_var = drm_fb_helper_check_var, |
---|
.. | .. |
---|
86 | 78 | .fb_setcmap = drm_fb_helper_setcmap, |
---|
87 | 79 | .fb_blank = drm_fb_helper_blank, |
---|
88 | 80 | .fb_pan_display = omap_fbdev_pan_display, |
---|
89 | | - .fb_debug_enter = drm_fb_helper_debug_enter, |
---|
90 | | - .fb_debug_leave = drm_fb_helper_debug_leave, |
---|
91 | 81 | .fb_ioctl = drm_fb_helper_ioctl, |
---|
92 | 82 | |
---|
93 | 83 | .fb_read = drm_fb_helper_sys_read, |
---|
.. | .. |
---|
150 | 140 | /* note: if fb creation failed, we can't rely on fb destroy |
---|
151 | 141 | * to unref the bo: |
---|
152 | 142 | */ |
---|
153 | | - drm_gem_object_unreference_unlocked(fbdev->bo); |
---|
| 143 | + drm_gem_object_put(fbdev->bo); |
---|
154 | 144 | ret = PTR_ERR(fb); |
---|
155 | 145 | goto fail; |
---|
156 | 146 | } |
---|
.. | .. |
---|
182 | 172 | fbdev->fb = fb; |
---|
183 | 173 | helper->fb = fb; |
---|
184 | 174 | |
---|
185 | | - fbi->par = helper; |
---|
186 | 175 | fbi->fbops = &omap_fb_ops; |
---|
187 | 176 | |
---|
188 | | - strcpy(fbi->fix.id, MODULE_NAME); |
---|
189 | | - |
---|
190 | | - drm_fb_helper_fill_fix(fbi, fb->pitches[0], fb->format->depth); |
---|
191 | | - drm_fb_helper_fill_var(fbi, helper, sizes->fb_width, sizes->fb_height); |
---|
| 177 | + drm_fb_helper_fill_info(fbi, helper, sizes); |
---|
192 | 178 | |
---|
193 | 179 | dev->mode_config.fb_base = dma_addr; |
---|
194 | 180 | |
---|
.. | .. |
---|
243 | 229 | struct drm_fb_helper *helper; |
---|
244 | 230 | int ret = 0; |
---|
245 | 231 | |
---|
246 | | - if (!priv->num_crtcs || !priv->num_connectors) |
---|
| 232 | + if (!priv->num_pipes) |
---|
247 | 233 | return; |
---|
248 | 234 | |
---|
249 | 235 | fbdev = kzalloc(sizeof(*fbdev), GFP_KERNEL); |
---|
.. | .. |
---|
256 | 242 | |
---|
257 | 243 | drm_fb_helper_prepare(dev, helper, &omap_fb_helper_funcs); |
---|
258 | 244 | |
---|
259 | | - ret = drm_fb_helper_init(dev, helper, priv->num_connectors); |
---|
| 245 | + ret = drm_fb_helper_init(dev, helper); |
---|
260 | 246 | if (ret) |
---|
261 | 247 | goto fail; |
---|
262 | | - |
---|
263 | | - ret = drm_fb_helper_single_add_all_connectors(helper); |
---|
264 | | - if (ret) |
---|
265 | | - goto fini; |
---|
266 | 248 | |
---|
267 | 249 | ret = drm_fb_helper_initial_config(helper, 32); |
---|
268 | 250 | if (ret) |
---|