History

drm: Unexport primary plane helpers

Well except the destroy helper, which isn't really a primary helper but generally useful, if mislabelled. v2: Keep some of the nice comments about the limitations of the primarmy plane helpers, and put them into the kerneldoc for drm_crtc_init() (Sam).

Daniel Vetter committed 8 years ago

Commit 6b6fce61 parent e6a3e403 files · +26 −84Browse files

Unified · Split

3 files
  1. drivers/gpu/drm/drm_modeset_helper.c +15 −0
  2. drivers/gpu/drm/drm_plane_helper.c +11 −74
  3. include/drm/drm_plane_helper.h +0 −10
drivers/gpu/drm/drm_modeset_helper.c+15−0
@@ -146,6 +146,21 @@ static struct drm_plane *create_primary_plane(struct drm_device *dev) · 145 unmodified lines
146 * Initialize a CRTC object with a default helper-provided primary plane and no146 * Initialize a CRTC object with a default helper-provided primary plane and no
147 * cursor plane.147 * cursor plane.
148 *148 *
149 * Note that we make some assumptions about hardware limitations that may not be
150 * true for all hardware:
151 *
152 * 1. Primary plane cannot be repositioned.
153 * 2. Primary plane cannot be scaled.
154 * 3. Primary plane must cover the entire CRTC.
155 * 4. Subpixel positioning is not supported.
156 * 5. The primary plane must always be on if the CRTC is enabled.
157 *
158 * This is purely a backwards compatibility helper for old drivers. Drivers
159 * should instead implement their own primary plane. Atomic drivers must do so.
160 * Drivers with the above hardware restriction can look into using &struct
161 * drm_simple_display_pipe, which encapsulates the above limitations into a nice
162 * interface.
163 *
149 * Returns:164 * Returns:
150 * Zero on success, error code on failure.165 * Zero on success, error code on failure.
151 */166 */
drivers/gpu/drm/drm_plane_helper.c+11−74
@@ -42,11 +42,8 @@ · 41 unmodified lines
42 * primary plane support on top of the normal CRTC configuration interface.42 * primary plane support on top of the normal CRTC configuration interface.
43 * Since the legacy &drm_mode_config_funcs.set_config interface ties the primary43 * Since the legacy &drm_mode_config_funcs.set_config interface ties the primary
44 * plane together with the CRTC state this does not allow userspace to disable44 * plane together with the CRTC state this does not allow userspace to disable
45 * the primary plane itself. To avoid too much duplicated code use45 * the primary plane itself. The default primary plane only expose XRBG8888 and
46 * drm_plane_helper_check_update() which can be used to enforce the same46 * ARGB8888 as valid pixel formats for the attached framebuffer.
47 * restrictions as primary planes had thus. The default primary plane only
48 * expose XRBG8888 and ARGB8888 as valid pixel formats for the attached
49 * framebuffer.
50 *47 *
51 * Drivers are highly recommended to implement proper support for primary48 * Drivers are highly recommended to implement proper support for primary
52 * planes, and newly merged drivers must not rely upon these transitional49 * planes, and newly merged drivers must not rely upon these transitional
@@ -175,50 +172,13 @@ int drm_plane_helper_check_update(struct drm_plane *plane, · 122 unmodified lines
175}172}
176EXPORT_SYMBOL(drm_plane_helper_check_update);173EXPORT_SYMBOL(drm_plane_helper_check_update);
177 174
178/**175static int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc,
179 * drm_primary_helper_update() - Helper for primary plane update176 struct drm_framebuffer *fb,
180 * @plane: plane object to update177 int crtc_x, int crtc_y,
181 * @crtc: owning CRTC of owning plane178 unsigned int crtc_w, unsigned int crtc_h,
182 * @fb: framebuffer to flip onto plane179 uint32_t src_x, uint32_t src_y,
183 * @crtc_x: x offset of primary plane on crtc180 uint32_t src_w, uint32_t src_h,
184 * @crtc_y: y offset of primary plane on crtc181 struct drm_modeset_acquire_ctx *ctx)
185 * @crtc_w: width of primary plane rectangle on crtc
186 * @crtc_h: height of primary plane rectangle on crtc
187 * @src_x: x offset of @fb for panning
188 * @src_y: y offset of @fb for panning
189 * @src_w: width of source rectangle in @fb
190 * @src_h: height of source rectangle in @fb
191 * @ctx: lock acquire context, not used here
192 *
193 * Provides a default plane update handler for primary planes. This is handler
194 * is called in response to a userspace SetPlane operation on the plane with a
195 * non-NULL framebuffer. We call the driver's modeset handler to update the
196 * framebuffer.
197 *
198 * SetPlane() on a primary plane of a disabled CRTC is not supported, and will
199 * return an error.
200 *
201 * Note that we make some assumptions about hardware limitations that may not be
202 * true for all hardware --
203 *
204 * 1. Primary plane cannot be repositioned.
205 * 2. Primary plane cannot be scaled.
206 * 3. Primary plane must cover the entire CRTC.
207 * 4. Subpixel positioning is not supported.
208 *
209 * Drivers for hardware that don't have these restrictions can provide their
210 * own implementation rather than using this helper.
211 *
212 * RETURNS:
213 * Zero on success, error code on failure
214 */
215int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc,
216 struct drm_framebuffer *fb,
217 int crtc_x, int crtc_y,
218 unsigned int crtc_w, unsigned int crtc_h,
219 uint32_t src_x, uint32_t src_y,
220 uint32_t src_w, uint32_t src_h,
221 struct drm_modeset_acquire_ctx *ctx)
222{182{
223 struct drm_mode_set set = {183 struct drm_mode_set set = {
224 .crtc = crtc,184 .crtc = crtc,
@@ -285,35 +245,12 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, · 60 unmodified lines
285 kfree(connector_list);245 kfree(connector_list);
286 return ret;246 return ret;
287}247}
288EXPORT_SYMBOL(drm_primary_helper_update);
289 248
290/**249static int drm_primary_helper_disable(struct drm_plane *plane,
291 * drm_primary_helper_disable() - Helper for primary plane disable250 struct drm_modeset_acquire_ctx *ctx)
292 * @plane: plane to disable
293 * @ctx: lock acquire context, not used here
294 *
295 * Provides a default plane disable handler for primary planes. This is handler
296 * is called in response to a userspace SetPlane operation on the plane with a
297 * NULL framebuffer parameter. It unconditionally fails the disable call with
298 * -EINVAL the only way to disable the primary plane without driver support is
299 * to disable the entire CRTC. Which does not match the plane
300 * &drm_plane_funcs.disable_plane hook.
301 *
302 * Note that some hardware may be able to disable the primary plane without
303 * disabling the whole CRTC. Drivers for such hardware should provide their
304 * own disable handler that disables just the primary plane (and they'll likely
305 * need to provide their own update handler as well to properly re-enable a
306 * disabled primary plane).
307 *
308 * RETURNS:
309 * Unconditionally returns -EINVAL.
310 */
311int drm_primary_helper_disable(struct drm_plane *plane,
312 struct drm_modeset_acquire_ctx *ctx)
313{251{
314 return -EINVAL;252 return -EINVAL;
315}253}
316EXPORT_SYMBOL(drm_primary_helper_disable);
317 254
318/**255/**
319 * drm_primary_helper_destroy() - Helper for primary plane destruction256 * drm_primary_helper_destroy() - Helper for primary plane destruction
include/drm/drm_plane_helper.h+0−10
@@ -49,16 +49,6 @@ int drm_plane_helper_check_update(struct drm_plane *plane, · 48 unmodified lines
49 bool can_position,49 bool can_position,
50 bool can_update_disabled,50 bool can_update_disabled,
51 bool *visible);51 bool *visible);
52int drm_primary_helper_update(struct drm_plane *plane,
53 struct drm_crtc *crtc,
54 struct drm_framebuffer *fb,
55 int crtc_x, int crtc_y,
56 unsigned int crtc_w, unsigned int crtc_h,
57 uint32_t src_x, uint32_t src_y,
58 uint32_t src_w, uint32_t src_h,
59 struct drm_modeset_acquire_ctx *ctx);
60int drm_primary_helper_disable(struct drm_plane *plane,
61 struct drm_modeset_acquire_ctx *ctx);
62void drm_primary_helper_destroy(struct drm_plane *plane);52void drm_primary_helper_destroy(struct drm_plane *plane);
63extern const struct drm_plane_funcs drm_primary_helper_funcs;53extern const struct drm_plane_funcs drm_primary_helper_funcs;
64 54

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t