vmwgfx_ldu.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. /**************************************************************************
  2. *
  3. * Copyright © 2009-2015 VMware, Inc., Palo Alto, CA., USA
  4. * All Rights Reserved.
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a
  7. * copy of this software and associated documentation files (the
  8. * "Software"), to deal in the Software without restriction, including
  9. * without limitation the rights to use, copy, modify, merge, publish,
  10. * distribute, sub license, and/or sell copies of the Software, and to
  11. * permit persons to whom the Software is furnished to do so, subject to
  12. * the following conditions:
  13. *
  14. * The above copyright notice and this permission notice (including the
  15. * next paragraph) shall be included in all copies or substantial portions
  16. * of the Software.
  17. *
  18. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20. * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
  21. * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
  22. * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  23. * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  24. * USE OR OTHER DEALINGS IN THE SOFTWARE.
  25. *
  26. **************************************************************************/
  27. #include "vmwgfx_kms.h"
  28. #include <drm/drm_plane_helper.h>
  29. #include <drm/drm_atomic.h>
  30. #include <drm/drm_atomic_helper.h>
  31. #define vmw_crtc_to_ldu(x) \
  32. container_of(x, struct vmw_legacy_display_unit, base.crtc)
  33. #define vmw_encoder_to_ldu(x) \
  34. container_of(x, struct vmw_legacy_display_unit, base.encoder)
  35. #define vmw_connector_to_ldu(x) \
  36. container_of(x, struct vmw_legacy_display_unit, base.connector)
  37. struct vmw_legacy_display {
  38. struct list_head active;
  39. unsigned num_active;
  40. unsigned last_num_active;
  41. struct vmw_framebuffer *fb;
  42. };
  43. /**
  44. * Display unit using the legacy register interface.
  45. */
  46. struct vmw_legacy_display_unit {
  47. struct vmw_display_unit base;
  48. struct list_head active;
  49. };
  50. static void vmw_ldu_destroy(struct vmw_legacy_display_unit *ldu)
  51. {
  52. list_del_init(&ldu->active);
  53. vmw_du_cleanup(&ldu->base);
  54. kfree(ldu);
  55. }
  56. /*
  57. * Legacy Display Unit CRTC functions
  58. */
  59. static void vmw_ldu_crtc_destroy(struct drm_crtc *crtc)
  60. {
  61. vmw_ldu_destroy(vmw_crtc_to_ldu(crtc));
  62. }
  63. static int vmw_ldu_commit_list(struct vmw_private *dev_priv)
  64. {
  65. struct vmw_legacy_display *lds = dev_priv->ldu_priv;
  66. struct vmw_legacy_display_unit *entry;
  67. struct drm_framebuffer *fb = NULL;
  68. struct drm_crtc *crtc = NULL;
  69. int i;
  70. /* If there is no display topology the host just assumes
  71. * that the guest will set the same layout as the host.
  72. */
  73. if (!(dev_priv->capabilities & SVGA_CAP_DISPLAY_TOPOLOGY)) {
  74. int w = 0, h = 0;
  75. list_for_each_entry(entry, &lds->active, active) {
  76. crtc = &entry->base.crtc;
  77. w = max(w, crtc->x + crtc->mode.hdisplay);
  78. h = max(h, crtc->y + crtc->mode.vdisplay);
  79. }
  80. if (crtc == NULL)
  81. return 0;
  82. fb = crtc->primary->state->fb;
  83. return vmw_kms_write_svga(dev_priv, w, h, fb->pitches[0],
  84. fb->format->cpp[0] * 8,
  85. fb->format->depth);
  86. }
  87. if (!list_empty(&lds->active)) {
  88. entry = list_entry(lds->active.next, typeof(*entry), active);
  89. fb = entry->base.crtc.primary->state->fb;
  90. vmw_kms_write_svga(dev_priv, fb->width, fb->height, fb->pitches[0],
  91. fb->format->cpp[0] * 8, fb->format->depth);
  92. }
  93. /* Make sure we always show something. */
  94. vmw_write(dev_priv, SVGA_REG_NUM_GUEST_DISPLAYS,
  95. lds->num_active ? lds->num_active : 1);
  96. i = 0;
  97. list_for_each_entry(entry, &lds->active, active) {
  98. crtc = &entry->base.crtc;
  99. vmw_write(dev_priv, SVGA_REG_DISPLAY_ID, i);
  100. vmw_write(dev_priv, SVGA_REG_DISPLAY_IS_PRIMARY, !i);
  101. vmw_write(dev_priv, SVGA_REG_DISPLAY_POSITION_X, crtc->x);
  102. vmw_write(dev_priv, SVGA_REG_DISPLAY_POSITION_Y, crtc->y);
  103. vmw_write(dev_priv, SVGA_REG_DISPLAY_WIDTH, crtc->mode.hdisplay);
  104. vmw_write(dev_priv, SVGA_REG_DISPLAY_HEIGHT, crtc->mode.vdisplay);
  105. vmw_write(dev_priv, SVGA_REG_DISPLAY_ID, SVGA_ID_INVALID);
  106. i++;
  107. }
  108. BUG_ON(i != lds->num_active);
  109. lds->last_num_active = lds->num_active;
  110. return 0;
  111. }
  112. static int vmw_ldu_del_active(struct vmw_private *vmw_priv,
  113. struct vmw_legacy_display_unit *ldu)
  114. {
  115. struct vmw_legacy_display *ld = vmw_priv->ldu_priv;
  116. if (list_empty(&ldu->active))
  117. return 0;
  118. /* Must init otherwise list_empty(&ldu->active) will not work. */
  119. list_del_init(&ldu->active);
  120. if (--(ld->num_active) == 0) {
  121. BUG_ON(!ld->fb);
  122. if (ld->fb->unpin)
  123. ld->fb->unpin(ld->fb);
  124. ld->fb = NULL;
  125. }
  126. return 0;
  127. }
  128. static int vmw_ldu_add_active(struct vmw_private *vmw_priv,
  129. struct vmw_legacy_display_unit *ldu,
  130. struct vmw_framebuffer *vfb)
  131. {
  132. struct vmw_legacy_display *ld = vmw_priv->ldu_priv;
  133. struct vmw_legacy_display_unit *entry;
  134. struct list_head *at;
  135. BUG_ON(!ld->num_active && ld->fb);
  136. if (vfb != ld->fb) {
  137. if (ld->fb && ld->fb->unpin)
  138. ld->fb->unpin(ld->fb);
  139. vmw_svga_enable(vmw_priv);
  140. if (vfb->pin)
  141. vfb->pin(vfb);
  142. ld->fb = vfb;
  143. }
  144. if (!list_empty(&ldu->active))
  145. return 0;
  146. at = &ld->active;
  147. list_for_each_entry(entry, &ld->active, active) {
  148. if (entry->base.unit > ldu->base.unit)
  149. break;
  150. at = &entry->active;
  151. }
  152. list_add(&ldu->active, at);
  153. ld->num_active++;
  154. return 0;
  155. }
  156. /**
  157. * vmw_ldu_crtc_mode_set_nofb - Enable svga
  158. *
  159. * @crtc: CRTC associated with the new screen
  160. *
  161. * For LDU, just enable the svga
  162. */
  163. static void vmw_ldu_crtc_mode_set_nofb(struct drm_crtc *crtc)
  164. {
  165. }
  166. /**
  167. * vmw_ldu_crtc_atomic_enable - Noop
  168. *
  169. * @crtc: CRTC associated with the new screen
  170. *
  171. * This is called after a mode set has been completed. Here's
  172. * usually a good place to call vmw_ldu_add_active/vmw_ldu_del_active
  173. * but since for LDU the display plane is closely tied to the
  174. * CRTC, it makes more sense to do those at plane update time.
  175. */
  176. static void vmw_ldu_crtc_atomic_enable(struct drm_crtc *crtc,
  177. struct drm_crtc_state *old_state)
  178. {
  179. }
  180. /**
  181. * vmw_ldu_crtc_atomic_disable - Turns off CRTC
  182. *
  183. * @crtc: CRTC to be turned off
  184. */
  185. static void vmw_ldu_crtc_atomic_disable(struct drm_crtc *crtc,
  186. struct drm_crtc_state *old_state)
  187. {
  188. }
  189. static const struct drm_crtc_funcs vmw_legacy_crtc_funcs = {
  190. .gamma_set = vmw_du_crtc_gamma_set,
  191. .destroy = vmw_ldu_crtc_destroy,
  192. .reset = vmw_du_crtc_reset,
  193. .atomic_duplicate_state = vmw_du_crtc_duplicate_state,
  194. .atomic_destroy_state = vmw_du_crtc_destroy_state,
  195. .set_config = vmw_kms_set_config,
  196. };
  197. /*
  198. * Legacy Display Unit encoder functions
  199. */
  200. static void vmw_ldu_encoder_destroy(struct drm_encoder *encoder)
  201. {
  202. vmw_ldu_destroy(vmw_encoder_to_ldu(encoder));
  203. }
  204. static const struct drm_encoder_funcs vmw_legacy_encoder_funcs = {
  205. .destroy = vmw_ldu_encoder_destroy,
  206. };
  207. /*
  208. * Legacy Display Unit connector functions
  209. */
  210. static void vmw_ldu_connector_destroy(struct drm_connector *connector)
  211. {
  212. vmw_ldu_destroy(vmw_connector_to_ldu(connector));
  213. }
  214. static const struct drm_connector_funcs vmw_legacy_connector_funcs = {
  215. .dpms = vmw_du_connector_dpms,
  216. .detect = vmw_du_connector_detect,
  217. .fill_modes = vmw_du_connector_fill_modes,
  218. .set_property = vmw_du_connector_set_property,
  219. .destroy = vmw_ldu_connector_destroy,
  220. .reset = vmw_du_connector_reset,
  221. .atomic_duplicate_state = vmw_du_connector_duplicate_state,
  222. .atomic_destroy_state = vmw_du_connector_destroy_state,
  223. .atomic_set_property = vmw_du_connector_atomic_set_property,
  224. .atomic_get_property = vmw_du_connector_atomic_get_property,
  225. };
  226. static const struct
  227. drm_connector_helper_funcs vmw_ldu_connector_helper_funcs = {
  228. .best_encoder = drm_atomic_helper_best_encoder,
  229. };
  230. /*
  231. * Legacy Display Plane Functions
  232. */
  233. /**
  234. * vmw_ldu_primary_plane_cleanup_fb - Noop
  235. *
  236. * @plane: display plane
  237. * @old_state: Contains the FB to clean up
  238. *
  239. * Unpins the display surface
  240. *
  241. * Returns 0 on success
  242. */
  243. static void
  244. vmw_ldu_primary_plane_cleanup_fb(struct drm_plane *plane,
  245. struct drm_plane_state *old_state)
  246. {
  247. }
  248. /**
  249. * vmw_ldu_primary_plane_prepare_fb - Noop
  250. *
  251. * @plane: display plane
  252. * @new_state: info on the new plane state, including the FB
  253. *
  254. * Returns 0 on success
  255. */
  256. static int
  257. vmw_ldu_primary_plane_prepare_fb(struct drm_plane *plane,
  258. struct drm_plane_state *new_state)
  259. {
  260. return 0;
  261. }
  262. static void
  263. vmw_ldu_primary_plane_atomic_update(struct drm_plane *plane,
  264. struct drm_plane_state *old_state)
  265. {
  266. struct vmw_private *dev_priv;
  267. struct vmw_legacy_display_unit *ldu;
  268. struct vmw_framebuffer *vfb;
  269. struct drm_framebuffer *fb;
  270. struct drm_crtc *crtc = plane->state->crtc ?: old_state->crtc;
  271. ldu = vmw_crtc_to_ldu(crtc);
  272. dev_priv = vmw_priv(plane->dev);
  273. fb = plane->state->fb;
  274. vfb = (fb) ? vmw_framebuffer_to_vfb(fb) : NULL;
  275. if (vfb)
  276. vmw_ldu_add_active(dev_priv, ldu, vfb);
  277. else
  278. vmw_ldu_del_active(dev_priv, ldu);
  279. vmw_ldu_commit_list(dev_priv);
  280. }
  281. static const struct drm_plane_funcs vmw_ldu_plane_funcs = {
  282. .update_plane = drm_atomic_helper_update_plane,
  283. .disable_plane = drm_atomic_helper_disable_plane,
  284. .destroy = vmw_du_primary_plane_destroy,
  285. .reset = vmw_du_plane_reset,
  286. .atomic_duplicate_state = vmw_du_plane_duplicate_state,
  287. .atomic_destroy_state = vmw_du_plane_destroy_state,
  288. };
  289. static const struct drm_plane_funcs vmw_ldu_cursor_funcs = {
  290. .update_plane = drm_atomic_helper_update_plane,
  291. .disable_plane = drm_atomic_helper_disable_plane,
  292. .destroy = vmw_du_cursor_plane_destroy,
  293. .reset = vmw_du_plane_reset,
  294. .atomic_duplicate_state = vmw_du_plane_duplicate_state,
  295. .atomic_destroy_state = vmw_du_plane_destroy_state,
  296. };
  297. /*
  298. * Atomic Helpers
  299. */
  300. static const struct
  301. drm_plane_helper_funcs vmw_ldu_cursor_plane_helper_funcs = {
  302. .atomic_check = vmw_du_cursor_plane_atomic_check,
  303. .atomic_update = vmw_du_cursor_plane_atomic_update,
  304. .prepare_fb = vmw_du_cursor_plane_prepare_fb,
  305. .cleanup_fb = vmw_du_plane_cleanup_fb,
  306. };
  307. static const struct
  308. drm_plane_helper_funcs vmw_ldu_primary_plane_helper_funcs = {
  309. .atomic_check = vmw_du_primary_plane_atomic_check,
  310. .atomic_update = vmw_ldu_primary_plane_atomic_update,
  311. .prepare_fb = vmw_ldu_primary_plane_prepare_fb,
  312. .cleanup_fb = vmw_ldu_primary_plane_cleanup_fb,
  313. };
  314. static const struct drm_crtc_helper_funcs vmw_ldu_crtc_helper_funcs = {
  315. .mode_set_nofb = vmw_ldu_crtc_mode_set_nofb,
  316. .atomic_check = vmw_du_crtc_atomic_check,
  317. .atomic_begin = vmw_du_crtc_atomic_begin,
  318. .atomic_flush = vmw_du_crtc_atomic_flush,
  319. .atomic_enable = vmw_ldu_crtc_atomic_enable,
  320. .atomic_disable = vmw_ldu_crtc_atomic_disable,
  321. };
  322. static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit)
  323. {
  324. struct vmw_legacy_display_unit *ldu;
  325. struct drm_device *dev = dev_priv->dev;
  326. struct drm_connector *connector;
  327. struct drm_encoder *encoder;
  328. struct drm_plane *primary, *cursor;
  329. struct drm_crtc *crtc;
  330. int ret;
  331. ldu = kzalloc(sizeof(*ldu), GFP_KERNEL);
  332. if (!ldu)
  333. return -ENOMEM;
  334. ldu->base.unit = unit;
  335. crtc = &ldu->base.crtc;
  336. encoder = &ldu->base.encoder;
  337. connector = &ldu->base.connector;
  338. primary = &ldu->base.primary;
  339. cursor = &ldu->base.cursor;
  340. INIT_LIST_HEAD(&ldu->active);
  341. ldu->base.pref_active = (unit == 0);
  342. ldu->base.pref_width = dev_priv->initial_width;
  343. ldu->base.pref_height = dev_priv->initial_height;
  344. ldu->base.pref_mode = NULL;
  345. /*
  346. * Remove this after enabling atomic because property values can
  347. * only exist in a state object
  348. */
  349. ldu->base.is_implicit = true;
  350. /* Initialize primary plane */
  351. vmw_du_plane_reset(primary);
  352. ret = drm_universal_plane_init(dev, &ldu->base.primary,
  353. 0, &vmw_ldu_plane_funcs,
  354. vmw_primary_plane_formats,
  355. ARRAY_SIZE(vmw_primary_plane_formats),
  356. NULL, DRM_PLANE_TYPE_PRIMARY, NULL);
  357. if (ret) {
  358. DRM_ERROR("Failed to initialize primary plane");
  359. goto err_free;
  360. }
  361. drm_plane_helper_add(primary, &vmw_ldu_primary_plane_helper_funcs);
  362. /* Initialize cursor plane */
  363. vmw_du_plane_reset(cursor);
  364. ret = drm_universal_plane_init(dev, &ldu->base.cursor,
  365. 0, &vmw_ldu_cursor_funcs,
  366. vmw_cursor_plane_formats,
  367. ARRAY_SIZE(vmw_cursor_plane_formats),
  368. NULL, DRM_PLANE_TYPE_CURSOR, NULL);
  369. if (ret) {
  370. DRM_ERROR("Failed to initialize cursor plane");
  371. drm_plane_cleanup(&ldu->base.primary);
  372. goto err_free;
  373. }
  374. drm_plane_helper_add(cursor, &vmw_ldu_cursor_plane_helper_funcs);
  375. vmw_du_connector_reset(connector);
  376. ret = drm_connector_init(dev, connector, &vmw_legacy_connector_funcs,
  377. DRM_MODE_CONNECTOR_VIRTUAL);
  378. if (ret) {
  379. DRM_ERROR("Failed to initialize connector\n");
  380. goto err_free;
  381. }
  382. drm_connector_helper_add(connector, &vmw_ldu_connector_helper_funcs);
  383. connector->status = vmw_du_connector_detect(connector, true);
  384. vmw_connector_state_to_vcs(connector->state)->is_implicit = true;
  385. ret = drm_encoder_init(dev, encoder, &vmw_legacy_encoder_funcs,
  386. DRM_MODE_ENCODER_VIRTUAL, NULL);
  387. if (ret) {
  388. DRM_ERROR("Failed to initialize encoder\n");
  389. goto err_free_connector;
  390. }
  391. (void) drm_mode_connector_attach_encoder(connector, encoder);
  392. encoder->possible_crtcs = (1 << unit);
  393. encoder->possible_clones = 0;
  394. ret = drm_connector_register(connector);
  395. if (ret) {
  396. DRM_ERROR("Failed to register connector\n");
  397. goto err_free_encoder;
  398. }
  399. vmw_du_crtc_reset(crtc);
  400. ret = drm_crtc_init_with_planes(dev, crtc, &ldu->base.primary,
  401. &ldu->base.cursor,
  402. &vmw_legacy_crtc_funcs, NULL);
  403. if (ret) {
  404. DRM_ERROR("Failed to initialize CRTC\n");
  405. goto err_free_unregister;
  406. }
  407. drm_crtc_helper_add(crtc, &vmw_ldu_crtc_helper_funcs);
  408. drm_mode_crtc_set_gamma_size(crtc, 256);
  409. drm_object_attach_property(&connector->base,
  410. dev_priv->hotplug_mode_update_property, 1);
  411. drm_object_attach_property(&connector->base,
  412. dev->mode_config.suggested_x_property, 0);
  413. drm_object_attach_property(&connector->base,
  414. dev->mode_config.suggested_y_property, 0);
  415. if (dev_priv->implicit_placement_property)
  416. drm_object_attach_property
  417. (&connector->base,
  418. dev_priv->implicit_placement_property,
  419. 1);
  420. return 0;
  421. err_free_unregister:
  422. drm_connector_unregister(connector);
  423. err_free_encoder:
  424. drm_encoder_cleanup(encoder);
  425. err_free_connector:
  426. drm_connector_cleanup(connector);
  427. err_free:
  428. kfree(ldu);
  429. return ret;
  430. }
  431. int vmw_kms_ldu_init_display(struct vmw_private *dev_priv)
  432. {
  433. struct drm_device *dev = dev_priv->dev;
  434. int i, ret;
  435. if (dev_priv->ldu_priv) {
  436. DRM_INFO("ldu system already on\n");
  437. return -EINVAL;
  438. }
  439. dev_priv->ldu_priv = kmalloc(sizeof(*dev_priv->ldu_priv), GFP_KERNEL);
  440. if (!dev_priv->ldu_priv)
  441. return -ENOMEM;
  442. INIT_LIST_HEAD(&dev_priv->ldu_priv->active);
  443. dev_priv->ldu_priv->num_active = 0;
  444. dev_priv->ldu_priv->last_num_active = 0;
  445. dev_priv->ldu_priv->fb = NULL;
  446. /* for old hardware without multimon only enable one display */
  447. if (dev_priv->capabilities & SVGA_CAP_MULTIMON)
  448. ret = drm_vblank_init(dev, VMWGFX_NUM_DISPLAY_UNITS);
  449. else
  450. ret = drm_vblank_init(dev, 1);
  451. if (ret != 0)
  452. goto err_free;
  453. vmw_kms_create_implicit_placement_property(dev_priv, true);
  454. if (dev_priv->capabilities & SVGA_CAP_MULTIMON)
  455. for (i = 0; i < VMWGFX_NUM_DISPLAY_UNITS; ++i)
  456. vmw_ldu_init(dev_priv, i);
  457. else
  458. vmw_ldu_init(dev_priv, 0);
  459. dev_priv->active_display_unit = vmw_du_legacy;
  460. DRM_INFO("Legacy Display Unit initialized\n");
  461. return 0;
  462. err_free:
  463. kfree(dev_priv->ldu_priv);
  464. dev_priv->ldu_priv = NULL;
  465. return ret;
  466. }
  467. int vmw_kms_ldu_close_display(struct vmw_private *dev_priv)
  468. {
  469. if (!dev_priv->ldu_priv)
  470. return -ENOSYS;
  471. BUG_ON(!list_empty(&dev_priv->ldu_priv->active));
  472. kfree(dev_priv->ldu_priv);
  473. return 0;
  474. }
  475. int vmw_kms_ldu_do_dmabuf_dirty(struct vmw_private *dev_priv,
  476. struct vmw_framebuffer *framebuffer,
  477. unsigned flags, unsigned color,
  478. struct drm_clip_rect *clips,
  479. unsigned num_clips, int increment)
  480. {
  481. size_t fifo_size;
  482. int i;
  483. struct {
  484. uint32_t header;
  485. SVGAFifoCmdUpdate body;
  486. } *cmd;
  487. fifo_size = sizeof(*cmd) * num_clips;
  488. cmd = vmw_fifo_reserve(dev_priv, fifo_size);
  489. if (unlikely(cmd == NULL)) {
  490. DRM_ERROR("Fifo reserve failed.\n");
  491. return -ENOMEM;
  492. }
  493. memset(cmd, 0, fifo_size);
  494. for (i = 0; i < num_clips; i++, clips += increment) {
  495. cmd[i].header = SVGA_CMD_UPDATE;
  496. cmd[i].body.x = clips->x1;
  497. cmd[i].body.y = clips->y1;
  498. cmd[i].body.width = clips->x2 - clips->x1;
  499. cmd[i].body.height = clips->y2 - clips->y1;
  500. }
  501. vmw_fifo_commit(dev_priv, fifo_size);
  502. return 0;
  503. }