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
146146 * Initialize a CRTC object with a default helper-provided primary plane and no
147147 * cursor plane.
148148 *
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+ *
149164 * Returns:
150165 * Zero on success, error code on failure.
151166 */
drivers/gpu/drm/drm_plane_helper.c+11−74
@@ -42,11 +42,8 @@ · 41 unmodified lines
4242 * primary plane support on top of the normal CRTC configuration interface.
4343 * Since the legacy &drm_mode_config_funcs.set_config interface ties the primary
4444 * plane together with the CRTC state this does not allow userspace to disable
45− * the primary plane itself. To avoid too much duplicated code use
46− * drm_plane_helper_check_update() which can be used to enforce the same
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.
45+ * the primary plane itself. The default primary plane only expose XRBG8888 and
46+ * ARGB8888 as valid pixel formats for the attached framebuffer.
5047 *
5148 * Drivers are highly recommended to implement proper support for primary
5249 * 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
175172 }
176173 EXPORT_SYMBOL(drm_plane_helper_check_update);
177174
178−/**
179− * drm_primary_helper_update() - Helper for primary plane update
180− * @plane: plane object to update
181− * @crtc: owning CRTC of owning plane
182− * @fb: framebuffer to flip onto plane
183− * @crtc_x: x offset of primary plane on crtc
184− * @crtc_y: y offset of primary plane on crtc
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− */
215−int 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)
175+static int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc,
176+ struct drm_framebuffer *fb,
177+ int crtc_x, int crtc_y,
178+ unsigned int crtc_w, unsigned int crtc_h,
179+ uint32_t src_x, uint32_t src_y,
180+ uint32_t src_w, uint32_t src_h,
181+ struct drm_modeset_acquire_ctx *ctx)
222182 {
223183 struct drm_mode_set set = {
224184 .crtc = crtc,
@@ -285,35 +245,12 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, · 60 unmodified lines
285245 kfree(connector_list);
286246 return ret;
287247 }
288−EXPORT_SYMBOL(drm_primary_helper_update);
289248
290−/**
291− * drm_primary_helper_disable() - Helper for primary plane disable
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− */
311−int drm_primary_helper_disable(struct drm_plane *plane,
312− struct drm_modeset_acquire_ctx *ctx)
249+static int drm_primary_helper_disable(struct drm_plane *plane,
250+ struct drm_modeset_acquire_ctx *ctx)
313251 {
314252 return -EINVAL;
315253 }
316−EXPORT_SYMBOL(drm_primary_helper_disable);
317254
318255 /**
319256 * 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
4949 bool can_position,
5050 bool can_update_disabled,
5151 bool *visible);
52−int 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);
60−int drm_primary_helper_disable(struct drm_plane *plane,
61− struct drm_modeset_acquire_ctx *ctx);
6252 void drm_primary_helper_destroy(struct drm_plane *plane);
6353 extern const struct drm_plane_funcs drm_primary_helper_funcs;
6454

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