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 = 0;
  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. i++;
  80. }
  81. if (crtc == NULL)
  82. return 0;
  83. fb = entry->base.crtc.primary->state->fb;
  84. return vmw_kms_write_svga(dev_priv, w, h, fb->pitches[0],
  85. fb->format->cpp[0] * 8,
  86. fb->format->depth);
  87. }
  88. if (!list_empty(&lds->active)) {
  89. entry = list_entry(lds->active.next, typeof(*entry), active);
  90. fb = entry->base.crtc.primary->state->fb;
  91. vmw_kms_write_svga(dev_priv, fb->width, fb->height, fb->pitches[0],
  92. fb->format->cpp[0] * 8, fb->format->depth);
  93. }
  94. /* Make sure we always show something. */
  95. vmw_write(dev_priv, SVGA_REG_NUM_GUEST_DISPLAYS,
  96. lds->num_active ? lds->num_active : 1);
  97. i = 0;
  98. list_for_each_entry(entry, &lds->active, active) {
  99. crtc = &entry->base.crtc;
  100. vmw_write(dev_priv, SVGA_REG_DISPLAY_ID, i);
  101. vmw_write(dev_priv, SVGA_REG_DISPLAY_IS_PRIMARY, !i);
  102. vmw_write(dev_priv, SVGA_REG_DISPLAY_POSITION_X, crtc->x);
  103. vmw_write(dev_priv, SVGA_REG_DISPLAY_POSITION_Y, crtc->y);
  104. vmw_write(dev_priv, SVGA_REG_DISPLAY_WIDTH, crtc->mode.hdisplay);
  105. vmw_write(dev_priv, SVGA_REG_DISPLAY_HEIGHT, crtc->mode.vdisplay);
  106. vmw_write(dev_priv, SVGA_REG_DISPLAY_ID, SVGA_ID_INVALID);
  107. i++;
  108. }
  109. BUG_ON(i != lds->num_active);
  110. lds->last_num_active = lds->num_active;
  111. return 0;
  112. }
  113. static int vmw_ldu_del_active(struct vmw_private *vmw_priv,
  114. struct vmw_legacy_display_unit *ldu)
  115. {
  116. struct vmw_legacy_display *ld = vmw_priv->ldu_priv;
  117. if (list_empty(&ldu->active))
  118. return 0;
  119. /* Must init otherwise list_empty(&ldu->active) will not work. */
  120. list_del_init(&ldu->active);
  121. if (--(ld->num_active) == 0) {
  122. BUG_ON(!ld->fb);
  123. if (ld->fb->unpin)
  124. ld->fb->unpin(ld->fb);
  125. ld->fb = NULL;
  126. }
  127. return 0;
  128. }
  129. static int vmw_ldu_add_active(struct vmw_private *vmw_priv,
  130. struct vmw_legacy_display_unit *ldu,
  131. struct vmw_framebuffer *vfb)
  132. {
  133. struct vmw_legacy_display *ld = vmw_priv->ldu_priv;
  134. struct vmw_legacy_display_unit *entry;
  135. struct list_head *at;
  136. BUG_ON(!ld->num_active && ld->fb);
  137. if (vfb != ld->fb) {
  138. if (ld->fb && ld->fb->unpin)
  139. ld->fb->unpin(ld->fb);
  140. vmw_svga_enable(vmw_priv);
  141. if (vfb->pin)
  142. vfb->pin(vfb);
  143. ld->fb = vfb;
  144. }
  145. if (!list_empty(&ldu->active))
  146. return 0;
  147. at = &ld->active;
  148. list_for_each_entry(entry, &ld->active, active) {
  149. if (entry->base.unit > ldu->base.unit)
  150. break;
  151. at = &entry->active;
  152. }
  153. list_add(&ldu->active, at);
  154. ld->num_active++;
  155. return 0;
  156. }
  157. /**
  158. * vmw_ldu_crtc_mode_set_nofb - Enable svga
  159. *
  160. * @crtc: CRTC associated with the new screen
  161. *
  162. * For LDU, just enable the svga
  163. */
  164. static void vmw_ldu_crtc_mode_set_nofb(struct drm_crtc *crtc)
  165. {
  166. }
  167. /**
  168. * vmw_ldu_crtc_atomic_enable - Noop
  169. *
  170. * @crtc: CRTC associated with the new screen
  171. *
  172. * This is called after a mode set has been completed. Here's
  173. * usually a good place to call vmw_ldu_add_active/vmw_ldu_del_active
  174. * but since for LDU the display plane is closely tied to the
  175. * CRTC, it makes more sense to do those at plane update time.
  176. */
  177. static void vmw_ldu_crtc_atomic_enable(struct drm_crtc *crtc,
  178. struct drm_crtc_state *old_state)
  179. {
  180. }
  181. /**
  182. * vmw_ldu_crtc_atomic_disable - Turns off CRTC
  183. *
  184. * @crtc: CRTC to be turned off
  185. */
  186. static void vmw_ldu_crtc_atomic_disable(struct drm_crtc *crtc,
  187. struct drm_crtc_state *old_state)
  188. {
  189. }
  190. static const struct drm_crtc_funcs vmw_legacy_crtc_funcs = {
  191. .gamma_set = vmw_du_crtc_gamma_set,
  192. .destroy = vmw_ldu_crtc_destroy,
  193. .reset = vmw_du_crtc_reset,
  194. .atomic_duplicate_state = vmw_du_crtc_duplicate_state,
  195. .atomic_destroy_state = vmw_du_crtc_destroy_state,
  196. .set_config = vmw_kms_set_config,
  197. };
  198. /*
  199. * Legacy Display Unit encoder functions
  200. */
  201. static void vmw_ldu_encoder_destroy(struct drm_encoder *encoder)
  202. {
  203. vmw_ldu_destroy(vmw_encoder_to_ldu(encoder));
  204. }
  205. static const struct drm_encoder_funcs vmw_legacy_encoder_funcs = {
  206. .destroy = vmw_ldu_encoder_destroy,
  207. };
  208. /*
  209. * Legacy Display Unit connector functions
  210. */
  211. static void vmw_ldu_connector_destroy(struct drm_connector *connector)
  212. {
  213. vmw_ldu_destroy(vmw_connector_to_ldu(connector));
  214. }
  215. static const struct drm_connector_funcs vmw_legacy_connector_funcs = {
  216. .dpms = vmw_du_connector_dpms,
  217. .detect = vmw_du_connector_detect,
  218. .fill_modes = vmw_du_connector_fill_modes,
  219. .set_property = vmw_du_connector_set_property,
  220. .destroy = vmw_ldu_connector_destroy,
  221. .reset = vmw_du_connector_reset,
  222. .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
  223. .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
  224. .atomic_set_property = vmw_du_connector_atomic_set_property,
  225. .atomic_get_property = vmw_du_connector_atomic_get_property,
  226. };
  227. static const struct
  228. drm_connector_helper_funcs vmw_ldu_connector_helper_funcs = {
  229. .best_encoder = drm_atomic_helper_best_encoder,
  230. };
  231. /*
  232. * Legacy Display Plane Functions
  233. */
  234. /**
  235. * vmw_ldu_primary_plane_cleanup_fb - Noop
  236. *
  237. * @plane: display plane
  238. * @old_state: Contains the FB to clean up
  239. *
  240. * Unpins the display surface
  241. *
  242. * Returns 0 on success
  243. */
  244. static void
  245. vmw_ldu_primary_plane_cleanup_fb(struct drm_plane *plane,
  246. struct drm_plane_state *old_state)
  247. {
  248. }
  249. /**
  250. * vmw_ldu_primary_plane_prepare_fb - Noop
  251. *
  252. * @plane: display plane
  253. * @new_state: info on the new plane state, including the FB
  254. *
  255. * Returns 0 on success
  256. */
  257. static int
  258. vmw_ldu_primary_plane_prepare_fb(struct drm_plane *plane,
  259. struct drm_plane_state *new_state)
  260. {
  261. return 0;
  262. }
  263. static void
  264. vmw_ldu_primary_plane_atomic_update(struct drm_plane *plane,
  265. struct drm_plane_state *old_state)
  266. {
  267. struct vmw_private *dev_priv;
  268. struct vmw_legacy_display_unit *ldu;
  269. struct vmw_framebuffer *vfb;
  270. struct drm_framebuffer *fb;
  271. struct drm_crtc *crtc = plane->state->crtc ?: old_state->crtc;
  272. ldu = vmw_crtc_to_ldu(crtc);
  273. dev_priv = vmw_priv(plane->dev);
  274. fb = plane->state->fb;
  275. vfb = (fb) ? vmw_framebuffer_to_vfb(fb) : NULL;
  276. if (vfb)
  277. vmw_ldu_add_active(dev_priv, ldu, vfb);
  278. else
  279. vmw_ldu_del_active(dev_priv, ldu);
  280. vmw_ldu_commit_list(dev_priv);
  281. }
  282. static const struct drm_plane_funcs vmw_ldu_plane_funcs = {
  283. .update_plane = drm_atomic_helper_update_plane,
  284. .disable_plane = drm_atomic_helper_disable_plane,
  285. .destroy = vmw_du_primary_plane_destroy,
  286. .reset = vmw_du_plane_reset,
  287. .atomic_duplicate_state = vmw_du_plane_duplicate_state,
  288. .atomic_destroy_state = vmw_du_plane_destroy_state,
  289. };
  290. static const struct drm_plane_funcs vmw_ldu_cursor_funcs = {
  291. .update_plane = drm_atomic_helper_update_plane,
  292. .disable_plane = drm_atomic_helper_disable_plane,
  293. .destroy = vmw_du_cursor_plane_destroy,
  294. .reset = vmw_du_plane_reset,
  295. .atomic_duplicate_state = vmw_du_plane_duplicate_state,
  296. .atomic_destroy_state = vmw_du_plane_destroy_state,
  297. };
  298. /*
  299. * Atomic Helpers
  300. */
  301. static const struct
  302. drm_plane_helper_funcs vmw_ldu_cursor_plane_helper_funcs = {
  303. .atomic_check = vmw_du_cursor_plane_atomic_check,
  304. .atomic_update = vmw_du_cursor_plane_atomic_update,
  305. .prepare_fb = vmw_du_cursor_plane_prepare_fb,
  306. .cleanup_fb = vmw_du_plane_cleanup_fb,
  307. };
  308. static const struct
  309. drm_plane_helper_funcs vmw_ldu_primary_plane_helper_funcs = {
  310. .atomic_check = vmw_du_primary_plane_atomic_check,
  311. .atomic_update = vmw_ldu_primary_plane_atomic_update,
  312. .prepare_fb = vmw_ldu_primary_plane_prepare_fb,
  313. .cleanup_fb = vmw_ldu_primary_plane_cleanup_fb,
  314. };
  315. static const struct drm_crtc_helper_funcs vmw_ldu_crtc_helper_funcs = {
  316. .mode_set_nofb = vmw_ldu_crtc_mode_set_nofb,
  317. .atomic_check = vmw_du_crtc_atomic_check,
  318. .atomic_begin = vmw_du_crtc_atomic_begin,
  319. .atomic_flush = vmw_du_crtc_atomic_flush,
  320. .atomic_enable = vmw_ldu_crtc_atomic_enable,
  321. .atomic_disable = vmw_ldu_crtc_atomic_disable,
  322. };
  323. static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit)
  324. {
  325. struct vmw_legacy_display_unit *ldu;
  326. struct drm_device *dev = dev_priv->dev;
  327. struct drm_connector *connector;
  328. struct drm_encoder *encoder;
  329. struct drm_plane *primary, *cursor;
  330. struct drm_crtc *crtc;
  331. int ret;
  332. ldu = kzalloc(sizeof(*ldu), GFP_KERNEL);
  333. if (!ldu)
  334. return -ENOMEM;
  335. ldu->base.unit = unit;
  336. crtc = &ldu->base.crtc;
  337. encoder = &ldu->base.encoder;
  338. connector = &ldu->base.connector;
  339. primary = &ldu->base.primary;
  340. cursor = &ldu->base.cursor;
  341. INIT_LIST_HEAD(&ldu->active);
  342. ldu->base.pref_active = (unit == 0);
  343. ldu->base.pref_width = dev_priv->initial_width;
  344. ldu->base.pref_height = dev_priv->initial_height;
  345. ldu->base.pref_mode = NULL;
  346. /*
  347. * Remove this after enabling atomic because property values can
  348. * only exist in a state object
  349. */
  350. ldu->base.is_implicit = true;
  351. /* Initialize primary plane */
  352. vmw_du_plane_reset(primary);
  353. ret = drm_universal_plane_init(dev, &ldu->base.primary,
  354. 0, &vmw_ldu_plane_funcs,
  355. vmw_primary_plane_formats,
  356. ARRAY_SIZE(vmw_primary_plane_formats),
  357. NULL, DRM_PLANE_TYPE_PRIMARY, NULL);
  358. if (ret) {
  359. DRM_ERROR("Failed to initialize primary plane");
  360. goto err_free;
  361. }
  362. drm_plane_helper_add(primary, &vmw_ldu_primary_plane_helper_funcs);
  363. /* Initialize cursor plane */
  364. vmw_du_plane_reset(cursor);
  365. ret = drm_universal_plane_init(dev, &ldu->base.cursor,
  366. 0, &vmw_ldu_cursor_funcs,
  367. vmw_cursor_plane_formats,
  368. ARRAY_SIZE(vmw_cursor_plane_formats),
  369. NULL, DRM_PLANE_TYPE_CURSOR, NULL);
  370. if (ret) {
  371. DRM_ERROR("Failed to initialize cursor plane");
  372. drm_plane_cleanup(&ldu->base.primary);
  373. goto err_free;
  374. }
  375. drm_plane_helper_add(cursor, &vmw_ldu_cursor_plane_helper_funcs);
  376. vmw_du_connector_reset(connector);
  377. ret = drm_connector_init(dev, connector, &vmw_legacy_connector_funcs,
  378. DRM_MODE_CONNECTOR_VIRTUAL);
  379. if (ret) {
  380. DRM_ERROR("Failed to initialize connector\n");
  381. goto err_free;
  382. }
  383. drm_connector_helper_add(connector, &vmw_ldu_connector_helper_funcs);
  384. connector->status = vmw_du_connector_detect(connector, true);
  385. vmw_connector_state_to_vcs(connector->state)->is_implicit = true;
  386. ret = drm_encoder_init(dev, encoder, &vmw_legacy_encoder_funcs,
  387. DRM_MODE_ENCODER_VIRTUAL, NULL);
  388. if (ret) {
  389. DRM_ERROR("Failed to initialize encoder\n");
  390. goto err_free_connector;
  391. }
  392. (void) drm_mode_connector_attach_encoder(connector, encoder);
  393. encoder->possible_crtcs = (1 << unit);
  394. encoder->possible_clones = 0;
  395. ret = drm_connector_register(connector);
  396. if (ret) {
  397. DRM_ERROR("Failed to register connector\n");
  398. goto err_free_encoder;
  399. }
  400. vmw_du_crtc_reset(crtc);
  401. ret = drm_crtc_init_with_planes(dev, crtc, &ldu->base.primary,
  402. &ldu->base.cursor,
  403. &vmw_legacy_crtc_funcs, NULL);
  404. if (ret) {
  405. DRM_ERROR("Failed to initialize CRTC\n");
  406. goto err_free_unregister;
  407. }
  408. drm_crtc_helper_add(crtc, &vmw_ldu_crtc_helper_funcs);
  409. drm_mode_crtc_set_gamma_size(crtc, 256);
  410. drm_object_attach_property(&connector->base,
  411. dev_priv->hotplug_mode_update_property, 1);
  412. drm_object_attach_property(&connector->base,
  413. dev->mode_config.suggested_x_property, 0);
  414. drm_object_attach_property(&connector->base,
  415. dev->mode_config.suggested_y_property, 0);
  416. if (dev_priv->implicit_placement_property)
  417. drm_object_attach_property
  418. (&connector->base,
  419. dev_priv->implicit_placement_property,
  420. 1);
  421. return 0;
  422. err_free_unregister:
  423. drm_connector_unregister(connector);
  424. err_free_encoder:
  425. drm_encoder_cleanup(encoder);
  426. err_free_connector:
  427. drm_connector_cleanup(connector);
  428. err_free:
  429. kfree(ldu);
  430. return ret;
  431. }
  432. int vmw_kms_ldu_init_display(struct vmw_private *dev_priv)
  433. {
  434. struct drm_device *dev = dev_priv->dev;
  435. int i, ret;
  436. if (dev_priv->ldu_priv) {
  437. DRM_INFO("ldu system already on\n");
  438. return -EINVAL;
  439. }
  440. dev_priv->ldu_priv = kmalloc(sizeof(*dev_priv->ldu_priv), GFP_KERNEL);
  441. if (!dev_priv->ldu_priv)
  442. return -ENOMEM;
  443. INIT_LIST_HEAD(&dev_priv->ldu_priv->active);
  444. dev_priv->ldu_priv->num_active = 0;
  445. dev_priv->ldu_priv->last_num_active = 0;
  446. dev_priv->ldu_priv->fb = NULL;
  447. /* for old hardware without multimon only enable one display */
  448. if (dev_priv->capabilities & SVGA_CAP_MULTIMON)
  449. ret = drm_vblank_init(dev, VMWGFX_NUM_DISPLAY_UNITS);
  450. else
  451. ret = drm_vblank_init(dev, 1);
  452. if (ret != 0)
  453. goto err_free;
  454. vmw_kms_create_implicit_placement_property(dev_priv, true);
  455. if (dev_priv->capabilities & SVGA_CAP_MULTIMON)
  456. for (i = 0; i < VMWGFX_NUM_DISPLAY_UNITS; ++i)
  457. vmw_ldu_init(dev_priv, i);
  458. else
  459. vmw_ldu_init(dev_priv, 0);
  460. dev_priv->active_display_unit = vmw_du_legacy;
  461. DRM_INFO("Legacy Display Unit initialized\n");
  462. return 0;
  463. err_free:
  464. kfree(dev_priv->ldu_priv);
  465. dev_priv->ldu_priv = NULL;
  466. return ret;
  467. }
  468. int vmw_kms_ldu_close_display(struct vmw_private *dev_priv)
  469. {
  470. if (!dev_priv->ldu_priv)
  471. return -ENOSYS;
  472. BUG_ON(!list_empty(&dev_priv->ldu_priv->active));
  473. kfree(dev_priv->ldu_priv);
  474. return 0;
  475. }
  476. int vmw_kms_ldu_do_dmabuf_dirty(struct vmw_private *dev_priv,
  477. struct vmw_framebuffer *framebuffer,
  478. unsigned flags, unsigned color,
  479. struct drm_clip_rect *clips,
  480. unsigned num_clips, int increment)
  481. {
  482. size_t fifo_size;
  483. int i;
  484. struct {
  485. uint32_t header;
  486. SVGAFifoCmdUpdate body;
  487. } *cmd;
  488. fifo_size = sizeof(*cmd) * num_clips;
  489. cmd = vmw_fifo_reserve(dev_priv, fifo_size);
  490. if (unlikely(cmd == NULL)) {
  491. DRM_ERROR("Fifo reserve failed.\n");
  492. return -ENOMEM;
  493. }
  494. memset(cmd, 0, fifo_size);
  495. for (i = 0; i < num_clips; i++, clips += increment) {
  496. cmd[i].header = SVGA_CMD_UPDATE;
  497. cmd[i].body.x = clips->x1;
  498. cmd[i].body.y = clips->y1;
  499. cmd[i].body.width = clips->x2 - clips->x1;
  500. cmd[i].body.height = clips->y2 - clips->y1;
  501. }
  502. vmw_fifo_commit(dev_priv, fifo_size);
  503. return 0;
  504. }