forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/gpu/drm/armada/armada_fb.c
....@@ -1,13 +1,13 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2012 Russell King
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
74 */
8
-#include <drm/drm_crtc_helper.h>
5
+
6
+#include <drm/drm_modeset_helper.h>
97 #include <drm/drm_fb_helper.h>
8
+#include <drm/drm_fourcc.h>
109 #include <drm/drm_gem_framebuffer_helper.h>
10
+
1111 #include "armada_drm.h"
1212 #include "armada_fb.h"
1313 #include "armada_gem.h"
....@@ -87,6 +87,7 @@
8787 struct drm_framebuffer *armada_fb_create(struct drm_device *dev,
8888 struct drm_file *dfile, const struct drm_mode_fb_cmd2 *mode)
8989 {
90
+ const struct drm_format_info *info = drm_get_format_info(dev, mode);
9091 struct armada_gem_object *obj;
9192 struct armada_framebuffer *dfb;
9293 int ret;
....@@ -97,7 +98,7 @@
9798 mode->pitches[2]);
9899
99100 /* We can only handle a single plane at the moment */
100
- if (drm_format_num_planes(mode->pixel_format) > 1 &&
101
+ if (info->num_planes > 1 &&
101102 (mode->handles[0] != mode->handles[1] ||
102103 mode->handles[0] != mode->handles[2])) {
103104 ret = -EINVAL;
....@@ -128,12 +129,12 @@
128129 goto err;
129130 }
130131
131
- drm_gem_object_put_unlocked(&obj->obj);
132
+ drm_gem_object_put(&obj->obj);
132133
133134 return &dfb->fb;
134135
135136 err_unref:
136
- drm_gem_object_put_unlocked(&obj->obj);
137
+ drm_gem_object_put(&obj->obj);
137138 err:
138139 DRM_ERROR("failed to initialize framebuffer: %d\n", ret);
139140 return ERR_PTR(ret);