Skip to content

Commit

Permalink
Merge tag 'topic/drm-misc-2015-04-15' of git://anongit.freedesktop.or…
Browse files Browse the repository at this point in the history
…g/drm-intel into drm-next

One more drm-misch pull for 4.1 with mostly simple stuff and boring
refactoring. Even the cursor fix from Matt is just to make a really anal
igt happy.

* tag 'topic/drm-misc-2015-04-15' of git://anongit.freedesktop.org/drm-intel:
  drm: fix trivial typo mistake
  drm: Make integer overflow checking cover universal cursor updates (v2)
  drm: make crtc/encoder/connector/plane helper_private a const pointer
  drm/armada: constify struct drm_encoder_helper_funcs pointer
  drm/radeon: constify more struct drm_*_helper funcs pointers
  drm/edid: add #defines for ELD versions
  drm/atomic: Add for_each_{connector,crtc,plane}_in_state helper macros
  drm: Use kref_put_mutex in drm_gem_object_unreference_unlocked
  drm/drm: constify all struct drm_*_helper funcs pointers
  drm/qxl: constify all struct drm_*_helper funcs pointers
  drm/nouveau: constify all struct drm_*_helper funcs pointers
  drm/radeon: constify all struct drm_*_helper funcs pointers
  drm/gma500: constify all struct drm_*_helper funcs pointers
  drm/mgag200: constify all struct drm_*_helper funcs pointers
  drm/exynos: constify all struct drm_*_helper funcs pointers
  drm: Fix some typos
  • Loading branch information
Dave Airlie committed Apr 15, 2015
2 parents 52139bd + 2b1193d commit 4a11248
Show file tree
Hide file tree
Showing 37 changed files with 213 additions and 314 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/armada/armada_output.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define ARMADA_CONNETOR_H

#define encoder_helper_funcs(encoder) \
((struct drm_encoder_helper_funcs *)encoder->helper_private)
((const struct drm_encoder_helper_funcs *)encoder->helper_private)

struct armada_output_type {
int connector_type;
Expand Down
66 changes: 20 additions & 46 deletions drivers/gpu/drm/drm_atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ drm_atomic_set_crtc_for_plane(struct drm_plane_state *plane_state,
EXPORT_SYMBOL(drm_atomic_set_crtc_for_plane);

/**
* drm_atomic_set_fb_for_plane - set crtc for plane
* drm_atomic_set_fb_for_plane - set framebuffer for plane
* @plane_state: atomic state object for the plane
* @fb: fb to use for the plane
*
Expand Down Expand Up @@ -909,14 +909,13 @@ int
drm_atomic_connectors_for_crtc(struct drm_atomic_state *state,
struct drm_crtc *crtc)
{
int i, num_connected_connectors = 0;

for (i = 0; i < state->num_connector; i++) {
struct drm_connector_state *conn_state;
struct drm_connector *connector;
struct drm_connector_state *conn_state;

conn_state = state->connector_states[i];
int i, num_connected_connectors = 0;

if (conn_state && conn_state->crtc == crtc)
for_each_connector_in_state(state, connector, conn_state, i) {
if (conn_state->crtc == crtc)
num_connected_connectors++;
}

Expand All @@ -933,7 +932,7 @@ EXPORT_SYMBOL(drm_atomic_connectors_for_crtc);
*
* This function should be used by legacy entry points which don't understand
* -EDEADLK semantics. For simplicity this one will grab all modeset locks after
* the slowpath completed.
* the slowpath completed.
*/
void drm_atomic_legacy_backoff(struct drm_atomic_state *state)
{
Expand Down Expand Up @@ -968,33 +967,25 @@ int drm_atomic_check_only(struct drm_atomic_state *state)
{
struct drm_device *dev = state->dev;
struct drm_mode_config *config = &dev->mode_config;
int nplanes = config->num_total_plane;
int ncrtcs = config->num_crtc;
struct drm_plane *plane;
struct drm_plane_state *plane_state;
struct drm_crtc *crtc;
struct drm_crtc_state *crtc_state;
int i, ret = 0;

DRM_DEBUG_ATOMIC("checking %p\n", state);

for (i = 0; i < nplanes; i++) {
struct drm_plane *plane = state->planes[i];

if (!plane)
continue;

ret = drm_atomic_plane_check(plane, state->plane_states[i]);
for_each_plane_in_state(state, plane, plane_state, i) {
ret = drm_atomic_plane_check(plane, plane_state);
if (ret) {
DRM_DEBUG_ATOMIC("[PLANE:%d] atomic core check failed\n",
plane->base.id);
return ret;
}
}

for (i = 0; i < ncrtcs; i++) {
struct drm_crtc *crtc = state->crtcs[i];

if (!crtc)
continue;

ret = drm_atomic_crtc_check(crtc, state->crtc_states[i]);
for_each_crtc_in_state(state, crtc, crtc_state, i) {
ret = drm_atomic_crtc_check(crtc, crtc_state);
if (ret) {
DRM_DEBUG_ATOMIC("[CRTC:%d] atomic core check failed\n",
crtc->base.id);
Expand All @@ -1006,13 +997,7 @@ int drm_atomic_check_only(struct drm_atomic_state *state)
ret = config->funcs->atomic_check(state->dev, state);

if (!state->allow_modeset) {
for (i = 0; i < ncrtcs; i++) {
struct drm_crtc *crtc = state->crtcs[i];
struct drm_crtc_state *crtc_state = state->crtc_states[i];

if (!crtc)
continue;

for_each_crtc_in_state(state, crtc, crtc_state, i) {
if (crtc_state->mode_changed ||
crtc_state->active_changed) {
DRM_DEBUG_ATOMIC("[CRTC:%d] requires full modeset\n",
Expand Down Expand Up @@ -1210,6 +1195,8 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
struct drm_atomic_state *state;
struct drm_modeset_acquire_ctx ctx;
struct drm_plane *plane;
struct drm_crtc *crtc;
struct drm_crtc_state *crtc_state;
unsigned plane_mask = 0;
int ret = 0;
unsigned int i, j;
Expand Down Expand Up @@ -1313,15 +1300,9 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
}

if (arg->flags & DRM_MODE_PAGE_FLIP_EVENT) {
int ncrtcs = dev->mode_config.num_crtc;

for (i = 0; i < ncrtcs; i++) {
struct drm_crtc_state *crtc_state = state->crtc_states[i];
for_each_crtc_in_state(state, crtc, crtc_state, i) {
struct drm_pending_vblank_event *e;

if (!crtc_state)
continue;

e = create_vblank_event(dev, file_priv, arg->user_data);
if (!e) {
ret = -ENOMEM;
Expand Down Expand Up @@ -1373,14 +1354,7 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
goto backoff;

if (arg->flags & DRM_MODE_PAGE_FLIP_EVENT) {
int ncrtcs = dev->mode_config.num_crtc;

for (i = 0; i < ncrtcs; i++) {
struct drm_crtc_state *crtc_state = state->crtc_states[i];

if (!crtc_state)
continue;

for_each_crtc_in_state(state, crtc, crtc_state, i) {
destroy_vblank_event(dev, file_priv, crtc_state->event);
crtc_state->event = NULL;
}
Expand Down
Loading

0 comments on commit 4a11248

Please sign in to comment.