diff options
author | Dave Airlie <airlied@redhat.com> | 2015-03-31 18:23:25 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2015-03-31 18:23:25 -0400 |
commit | 53d8858bb81ccf47ddca8b94d21f39972549e166 (patch) | |
tree | 9c5cd952cadb6e1b9f9e77d277a848ca7973d430 | |
parent | 9e87e48f8e5de2146842fd0ff436e0256b52c4a9 (diff) | |
parent | 066626d5d5548d7ff63772a840b8d40a0d278825 (diff) |
Merge tag 'topic/drm-misc-2015-03-31' of git://anongit.freedesktop.org/drm-intel into drm-next
Final drm-misc pull for 4.0, just various things all over, including a few
more important atomic fixes. btw I didn't pick up the vmwgfx patch from
Ville's series, but one patch has one hunk touching vmwgfx and
Thomas/Jakob didn't get around to ack it. I figured it's simple enough to
be ok though.
* tag 'topic/drm-misc-2015-03-31' of git://anongit.freedesktop.org/drm-intel:
drm: line wrap DRM_IOCTL_DEF* macros
drm/atomic: Don't try to free a NULL state
drm/atomic: Clear crtcs, connectors and planes when clearing state
drm: Rewrite drm_ioctl_flags() to resemble the new drm_ioctl() code
drm: Use max() to make the ioctl alloc size code cleaner
drm: Simplify core vs. drv ioctl handling
drm: Drop ioctl->cmd_drv
drm: Fix DRM_IOCTL_DEF_DRV()
drm/atomic-helpers: Properly avoid full modeset dance
drm: atomic: Allow setting CRTC active property
drm: atomic: Expose CRTC active property
drm: crtc_helper: Update hwmode before mode_set call
drm: mode: Allow NULL modes for equality check
drm: fb_helper: Simplify exit condition
drm: mode: Fix typo in kerneldoc
drm/dp: Print the number of bytes processed for aux nacks
-rw-r--r-- | drivers/gpu/drm/drm_atomic.c | 27 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_atomic_helper.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_crtc_helper.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_dp_helper.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_fb_helper.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_ioctl.c | 60 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_modes.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 4 | ||||
-rw-r--r-- | include/drm/drmP.h | 10 |
9 files changed, 80 insertions, 54 deletions
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index a6caaae40b9e..57efdbeff008 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c | |||
@@ -134,6 +134,7 @@ void drm_atomic_state_clear(struct drm_atomic_state *state) | |||
134 | 134 | ||
135 | connector->funcs->atomic_destroy_state(connector, | 135 | connector->funcs->atomic_destroy_state(connector, |
136 | state->connector_states[i]); | 136 | state->connector_states[i]); |
137 | state->connectors[i] = NULL; | ||
137 | state->connector_states[i] = NULL; | 138 | state->connector_states[i] = NULL; |
138 | } | 139 | } |
139 | 140 | ||
@@ -145,6 +146,7 @@ void drm_atomic_state_clear(struct drm_atomic_state *state) | |||
145 | 146 | ||
146 | crtc->funcs->atomic_destroy_state(crtc, | 147 | crtc->funcs->atomic_destroy_state(crtc, |
147 | state->crtc_states[i]); | 148 | state->crtc_states[i]); |
149 | state->crtcs[i] = NULL; | ||
148 | state->crtc_states[i] = NULL; | 150 | state->crtc_states[i] = NULL; |
149 | } | 151 | } |
150 | 152 | ||
@@ -156,6 +158,7 @@ void drm_atomic_state_clear(struct drm_atomic_state *state) | |||
156 | 158 | ||
157 | plane->funcs->atomic_destroy_state(plane, | 159 | plane->funcs->atomic_destroy_state(plane, |
158 | state->plane_states[i]); | 160 | state->plane_states[i]); |
161 | state->planes[i] = NULL; | ||
159 | state->plane_states[i] = NULL; | 162 | state->plane_states[i] = NULL; |
160 | } | 163 | } |
161 | } | 164 | } |
@@ -170,6 +173,9 @@ EXPORT_SYMBOL(drm_atomic_state_clear); | |||
170 | */ | 173 | */ |
171 | void drm_atomic_state_free(struct drm_atomic_state *state) | 174 | void drm_atomic_state_free(struct drm_atomic_state *state) |
172 | { | 175 | { |
176 | if (!state) | ||
177 | return; | ||
178 | |||
173 | drm_atomic_state_clear(state); | 179 | drm_atomic_state_clear(state); |
174 | 180 | ||
175 | DRM_DEBUG_ATOMIC("Freeing atomic state %p\n", state); | 181 | DRM_DEBUG_ATOMIC("Freeing atomic state %p\n", state); |
@@ -248,11 +254,14 @@ int drm_atomic_crtc_set_property(struct drm_crtc *crtc, | |||
248 | struct drm_mode_config *config = &dev->mode_config; | 254 | struct drm_mode_config *config = &dev->mode_config; |
249 | 255 | ||
250 | /* FIXME: Mode prop is missing, which also controls ->enable. */ | 256 | /* FIXME: Mode prop is missing, which also controls ->enable. */ |
251 | if (property == config->prop_active) { | 257 | if (property == config->prop_active) |
252 | state->active = val; | 258 | state->active = val; |
253 | } else if (crtc->funcs->atomic_set_property) | 259 | else if (crtc->funcs->atomic_set_property) |
254 | return crtc->funcs->atomic_set_property(crtc, state, property, val); | 260 | return crtc->funcs->atomic_set_property(crtc, state, property, val); |
255 | return -EINVAL; | 261 | else |
262 | return -EINVAL; | ||
263 | |||
264 | return 0; | ||
256 | } | 265 | } |
257 | EXPORT_SYMBOL(drm_atomic_crtc_set_property); | 266 | EXPORT_SYMBOL(drm_atomic_crtc_set_property); |
258 | 267 | ||
@@ -266,9 +275,17 @@ int drm_atomic_crtc_get_property(struct drm_crtc *crtc, | |||
266 | const struct drm_crtc_state *state, | 275 | const struct drm_crtc_state *state, |
267 | struct drm_property *property, uint64_t *val) | 276 | struct drm_property *property, uint64_t *val) |
268 | { | 277 | { |
269 | if (crtc->funcs->atomic_get_property) | 278 | struct drm_device *dev = crtc->dev; |
279 | struct drm_mode_config *config = &dev->mode_config; | ||
280 | |||
281 | if (property == config->prop_active) | ||
282 | *val = state->active; | ||
283 | else if (crtc->funcs->atomic_get_property) | ||
270 | return crtc->funcs->atomic_get_property(crtc, state, property, val); | 284 | return crtc->funcs->atomic_get_property(crtc, state, property, val); |
271 | return -EINVAL; | 285 | else |
286 | return -EINVAL; | ||
287 | |||
288 | return 0; | ||
272 | } | 289 | } |
273 | 290 | ||
274 | /** | 291 | /** |
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index d9ed9a54fd1e..e67d4d69faf7 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c | |||
@@ -587,7 +587,8 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state) | |||
587 | 587 | ||
588 | old_crtc_state = old_state->crtc_states[drm_crtc_index(old_conn_state->crtc)]; | 588 | old_crtc_state = old_state->crtc_states[drm_crtc_index(old_conn_state->crtc)]; |
589 | 589 | ||
590 | if (!old_crtc_state->active) | 590 | if (!old_crtc_state->active || |
591 | !needs_modeset(old_conn_state->crtc->state)) | ||
591 | continue; | 592 | continue; |
592 | 593 | ||
593 | encoder = old_conn_state->best_encoder; | 594 | encoder = old_conn_state->best_encoder; |
@@ -847,7 +848,8 @@ void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev, | |||
847 | if (!connector || !connector->state->best_encoder) | 848 | if (!connector || !connector->state->best_encoder) |
848 | continue; | 849 | continue; |
849 | 850 | ||
850 | if (!connector->state->crtc->state->active) | 851 | if (!connector->state->crtc->state->active || |
852 | !needs_modeset(connector->state->crtc->state)) | ||
851 | continue; | 853 | continue; |
852 | 854 | ||
853 | encoder = connector->state->best_encoder; | 855 | encoder = connector->state->best_encoder; |
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 3053aab968f9..dd895c409ca3 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c | |||
@@ -270,7 +270,7 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, | |||
270 | struct drm_framebuffer *old_fb) | 270 | struct drm_framebuffer *old_fb) |
271 | { | 271 | { |
272 | struct drm_device *dev = crtc->dev; | 272 | struct drm_device *dev = crtc->dev; |
273 | struct drm_display_mode *adjusted_mode, saved_mode; | 273 | struct drm_display_mode *adjusted_mode, saved_mode, saved_hwmode; |
274 | struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; | 274 | struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; |
275 | struct drm_encoder_helper_funcs *encoder_funcs; | 275 | struct drm_encoder_helper_funcs *encoder_funcs; |
276 | int saved_x, saved_y; | 276 | int saved_x, saved_y; |
@@ -292,6 +292,7 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, | |||
292 | } | 292 | } |
293 | 293 | ||
294 | saved_mode = crtc->mode; | 294 | saved_mode = crtc->mode; |
295 | saved_hwmode = crtc->hwmode; | ||
295 | saved_x = crtc->x; | 296 | saved_x = crtc->x; |
296 | saved_y = crtc->y; | 297 | saved_y = crtc->y; |
297 | 298 | ||
@@ -334,6 +335,8 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, | |||
334 | } | 335 | } |
335 | DRM_DEBUG_KMS("[CRTC:%d]\n", crtc->base.id); | 336 | DRM_DEBUG_KMS("[CRTC:%d]\n", crtc->base.id); |
336 | 337 | ||
338 | crtc->hwmode = *adjusted_mode; | ||
339 | |||
337 | /* Prepare the encoders and CRTCs before setting the mode. */ | 340 | /* Prepare the encoders and CRTCs before setting the mode. */ |
338 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { | 341 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { |
339 | 342 | ||
@@ -396,9 +399,6 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, | |||
396 | encoder->bridge->funcs->enable(encoder->bridge); | 399 | encoder->bridge->funcs->enable(encoder->bridge); |
397 | } | 400 | } |
398 | 401 | ||
399 | /* Store real post-adjustment hardware mode. */ | ||
400 | crtc->hwmode = *adjusted_mode; | ||
401 | |||
402 | /* Calculate and store various constants which | 402 | /* Calculate and store various constants which |
403 | * are later needed by vblank and swap-completion | 403 | * are later needed by vblank and swap-completion |
404 | * timestamping. They are derived from true hwmode. | 404 | * timestamping. They are derived from true hwmode. |
@@ -411,6 +411,7 @@ done: | |||
411 | if (!ret) { | 411 | if (!ret) { |
412 | crtc->enabled = saved_enabled; | 412 | crtc->enabled = saved_enabled; |
413 | crtc->mode = saved_mode; | 413 | crtc->mode = saved_mode; |
414 | crtc->hwmode = saved_hwmode; | ||
414 | crtc->x = saved_x; | 415 | crtc->x = saved_x; |
415 | crtc->y = saved_y; | 416 | crtc->y = saved_y; |
416 | } | 417 | } |
diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index d5368ea56a0f..71dcbc64ae98 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c | |||
@@ -462,7 +462,7 @@ static int drm_dp_i2c_do_msg(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg) | |||
462 | break; | 462 | break; |
463 | 463 | ||
464 | case DP_AUX_NATIVE_REPLY_NACK: | 464 | case DP_AUX_NATIVE_REPLY_NACK: |
465 | DRM_DEBUG_KMS("native nack\n"); | 465 | DRM_DEBUG_KMS("native nack (result=%d, size=%zu)\n", ret, msg->size); |
466 | return -EREMOTEIO; | 466 | return -EREMOTEIO; |
467 | 467 | ||
468 | case DP_AUX_NATIVE_REPLY_DEFER: | 468 | case DP_AUX_NATIVE_REPLY_DEFER: |
@@ -493,7 +493,7 @@ static int drm_dp_i2c_do_msg(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg) | |||
493 | return ret; | 493 | return ret; |
494 | 494 | ||
495 | case DP_AUX_I2C_REPLY_NACK: | 495 | case DP_AUX_I2C_REPLY_NACK: |
496 | DRM_DEBUG_KMS("I2C nack\n"); | 496 | DRM_DEBUG_KMS("I2C nack (result=%d, size=%zu\n", ret, msg->size); |
497 | aux->i2c_nack_count++; | 497 | aux->i2c_nack_count++; |
498 | return -EREMOTEIO; | 498 | return -EREMOTEIO; |
499 | 499 | ||
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 1a20db7c971f..309b9476fe96 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c | |||
@@ -1283,12 +1283,12 @@ struct drm_display_mode *drm_pick_cmdline_mode(struct drm_fb_helper_connector *f | |||
1283 | int width, int height) | 1283 | int width, int height) |
1284 | { | 1284 | { |
1285 | struct drm_cmdline_mode *cmdline_mode; | 1285 | struct drm_cmdline_mode *cmdline_mode; |
1286 | struct drm_display_mode *mode = NULL; | 1286 | struct drm_display_mode *mode; |
1287 | bool prefer_non_interlace; | 1287 | bool prefer_non_interlace; |
1288 | 1288 | ||
1289 | cmdline_mode = &fb_helper_conn->connector->cmdline_mode; | 1289 | cmdline_mode = &fb_helper_conn->connector->cmdline_mode; |
1290 | if (cmdline_mode->specified == false) | 1290 | if (cmdline_mode->specified == false) |
1291 | return mode; | 1291 | return NULL; |
1292 | 1292 | ||
1293 | /* attempt to find a matching mode in the list of modes | 1293 | /* attempt to find a matching mode in the list of modes |
1294 | * we have gotten so far, if not add a CVT mode that conforms | 1294 | * we have gotten so far, if not add a CVT mode that conforms |
@@ -1297,7 +1297,7 @@ struct drm_display_mode *drm_pick_cmdline_mode(struct drm_fb_helper_connector *f | |||
1297 | goto create_mode; | 1297 | goto create_mode; |
1298 | 1298 | ||
1299 | prefer_non_interlace = !cmdline_mode->interlace; | 1299 | prefer_non_interlace = !cmdline_mode->interlace; |
1300 | again: | 1300 | again: |
1301 | list_for_each_entry(mode, &fb_helper_conn->connector->modes, head) { | 1301 | list_for_each_entry(mode, &fb_helper_conn->connector->modes, head) { |
1302 | /* check width/height */ | 1302 | /* check width/height */ |
1303 | if (mode->hdisplay != cmdline_mode->xres || | 1303 | if (mode->hdisplay != cmdline_mode->xres || |
diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c index a6d773a61c2d..266dcd6cdf3b 100644 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c | |||
@@ -524,8 +524,13 @@ static int drm_ioctl_permit(u32 flags, struct drm_file *file_priv) | |||
524 | return 0; | 524 | return 0; |
525 | } | 525 | } |
526 | 526 | ||
527 | #define DRM_IOCTL_DEF(ioctl, _func, _flags) \ | 527 | #define DRM_IOCTL_DEF(ioctl, _func, _flags) \ |
528 | [DRM_IOCTL_NR(ioctl)] = {.cmd = ioctl, .func = _func, .flags = _flags, .cmd_drv = 0, .name = #ioctl} | 528 | [DRM_IOCTL_NR(ioctl)] = { \ |
529 | .cmd = ioctl, \ | ||
530 | .func = _func, \ | ||
531 | .flags = _flags, \ | ||
532 | .name = #ioctl \ | ||
533 | } | ||
529 | 534 | ||
530 | /** Ioctl table */ | 535 | /** Ioctl table */ |
531 | static const struct drm_ioctl_desc drm_ioctls[] = { | 536 | static const struct drm_ioctl_desc drm_ioctls[] = { |
@@ -663,39 +668,29 @@ long drm_ioctl(struct file *filp, | |||
663 | int retcode = -EINVAL; | 668 | int retcode = -EINVAL; |
664 | char stack_kdata[128]; | 669 | char stack_kdata[128]; |
665 | char *kdata = NULL; | 670 | char *kdata = NULL; |
666 | unsigned int usize, asize; | 671 | unsigned int usize, asize, drv_size; |
667 | 672 | ||
668 | dev = file_priv->minor->dev; | 673 | dev = file_priv->minor->dev; |
669 | 674 | ||
670 | if (drm_device_is_unplugged(dev)) | 675 | if (drm_device_is_unplugged(dev)) |
671 | return -ENODEV; | 676 | return -ENODEV; |
672 | 677 | ||
673 | if ((nr >= DRM_CORE_IOCTL_COUNT) && | 678 | if (nr >= DRM_COMMAND_BASE && nr < DRM_COMMAND_END) { |
674 | ((nr < DRM_COMMAND_BASE) || (nr >= DRM_COMMAND_END))) | 679 | /* driver ioctl */ |
675 | goto err_i1; | 680 | if (nr - DRM_COMMAND_BASE >= dev->driver->num_ioctls) |
676 | if ((nr >= DRM_COMMAND_BASE) && (nr < DRM_COMMAND_END) && | 681 | goto err_i1; |
677 | (nr < DRM_COMMAND_BASE + dev->driver->num_ioctls)) { | ||
678 | u32 drv_size; | ||
679 | ioctl = &dev->driver->ioctls[nr - DRM_COMMAND_BASE]; | 682 | ioctl = &dev->driver->ioctls[nr - DRM_COMMAND_BASE]; |
680 | drv_size = _IOC_SIZE(ioctl->cmd_drv); | 683 | } else { |
681 | usize = asize = _IOC_SIZE(cmd); | 684 | /* core ioctl */ |
682 | if (drv_size > asize) | 685 | if (nr >= DRM_CORE_IOCTL_COUNT) |
683 | asize = drv_size; | 686 | goto err_i1; |
684 | cmd = ioctl->cmd_drv; | ||
685 | } | ||
686 | else if ((nr >= DRM_COMMAND_END) || (nr < DRM_COMMAND_BASE)) { | ||
687 | u32 drv_size; | ||
688 | |||
689 | ioctl = &drm_ioctls[nr]; | 687 | ioctl = &drm_ioctls[nr]; |
688 | } | ||
690 | 689 | ||
691 | drv_size = _IOC_SIZE(ioctl->cmd); | 690 | drv_size = _IOC_SIZE(ioctl->cmd); |
692 | usize = asize = _IOC_SIZE(cmd); | 691 | usize = _IOC_SIZE(cmd); |
693 | if (drv_size > asize) | 692 | asize = max(usize, drv_size); |
694 | asize = drv_size; | 693 | cmd = ioctl->cmd; |
695 | |||
696 | cmd = ioctl->cmd; | ||
697 | } else | ||
698 | goto err_i1; | ||
699 | 694 | ||
700 | DRM_DEBUG("pid=%d, dev=0x%lx, auth=%d, %s\n", | 695 | DRM_DEBUG("pid=%d, dev=0x%lx, auth=%d, %s\n", |
701 | task_pid_nr(current), | 696 | task_pid_nr(current), |
@@ -776,12 +771,13 @@ EXPORT_SYMBOL(drm_ioctl); | |||
776 | */ | 771 | */ |
777 | bool drm_ioctl_flags(unsigned int nr, unsigned int *flags) | 772 | bool drm_ioctl_flags(unsigned int nr, unsigned int *flags) |
778 | { | 773 | { |
779 | if ((nr >= DRM_COMMAND_END && nr < DRM_CORE_IOCTL_COUNT) || | 774 | if (nr >= DRM_COMMAND_BASE && nr < DRM_COMMAND_END) |
780 | (nr < DRM_COMMAND_BASE)) { | 775 | return false; |
781 | *flags = drm_ioctls[nr].flags; | 776 | |
782 | return true; | 777 | if (nr >= DRM_CORE_IOCTL_COUNT) |
783 | } | 778 | return false; |
784 | 779 | ||
785 | return false; | 780 | *flags = drm_ioctls[nr].flags; |
781 | return true; | ||
786 | } | 782 | } |
787 | EXPORT_SYMBOL(drm_ioctl_flags); | 783 | EXPORT_SYMBOL(drm_ioctl_flags); |
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index 2cca85f23138..213b11ea69b5 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c | |||
@@ -903,6 +903,12 @@ EXPORT_SYMBOL(drm_mode_duplicate); | |||
903 | */ | 903 | */ |
904 | bool drm_mode_equal(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2) | 904 | bool drm_mode_equal(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2) |
905 | { | 905 | { |
906 | if (!mode1 && !mode2) | ||
907 | return true; | ||
908 | |||
909 | if (!mode1 || !mode2) | ||
910 | return false; | ||
911 | |||
906 | /* do clock check convert to PICOS so fb modes get matched | 912 | /* do clock check convert to PICOS so fb modes get matched |
907 | * the same */ | 913 | * the same */ |
908 | if (mode1->clock && mode2->clock) { | 914 | if (mode1->clock && mode2->clock) { |
@@ -1148,7 +1154,7 @@ EXPORT_SYMBOL(drm_mode_sort); | |||
1148 | /** | 1154 | /** |
1149 | * drm_mode_connector_list_update - update the mode list for the connector | 1155 | * drm_mode_connector_list_update - update the mode list for the connector |
1150 | * @connector: the connector to update | 1156 | * @connector: the connector to update |
1151 | * @merge_type_bits: whether to merge or overright type bits. | 1157 | * @merge_type_bits: whether to merge or overwrite type bits |
1152 | * | 1158 | * |
1153 | * This moves the modes from the @connector probed_modes list | 1159 | * This moves the modes from the @connector probed_modes list |
1154 | * to the actual mode list. It compares the probed mode against the current | 1160 | * to the actual mode list. It compares the probed mode against the current |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index e13b9cbc304e..620bb5cf617c 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | |||
@@ -134,7 +134,7 @@ | |||
134 | */ | 134 | */ |
135 | 135 | ||
136 | #define VMW_IOCTL_DEF(ioctl, func, flags) \ | 136 | #define VMW_IOCTL_DEF(ioctl, func, flags) \ |
137 | [DRM_IOCTL_NR(DRM_IOCTL_##ioctl) - DRM_COMMAND_BASE] = {DRM_##ioctl, flags, func, DRM_IOCTL_##ioctl} | 137 | [DRM_IOCTL_NR(DRM_IOCTL_##ioctl) - DRM_COMMAND_BASE] = {DRM_IOCTL_##ioctl, flags, func} |
138 | 138 | ||
139 | /** | 139 | /** |
140 | * Ioctl definitions. | 140 | * Ioctl definitions. |
@@ -1044,7 +1044,7 @@ static long vmw_generic_ioctl(struct file *filp, unsigned int cmd, | |||
1044 | const struct drm_ioctl_desc *ioctl = | 1044 | const struct drm_ioctl_desc *ioctl = |
1045 | &vmw_ioctls[nr - DRM_COMMAND_BASE]; | 1045 | &vmw_ioctls[nr - DRM_COMMAND_BASE]; |
1046 | 1046 | ||
1047 | if (unlikely(ioctl->cmd_drv != cmd)) { | 1047 | if (unlikely(ioctl->cmd != cmd)) { |
1048 | DRM_ERROR("Invalid command format, ioctl %d\n", | 1048 | DRM_ERROR("Invalid command format, ioctl %d\n", |
1049 | nr - DRM_COMMAND_BASE); | 1049 | nr - DRM_COMMAND_BASE); |
1050 | return -EINVAL; | 1050 | return -EINVAL; |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 63c0b0131f61..62c40777c009 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -253,7 +253,6 @@ struct drm_ioctl_desc { | |||
253 | unsigned int cmd; | 253 | unsigned int cmd; |
254 | int flags; | 254 | int flags; |
255 | drm_ioctl_t *func; | 255 | drm_ioctl_t *func; |
256 | unsigned int cmd_drv; | ||
257 | const char *name; | 256 | const char *name; |
258 | }; | 257 | }; |
259 | 258 | ||
@@ -262,8 +261,13 @@ struct drm_ioctl_desc { | |||
262 | * ioctl, for use by drm_ioctl(). | 261 | * ioctl, for use by drm_ioctl(). |
263 | */ | 262 | */ |
264 | 263 | ||
265 | #define DRM_IOCTL_DEF_DRV(ioctl, _func, _flags) \ | 264 | #define DRM_IOCTL_DEF_DRV(ioctl, _func, _flags) \ |
266 | [DRM_IOCTL_NR(DRM_##ioctl)] = {.cmd = DRM_##ioctl, .func = _func, .flags = _flags, .cmd_drv = DRM_IOCTL_##ioctl, .name = #ioctl} | 265 | [DRM_IOCTL_NR(DRM_IOCTL_##ioctl) - DRM_COMMAND_BASE] = { \ |
266 | .cmd = DRM_IOCTL_##ioctl, \ | ||
267 | .func = _func, \ | ||
268 | .flags = _flags, \ | ||
269 | .name = #ioctl \ | ||
270 | } | ||
267 | 271 | ||
268 | /* Event queued up for userspace to read */ | 272 | /* Event queued up for userspace to read */ |
269 | struct drm_pending_event { | 273 | struct drm_pending_event { |