hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/drivers/gpu/drm/omapdrm/omap_fbdev.c
....@@ -1,22 +1,14 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
34 * 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/>.
165 */
176
187 #include <drm/drm_crtc.h>
8
+#include <drm/drm_util.h>
199 #include <drm/drm_fb_helper.h>
10
+#include <drm/drm_file.h>
11
+#include <drm/drm_fourcc.h>
2012
2113 #include "omap_drv.h"
2214
....@@ -78,7 +70,7 @@
7870 return drm_fb_helper_pan_display(var, fbi);
7971 }
8072
81
-static struct fb_ops omap_fb_ops = {
73
+static const struct fb_ops omap_fb_ops = {
8274 .owner = THIS_MODULE,
8375
8476 .fb_check_var = drm_fb_helper_check_var,
....@@ -86,8 +78,6 @@
8678 .fb_setcmap = drm_fb_helper_setcmap,
8779 .fb_blank = drm_fb_helper_blank,
8880 .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,
9181 .fb_ioctl = drm_fb_helper_ioctl,
9282
9383 .fb_read = drm_fb_helper_sys_read,
....@@ -150,7 +140,7 @@
150140 /* note: if fb creation failed, we can't rely on fb destroy
151141 * to unref the bo:
152142 */
153
- drm_gem_object_unreference_unlocked(fbdev->bo);
143
+ drm_gem_object_put(fbdev->bo);
154144 ret = PTR_ERR(fb);
155145 goto fail;
156146 }
....@@ -182,13 +172,9 @@
182172 fbdev->fb = fb;
183173 helper->fb = fb;
184174
185
- fbi->par = helper;
186175 fbi->fbops = &omap_fb_ops;
187176
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);
192178
193179 dev->mode_config.fb_base = dma_addr;
194180
....@@ -243,7 +229,7 @@
243229 struct drm_fb_helper *helper;
244230 int ret = 0;
245231
246
- if (!priv->num_crtcs || !priv->num_connectors)
232
+ if (!priv->num_pipes)
247233 return;
248234
249235 fbdev = kzalloc(sizeof(*fbdev), GFP_KERNEL);
....@@ -256,13 +242,9 @@
256242
257243 drm_fb_helper_prepare(dev, helper, &omap_fb_helper_funcs);
258244
259
- ret = drm_fb_helper_init(dev, helper, priv->num_connectors);
245
+ ret = drm_fb_helper_init(dev, helper);
260246 if (ret)
261247 goto fail;
262
-
263
- ret = drm_fb_helper_single_add_all_connectors(helper);
264
- if (ret)
265
- goto fini;
266248
267249 ret = drm_fb_helper_initial_config(helper, 32);
268250 if (ret)