Repository navigation
Commit bf8744e
qxl: refactor to use drm_fb_helper_fbdev_setup
Lots of code can be removed by relying on fb-helper:
- "struct drm_framebuffer" moves to fb_helper.fb.
- "struct drm_gem_object" moves to fb_helper.obj[0].
- "struct qxl_device" can be inferred as drm_fb_helper is embedded.
- qxl_user_framebuffer_create -> drm_gem_fb_create.
- qxl_user_framebuffer_destroy -> drm_gem_fb_destroy.
- qxl_fbdev_destroy -> drm_fb_helper_fbdev_teardown + vfree(shadow).
Remove unused code:
- qxl_fbdev_qobj_is_fb, qxl_fbdev_set_suspend.
- Unused fields of qxl_fbdev: delayed_ops, delayed_ops_lock, size.
Misc notes:
- The dirty callback is preserved as it is necessary to trigger update
commands in the hw (the screen stays black otherwise).
- No idea when .create_handle in drm_framebuffer_funcs is used, but use
the same drm_gem_fb_create_handle to match drm_gem_fb_funcs.
- I don't know why qxl_fb_find_or_create_single used to check for an
existing framebuffer and removed that check to match other drivers.
- Use of drm_fb_helper_fbdev_teardown also requires "info->fbdefio" to
be dynamically allocated. Replace the existing defio config by
drm_fb_helper_defio_init to accomodate this.
Testing results: startx with fbdev, modesetting and qxl all seems to
work. Tested also with CONFIG_DRM_FBDEV_EMULATION=n, fbdev obviously
fails but others are fine. QEMU -spice and QEMU -spice with vdagent and
multiple (resized) displays (via remote-viewer) also works.
unbind vtconsole and rmmod has *not* regressed (i.e. it still trips on a
use-after-free in qxl_check_idle via qxl_ttm_fini).
Ideally setup/teardown is replaced by drm_fbdev_generic_setup as that
would result in further code reduction, improve error handling (like not
leaking shadow memory), but unfortunately QXL has no implementation for
qxl_gem_prime_vmap.
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Link: http://patchwork.freedesktop.org/patch/msgid/20180910132156.23201-1-peter@lekensteyn.nl
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>1 parent 33f3542 commit bf8744e
4 files changed
Lines changed: 60 additions & 276 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
388 | 389 | | |
389 | 390 | | |
390 | 391 | | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | 392 | | |
403 | 393 | | |
404 | 394 | | |
405 | 395 | | |
406 | 396 | | |
407 | 397 | | |
408 | 398 | | |
409 | | - | |
410 | | - | |
| 399 | + | |
411 | 400 | | |
412 | 401 | | |
413 | 402 | | |
414 | 403 | | |
415 | 404 | | |
416 | 405 | | |
417 | | - | |
| 406 | + | |
418 | 407 | | |
419 | 408 | | |
420 | 409 | | |
| |||
432 | 421 | | |
433 | 422 | | |
434 | 423 | | |
435 | | - | |
| 424 | + | |
436 | 425 | | |
437 | 426 | | |
438 | 427 | | |
| |||
441 | 430 | | |
442 | 431 | | |
443 | 432 | | |
444 | | - | |
| 433 | + | |
445 | 434 | | |
446 | | - | |
447 | | - | |
| 435 | + | |
448 | 436 | | |
449 | 437 | | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | 438 | | |
470 | 439 | | |
471 | 440 | | |
| |||
488 | 457 | | |
489 | 458 | | |
490 | 459 | | |
491 | | - | |
492 | 460 | | |
493 | 461 | | |
494 | 462 | | |
495 | 463 | | |
496 | 464 | | |
497 | | - | |
498 | | - | |
| 465 | + | |
499 | 466 | | |
500 | 467 | | |
501 | 468 | | |
| |||
556 | 523 | | |
557 | 524 | | |
558 | 525 | | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
| 526 | + | |
563 | 527 | | |
564 | 528 | | |
565 | 529 | | |
566 | 530 | | |
567 | | - | |
568 | | - | |
| 531 | + | |
| 532 | + | |
569 | 533 | | |
570 | 534 | | |
571 | 535 | | |
572 | 536 | | |
573 | 537 | | |
574 | | - | |
575 | | - | |
| 538 | + | |
576 | 539 | | |
577 | 540 | | |
578 | 541 | | |
| |||
602 | 565 | | |
603 | 566 | | |
604 | 567 | | |
605 | | - | |
| 568 | + | |
606 | 569 | | |
607 | 570 | | |
608 | 571 | | |
| |||
611 | 574 | | |
612 | 575 | | |
613 | 576 | | |
614 | | - | |
615 | | - | |
616 | | - | |
| 577 | + | |
617 | 578 | | |
618 | 579 | | |
619 | 580 | | |
| |||
645 | 606 | | |
646 | 607 | | |
647 | 608 | | |
648 | | - | |
| 609 | + | |
649 | 610 | | |
650 | 611 | | |
651 | 612 | | |
| |||
765 | 726 | | |
766 | 727 | | |
767 | 728 | | |
768 | | - | |
| 729 | + | |
769 | 730 | | |
770 | 731 | | |
771 | 732 | | |
772 | 733 | | |
773 | 734 | | |
774 | | - | |
| 735 | + | |
775 | 736 | | |
776 | 737 | | |
777 | 738 | | |
| |||
815 | 776 | | |
816 | 777 | | |
817 | 778 | | |
818 | | - | |
| 779 | + | |
819 | 780 | | |
820 | 781 | | |
821 | 782 | | |
| |||
1115 | 1076 | | |
1116 | 1077 | | |
1117 | 1078 | | |
1118 | | - | |
1119 | | - | |
1120 | | - | |
1121 | | - | |
1122 | | - | |
1123 | | - | |
1124 | | - | |
1125 | | - | |
1126 | | - | |
1127 | | - | |
1128 | | - | |
1129 | | - | |
1130 | | - | |
1131 | | - | |
1132 | | - | |
1133 | | - | |
1134 | | - | |
1135 | | - | |
1136 | | - | |
1137 | | - | |
| 1079 | + | |
| 1080 | + | |
1138 | 1081 | | |
1139 | 1082 | | |
1140 | 1083 | | |
| |||
1221 | 1164 | | |
1222 | 1165 | | |
1223 | 1166 | | |
1224 | | - | |
1225 | 1167 | | |
1226 | 1168 | | |
1227 | 1169 | | |
| |||
1237 | 1179 | | |
1238 | 1180 | | |
1239 | 1181 | | |
1240 | | - | |
1241 | | - | |
1242 | | - | |
1243 | | - | |
| 1182 | + | |
1244 | 1183 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | | - | |
| 265 | + | |
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
| 284 | + | |
285 | 285 | | |
286 | | - | |
| 286 | + | |
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | 125 | | |
130 | 126 | | |
131 | 127 | | |
132 | | - | |
133 | 128 | | |
134 | 129 | | |
135 | 130 | | |
| |||
138 | 133 | | |
139 | 134 | | |
140 | 135 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | 136 | | |
149 | 137 | | |
150 | 138 | | |
| |||
232 | 220 | | |
233 | 221 | | |
234 | 222 | | |
235 | | - | |
236 | 223 | | |
237 | | - | |
238 | | - | |
| 224 | + | |
| 225 | + | |
239 | 226 | | |
240 | 227 | | |
241 | 228 | | |
| |||
349 | 336 | | |
350 | 337 | | |
351 | 338 | | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | 339 | | |
357 | 340 | | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | 341 | | |
366 | 342 | | |
367 | 343 | | |
| |||
471 | 447 | | |
472 | 448 | | |
473 | 449 | | |
474 | | - | |
| 450 | + | |
475 | 451 | | |
476 | 452 | | |
477 | 453 | | |
| |||
0 commit comments