Skip to content

Commit 7716384

Browse files
mripardpelwell
authored andcommitted
Revert "drm: Introduce new state accessors in place of drm_atomic_get_crtc_state"
This reverts commit 040d0dd.
1 parent bbcfd43 commit 7716384

2 files changed

Lines changed: 0 additions & 111 deletions

File tree

‎drivers/gpu/drm/drm_atomic.c‎

Lines changed: 0 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -281,10 +281,6 @@ EXPORT_SYMBOL(__drm_atomic_state_free);
281281
* needed. It will also grab the relevant CRTC lock to make sure that the state
282282
* is consistent.
283283
*
284-
* This function is deprecated,
285-
* @drm_atomic_get_old_or_current_crtc_state or
286-
* @drm_atomic_get_new_or_current_crtc_state should be used instead.
287-
*
288284
* Returns:
289285
*
290286
* Either the allocated state or the error code encoded into the pointer. When
@@ -325,106 +321,6 @@ drm_atomic_get_crtc_state(struct drm_atomic_state *state,
325321
}
326322
EXPORT_SYMBOL(drm_atomic_get_crtc_state);
327323

328-
/**
329-
* drm_atomic_get_old_or_current_crtc_state - get CRTC state
330-
* @state: global atomic state object
331-
* @crtc: CRTC to get state object for
332-
*
333-
* This function returns the old CRTC state for the given CRTC if it's
334-
* part of the state, or allocating a copy of the current state
335-
* otherwise. It will also grab the relevant CRTC lock to make sure that
336-
* the state is consistent.
337-
*
338-
* Returns:
339-
*
340-
* Either the allocated state or the error code encoded into the pointer. When
341-
* the error is EDEADLK then the w/w mutex code has detected a deadlock and the
342-
* entire atomic sequence must be restarted. All other errors are fatal.
343-
*/
344-
struct drm_crtc_state *
345-
drm_atomic_get_old_or_current_crtc_state(struct drm_atomic_state *state,
346-
struct drm_crtc *crtc)
347-
{
348-
int ret, index = drm_crtc_index(crtc);
349-
struct drm_crtc_state *crtc_state;
350-
351-
WARN_ON(!state->acquire_ctx);
352-
353-
crtc_state = drm_atomic_get_old_crtc_state(state, crtc);
354-
if (crtc_state)
355-
return crtc_state;
356-
357-
ret = drm_modeset_lock(&crtc->mutex, state->acquire_ctx);
358-
if (ret)
359-
return ERR_PTR(ret);
360-
361-
crtc_state = crtc->funcs->atomic_duplicate_state(crtc);
362-
if (!crtc_state)
363-
return ERR_PTR(-ENOMEM);
364-
365-
state->crtcs[index].state = crtc_state;
366-
state->crtcs[index].old_state = crtc->state;
367-
state->crtcs[index].new_state = crtc_state;
368-
state->crtcs[index].ptr = crtc;
369-
crtc_state->state = state;
370-
371-
DRM_DEBUG_ATOMIC("Added [CRTC:%d:%s] %p state to %p\n",
372-
crtc->base.id, crtc->name, crtc_state, state);
373-
374-
return crtc_state;
375-
}
376-
EXPORT_SYMBOL(drm_atomic_get_old_or_current_crtc_state);
377-
378-
/**
379-
* drm_atomic_get_new_or_current_crtc_state - get CRTC state
380-
* @state: global atomic state object
381-
* @crtc: CRTC to get state object for
382-
*
383-
* This function returns the new CRTC state for the given CRTC if it's
384-
* part of the state, or allocating a copy of the current state
385-
* otherwise. It will also grab the relevant CRTC lock to make sure that
386-
* the state is consistent.
387-
*
388-
* Returns:
389-
*
390-
* Either the allocated state or the error code encoded into the pointer. When
391-
* the error is EDEADLK then the w/w mutex code has detected a deadlock and the
392-
* entire atomic sequence must be restarted. All other errors are fatal.
393-
*/
394-
struct drm_crtc_state *
395-
drm_atomic_get_new_or_current_crtc_state(struct drm_atomic_state *state,
396-
struct drm_crtc *crtc)
397-
{
398-
int ret, index = drm_crtc_index(crtc);
399-
struct drm_crtc_state *crtc_state;
400-
401-
WARN_ON(!state->acquire_ctx);
402-
403-
crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
404-
if (crtc_state)
405-
return crtc_state;
406-
407-
ret = drm_modeset_lock(&crtc->mutex, state->acquire_ctx);
408-
if (ret)
409-
return ERR_PTR(ret);
410-
411-
crtc_state = crtc->funcs->atomic_duplicate_state(crtc);
412-
if (!crtc_state)
413-
return ERR_PTR(-ENOMEM);
414-
415-
state->crtcs[index].state = crtc_state;
416-
state->crtcs[index].old_state = crtc->state;
417-
state->crtcs[index].new_state = crtc_state;
418-
state->crtcs[index].ptr = crtc;
419-
crtc_state->state = state;
420-
421-
DRM_DEBUG_ATOMIC("Added [CRTC:%d:%s] %p state to %p\n",
422-
crtc->base.id, crtc->name, crtc_state, state);
423-
424-
return crtc_state;
425-
}
426-
EXPORT_SYMBOL(drm_atomic_get_new_or_current_crtc_state);
427-
428324
static int drm_atomic_crtc_check(const struct drm_crtc_state *old_crtc_state,
429325
const struct drm_crtc_state *new_crtc_state)
430326
{

‎include/drm/drm_atomic.h‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -445,13 +445,6 @@ void drm_atomic_state_default_release(struct drm_atomic_state *state);
445445
struct drm_crtc_state * __must_check
446446
drm_atomic_get_crtc_state(struct drm_atomic_state *state,
447447
struct drm_crtc *crtc);
448-
struct drm_crtc_state * __must_check
449-
drm_atomic_get_new_or_current_crtc_state(struct drm_atomic_state *state,
450-
struct drm_crtc *crtc);
451-
struct drm_crtc_state * __must_check
452-
drm_atomic_get_old_or_current_crtc_state(struct drm_atomic_state *state,
453-
struct drm_crtc *crtc);
454-
455448
struct drm_plane_state * __must_check
456449
drm_atomic_get_plane_state(struct drm_atomic_state *state,
457450
struct drm_plane *plane);

0 commit comments

Comments
 (0)