Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'topic/drm-misc-2015-06-22' of git://anongit.freedesktop.org/drm-intel into drm-next

One more drm-misc pull for 4.2. The important one is the fix from Laurent
for Daniel Stone's mode_blob work.

* tag 'topic/drm-misc-2015-06-22' of git://anongit.freedesktop.org/drm-intel:
drm/atomic: Don't set crtc_state->enable manually
drm: prime: Document gem_prime_mmap
drm: Avoid the double clflush on the last cache line in drm_clflush_virt_range()
drm/atomic: Extract needs_modeset function
drm/cma: Fix 64-bit size_t build warnings
Documentation/drm: Update rotation property

+45 -44
+18 -23
Documentation/DocBook/drm.tmpl
··· 2585 2585 <td valign="top" >Description/Restrictions</td> 2586 2586 </tr> 2587 2587 <tr> 2588 - <td rowspan="36" valign="top" >DRM</td> 2588 + <td rowspan="37" valign="top" >DRM</td> 2589 + <td valign="top" >Generic</td> 2590 + <td valign="top" >“rotation”</td> 2591 + <td valign="top" >BITMASK</td> 2592 + <td valign="top" >{ 0, "rotate-0" }, 2593 + { 1, "rotate-90" }, 2594 + { 2, "rotate-180" }, 2595 + { 3, "rotate-270" }, 2596 + { 4, "reflect-x" }, 2597 + { 5, "reflect-y" }</td> 2598 + <td valign="top" >CRTC, Plane</td> 2599 + <td valign="top" >rotate-(degrees) rotates the image by the specified amount in degrees 2600 + in counter clockwise direction. reflect-x and reflect-y reflects the 2601 + image along the specified axis prior to rotation</td> 2602 + </tr> 2603 + <tr> 2589 2604 <td rowspan="5" valign="top" >Connector</td> 2590 2605 <td valign="top" >“EDID”</td> 2591 2606 <td valign="top" >BLOB | IMMUTABLE</td> ··· 2861 2846 <td valign="top" >TBD</td> 2862 2847 </tr> 2863 2848 <tr> 2864 - <td rowspan="21" valign="top" >i915</td> 2849 + <td rowspan="20" valign="top" >i915</td> 2865 2850 <td rowspan="2" valign="top" >Generic</td> 2866 2851 <td valign="top" >"Broadcast RGB"</td> 2867 2852 <td valign="top" >ENUM</td> ··· 2874 2859 <td valign="top" >ENUM</td> 2875 2860 <td valign="top" >{ "force-dvi", "off", "auto", "on" }</td> 2876 2861 <td valign="top" >Connector</td> 2877 - <td valign="top" >TBD</td> 2878 - </tr> 2879 - <tr> 2880 - <td rowspan="1" valign="top" >Plane</td> 2881 - <td valign="top" >“rotation”</td> 2882 - <td valign="top" >BITMASK</td> 2883 - <td valign="top" >{ 0, "rotate-0" }, { 2, "rotate-180" }</td> 2884 - <td valign="top" >Plane</td> 2885 2862 <td valign="top" >TBD</td> 2886 2863 </tr> 2887 2864 <tr> ··· 3384 3377 </tr> 3385 3378 <tr> 3386 3379 <td rowspan="2" valign="top" >omap</td> 3387 - <td rowspan="2" valign="top" >Generic</td> 3388 - <td valign="top" >“rotation”</td> 3389 - <td valign="top" >BITMASK</td> 3390 - <td valign="top" >{ 0, "rotate-0" }, 3391 - { 1, "rotate-90" }, 3392 - { 2, "rotate-180" }, 3393 - { 3, "rotate-270" }, 3394 - { 4, "reflect-x" }, 3395 - { 5, "reflect-y" }</td> 3396 - <td valign="top" >CRTC, Plane</td> 3397 - <td valign="top" >TBD</td> 3398 - </tr> 3399 - <tr> 3380 + <td valign="top" >Generic</td> 3400 3381 <td valign="top" >“zorder”</td> 3401 3382 <td valign="top" >RANGE</td> 3402 3383 <td valign="top" >Min=0, Max=3</td>
+1 -2
drivers/gpu/drm/drm_atomic.c
··· 1216 1216 1217 1217 if (!state->allow_modeset) { 1218 1218 for_each_crtc_in_state(state, crtc, crtc_state, i) { 1219 - if (crtc_state->mode_changed || 1220 - crtc_state->active_changed) { 1219 + if (drm_atomic_crtc_needs_modeset(crtc_state)) { 1221 1220 DRM_DEBUG_ATOMIC("[CRTC:%d] requires full modeset\n", 1222 1221 crtc->base.id); 1223 1222 return -EINVAL;
+12 -14
drivers/gpu/drm/drm_atomic_helper.c
··· 331 331 return 0; 332 332 } 333 333 334 - static bool 335 - needs_modeset(struct drm_crtc_state *state) 336 - { 337 - return state->mode_changed || state->active_changed; 338 - } 339 - 340 334 /** 341 335 * drm_atomic_helper_check_modeset - validate state object for modeset changes 342 336 * @dev: DRM device ··· 408 414 crtc_state->active_changed = true; 409 415 } 410 416 411 - if (!needs_modeset(crtc_state)) 417 + if (!drm_atomic_crtc_needs_modeset(crtc_state)) 412 418 continue; 413 419 414 420 DRM_DEBUG_ATOMIC("[CRTC:%d] needs all connectors, enable: %c, active: %c\n", ··· 558 564 old_crtc_state = old_state->crtc_states[drm_crtc_index(old_conn_state->crtc)]; 559 565 560 566 if (!old_crtc_state->active || 561 - !needs_modeset(old_conn_state->crtc->state)) 567 + !drm_atomic_crtc_needs_modeset(old_conn_state->crtc->state)) 562 568 continue; 563 569 564 570 encoder = old_conn_state->best_encoder; ··· 595 601 const struct drm_crtc_helper_funcs *funcs; 596 602 597 603 /* Shut down everything that needs a full modeset. */ 598 - if (!needs_modeset(crtc->state)) 604 + if (!drm_atomic_crtc_needs_modeset(crtc->state)) 599 605 continue; 600 606 601 607 if (!old_crtc_state->active) ··· 786 792 const struct drm_crtc_helper_funcs *funcs; 787 793 788 794 /* Need to filter out CRTCs where only planes change. */ 789 - if (!needs_modeset(crtc->state)) 795 + if (!drm_atomic_crtc_needs_modeset(crtc->state)) 790 796 continue; 791 797 792 798 if (!crtc->state->active) ··· 813 819 continue; 814 820 815 821 if (!connector->state->crtc->state->active || 816 - !needs_modeset(connector->state->crtc->state)) 822 + !drm_atomic_crtc_needs_modeset(connector->state->crtc->state)) 817 823 continue; 818 824 819 825 encoder = connector->state->best_encoder; ··· 1555 1561 if (crtc == set->crtc) 1556 1562 continue; 1557 1563 1558 - crtc_state->enable = 1559 - drm_atomic_connectors_for_crtc(state, crtc); 1560 - if (!crtc_state->enable) 1564 + if (!drm_atomic_connectors_for_crtc(state, crtc)) { 1565 + ret = drm_atomic_set_mode_prop_for_crtc(crtc_state, 1566 + NULL); 1567 + if (ret < 0) 1568 + return ret; 1569 + 1561 1570 crtc_state->active = false; 1571 + } 1562 1572 } 1563 1573 1564 1574 return 0;
+3 -2
drivers/gpu/drm/drm_cache.c
··· 130 130 { 131 131 #if defined(CONFIG_X86) 132 132 if (cpu_has_clflush) { 133 + const int size = boot_cpu_data.x86_clflush_size; 133 134 void *end = addr + length; 135 + addr = (void *)(((unsigned long)addr) & -size); 134 136 mb(); 135 - for (; addr < end; addr += boot_cpu_data.x86_clflush_size) 137 + for (; addr < end; addr += size) 136 138 clflushopt(addr); 137 - clflushopt(end - 1); 138 139 mb(); 139 140 return; 140 141 }
+2 -2
drivers/gpu/drm/drm_gem_cma_helper.c
··· 110 110 cma_obj->vaddr = dma_alloc_writecombine(drm->dev, size, 111 111 &cma_obj->paddr, GFP_KERNEL | __GFP_NOWARN); 112 112 if (!cma_obj->vaddr) { 113 - dev_err(drm->dev, "failed to allocate buffer with size %d\n", 113 + dev_err(drm->dev, "failed to allocate buffer with size %zu\n", 114 114 size); 115 115 ret = -ENOMEM; 116 116 goto error; ··· 388 388 389 389 off = drm_vma_node_start(&obj->vma_node); 390 390 391 - seq_printf(m, "%2d (%2d) %08llx %pad %p %d", 391 + seq_printf(m, "%2d (%2d) %08llx %pad %p %zu", 392 392 obj->name, obj->refcount.refcount.counter, 393 393 off, &cma_obj->paddr, cma_obj->vaddr, obj->size); 394 394
+3 -1
drivers/gpu/drm/drm_prime.c
··· 309 309 * Drivers can implement @gem_prime_export and @gem_prime_import in terms of 310 310 * simpler APIs by using the helper functions @drm_gem_prime_export and 311 311 * @drm_gem_prime_import. These functions implement dma-buf support in terms of 312 - * five lower-level driver callbacks: 312 + * six lower-level driver callbacks: 313 313 * 314 314 * Export callbacks: 315 315 * ··· 320 320 * - @gem_prime_vmap: vmap a buffer exported by your driver 321 321 * 322 322 * - @gem_prime_vunmap: vunmap a buffer exported by your driver 323 + * 324 + * - @gem_prime_mmap (optional): mmap a buffer exported by your driver 323 325 * 324 326 * Import callback: 325 327 *
+6
include/drm/drm_atomic.h
··· 163 163 (plane_state) = (state)->plane_states[__i], 1); \ 164 164 (__i)++) \ 165 165 if (plane_state) 166 + static inline bool 167 + drm_atomic_crtc_needs_modeset(struct drm_crtc_state *state) 168 + { 169 + return state->mode_changed || state->active_changed; 170 + } 171 + 166 172 167 173 #endif /* DRM_ATOMIC_H_ */