Back to home page

OSCL-LXR

 
 

    


0001 .. _todo:
0002 
0003 =========
0004 TODO list
0005 =========
0006 
0007 This section contains a list of smaller janitorial tasks in the kernel DRM
0008 graphics subsystem useful as newbie projects. Or for slow rainy days.
0009 
0010 Difficulty
0011 ----------
0012 
0013 To make it easier task are categorized into different levels:
0014 
0015 Starter: Good tasks to get started with the DRM subsystem.
0016 
0017 Intermediate: Tasks which need some experience with working in the DRM
0018 subsystem, or some specific GPU/display graphics knowledge. For debugging issue
0019 it's good to have the relevant hardware (or a virtual driver set up) available
0020 for testing.
0021 
0022 Advanced: Tricky tasks that need fairly good understanding of the DRM subsystem
0023 and graphics topics. Generally need the relevant hardware for development and
0024 testing.
0025 
0026 Expert: Only attempt these if you've successfully completed some tricky
0027 refactorings already and are an expert in the specific area
0028 
0029 Subsystem-wide refactorings
0030 ===========================
0031 
0032 Remove custom dumb_map_offset implementations
0033 ---------------------------------------------
0034 
0035 All GEM based drivers should be using drm_gem_create_mmap_offset() instead.
0036 Audit each individual driver, make sure it'll work with the generic
0037 implementation (there's lots of outdated locking leftovers in various
0038 implementations), and then remove it.
0039 
0040 Contact: Daniel Vetter, respective driver maintainers
0041 
0042 Level: Intermediate
0043 
0044 Convert existing KMS drivers to atomic modesetting
0045 --------------------------------------------------
0046 
0047 3.19 has the atomic modeset interfaces and helpers, so drivers can now be
0048 converted over. Modern compositors like Wayland or Surfaceflinger on Android
0049 really want an atomic modeset interface, so this is all about the bright
0050 future.
0051 
0052 There is a conversion guide for atomic and all you need is a GPU for a
0053 non-converted driver (again virtual HW drivers for KVM are still all
0054 suitable).
0055 
0056 As part of this drivers also need to convert to universal plane (which means
0057 exposing primary & cursor as proper plane objects). But that's much easier to
0058 do by directly using the new atomic helper driver callbacks.
0059 
0060 Contact: Daniel Vetter, respective driver maintainers
0061 
0062 Level: Advanced
0063 
0064 Clean up the clipped coordination confusion around planes
0065 ---------------------------------------------------------
0066 
0067 We have a helper to get this right with drm_plane_helper_check_update(), but
0068 it's not consistently used. This should be fixed, preferrably in the atomic
0069 helpers (and drivers then moved over to clipped coordinates). Probably the
0070 helper should also be moved from drm_plane_helper.c to the atomic helpers, to
0071 avoid confusion - the other helpers in that file are all deprecated legacy
0072 helpers.
0073 
0074 Contact: Ville Syrjälä, Daniel Vetter, driver maintainers
0075 
0076 Level: Advanced
0077 
0078 Improve plane atomic_check helpers
0079 ----------------------------------
0080 
0081 Aside from the clipped coordinates right above there's a few suboptimal things
0082 with the current helpers:
0083 
0084 - drm_plane_helper_funcs->atomic_check gets called for enabled or disabled
0085   planes. At best this seems to confuse drivers, worst it means they blow up
0086   when the plane is disabled without the CRTC. The only special handling is
0087   resetting values in the plane state structures, which instead should be moved
0088   into the drm_plane_funcs->atomic_duplicate_state functions.
0089 
0090 - Once that's done, helpers could stop calling ->atomic_check for disabled
0091   planes.
0092 
0093 - Then we could go through all the drivers and remove the more-or-less confused
0094   checks for plane_state->fb and plane_state->crtc.
0095 
0096 Contact: Daniel Vetter
0097 
0098 Level: Advanced
0099 
0100 Convert early atomic drivers to async commit helpers
0101 ----------------------------------------------------
0102 
0103 For the first year the atomic modeset helpers didn't support asynchronous /
0104 nonblocking commits, and every driver had to hand-roll them. This is fixed
0105 now, but there's still a pile of existing drivers that easily could be
0106 converted over to the new infrastructure.
0107 
0108 One issue with the helpers is that they require that drivers handle completion
0109 events for atomic commits correctly. But fixing these bugs is good anyway.
0110 
0111 Somewhat related is the legacy_cursor_update hack, which should be replaced with
0112 the new atomic_async_check/commit functionality in the helpers in drivers that
0113 still look at that flag.
0114 
0115 Contact: Daniel Vetter, respective driver maintainers
0116 
0117 Level: Advanced
0118 
0119 Fallout from atomic KMS
0120 -----------------------
0121 
0122 ``drm_atomic_helper.c`` provides a batch of functions which implement legacy
0123 IOCTLs on top of the new atomic driver interface. Which is really nice for
0124 gradual conversion of drivers, but unfortunately the semantic mismatches are
0125 a bit too severe. So there's some follow-up work to adjust the function
0126 interfaces to fix these issues:
0127 
0128 * atomic needs the lock acquire context. At the moment that's passed around
0129   implicitly with some horrible hacks, and it's also allocate with
0130   ``GFP_NOFAIL`` behind the scenes. All legacy paths need to start allocating
0131   the acquire context explicitly on stack and then also pass it down into
0132   drivers explicitly so that the legacy-on-atomic functions can use them.
0133 
0134   Except for some driver code this is done. This task should be finished by
0135   adding WARN_ON(!drm_drv_uses_atomic_modeset) in drm_modeset_lock_all().
0136 
0137 * A bunch of the vtable hooks are now in the wrong place: DRM has a split
0138   between core vfunc tables (named ``drm_foo_funcs``), which are used to
0139   implement the userspace ABI. And then there's the optional hooks for the
0140   helper libraries (name ``drm_foo_helper_funcs``), which are purely for
0141   internal use. Some of these hooks should be move from ``_funcs`` to
0142   ``_helper_funcs`` since they are not part of the core ABI. There's a
0143   ``FIXME`` comment in the kerneldoc for each such case in ``drm_crtc.h``.
0144 
0145 Contact: Daniel Vetter
0146 
0147 Level: Intermediate
0148 
0149 Get rid of dev->struct_mutex from GEM drivers
0150 ---------------------------------------------
0151 
0152 ``dev->struct_mutex`` is the Big DRM Lock from legacy days and infested
0153 everything. Nowadays in modern drivers the only bit where it's mandatory is
0154 serializing GEM buffer object destruction. Which unfortunately means drivers
0155 have to keep track of that lock and either call ``unreference`` or
0156 ``unreference_locked`` depending upon context.
0157 
0158 Core GEM doesn't have a need for ``struct_mutex`` any more since kernel 4.8,
0159 and there's a GEM object ``free`` callback for any drivers which are
0160 entirely ``struct_mutex`` free.
0161 
0162 For drivers that need ``struct_mutex`` it should be replaced with a driver-
0163 private lock. The tricky part is the BO free functions, since those can't
0164 reliably take that lock any more. Instead state needs to be protected with
0165 suitable subordinate locks or some cleanup work pushed to a worker thread. For
0166 performance-critical drivers it might also be better to go with a more
0167 fine-grained per-buffer object and per-context lockings scheme. Currently only
0168 the ``msm`` and `i915` drivers use ``struct_mutex``.
0169 
0170 Contact: Daniel Vetter, respective driver maintainers
0171 
0172 Level: Advanced
0173 
0174 Move Buffer Object Locking to dma_resv_lock()
0175 ---------------------------------------------
0176 
0177 Many drivers have their own per-object locking scheme, usually using
0178 mutex_lock(). This causes all kinds of trouble for buffer sharing, since
0179 depending which driver is the exporter and importer, the locking hierarchy is
0180 reversed.
0181 
0182 To solve this we need one standard per-object locking mechanism, which is
0183 dma_resv_lock(). This lock needs to be called as the outermost lock, with all
0184 other driver specific per-object locks removed. The problem is tha rolling out
0185 the actual change to the locking contract is a flag day, due to struct dma_buf
0186 buffer sharing.
0187 
0188 Level: Expert
0189 
0190 Convert logging to drm_* functions with drm_device paramater
0191 ------------------------------------------------------------
0192 
0193 For drivers which could have multiple instances, it is necessary to
0194 differentiate between which is which in the logs. Since DRM_INFO/WARN/ERROR
0195 don't do this, drivers used dev_info/warn/err to make this differentiation. We
0196 now have drm_* variants of the drm print functions, so we can start to convert
0197 those drivers back to using drm-formatted specific log messages.
0198 
0199 Before you start this conversion please contact the relevant maintainers to make
0200 sure your work will be merged - not everyone agrees that the DRM dmesg macros
0201 are better.
0202 
0203 Contact: Sean Paul, Maintainer of the driver you plan to convert
0204 
0205 Level: Starter
0206 
0207 Convert drivers to use simple modeset suspend/resume
0208 ----------------------------------------------------
0209 
0210 Most drivers (except i915 and nouveau) that use
0211 drm_atomic_helper_suspend/resume() can probably be converted to use
0212 drm_mode_config_helper_suspend/resume(). Also there's still open-coded version
0213 of the atomic suspend/resume code in older atomic modeset drivers.
0214 
0215 Contact: Maintainer of the driver you plan to convert
0216 
0217 Level: Intermediate
0218 
0219 Convert drivers to use drm_fbdev_generic_setup()
0220 ------------------------------------------------
0221 
0222 Most drivers can use drm_fbdev_generic_setup(). Driver have to implement
0223 atomic modesetting and GEM vmap support. Historically, generic fbdev emulation
0224 expected the framebuffer in system memory or system-like memory. By employing
0225 struct iosys_map, drivers with frambuffers in I/O memory can be supported
0226 as well.
0227 
0228 Contact: Maintainer of the driver you plan to convert
0229 
0230 Level: Intermediate
0231 
0232 Reimplement functions in drm_fbdev_fb_ops without fbdev
0233 -------------------------------------------------------
0234 
0235 A number of callback functions in drm_fbdev_fb_ops could benefit from
0236 being rewritten without dependencies on the fbdev module. Some of the
0237 helpers could further benefit from using struct iosys_map instead of
0238 raw pointers.
0239 
0240 Contact: Thomas Zimmermann <tzimmermann@suse.de>, Daniel Vetter
0241 
0242 Level: Advanced
0243 
0244 Benchmark and optimize blitting and format-conversion function
0245 --------------------------------------------------------------
0246 
0247 Drawing to dispay memory quickly is crucial for many applications'
0248 performance.
0249 
0250 On at least x86-64, sys_imageblit() is significantly slower than
0251 cfb_imageblit(), even though both use the same blitting algorithm and
0252 the latter is written for I/O memory. It turns out that cfb_imageblit()
0253 uses movl instructions, while sys_imageblit apparently does not. This
0254 seems to be a problem with gcc's optimizer. DRM's format-conversion
0255 helpers might be subject to similar issues.
0256 
0257 Benchmark and optimize fbdev's sys_() helpers and DRM's format-conversion
0258 helpers. In cases that can be further optimized, maybe implement a different
0259 algorithm. For micro-optimizations, use movl/movq instructions explicitly.
0260 That might possibly require architecture-specific helpers (e.g., storel()
0261 storeq()).
0262 
0263 Contact: Thomas Zimmermann <tzimmermann@suse.de>
0264 
0265 Level: Intermediate
0266 
0267 drm_framebuffer_funcs and drm_mode_config_funcs.fb_create cleanup
0268 -----------------------------------------------------------------
0269 
0270 A lot more drivers could be switched over to the drm_gem_framebuffer helpers.
0271 Various hold-ups:
0272 
0273 - Need to switch over to the generic dirty tracking code using
0274   drm_atomic_helper_dirtyfb first (e.g. qxl).
0275 
0276 - Need to switch to drm_fbdev_generic_setup(), otherwise a lot of the custom fb
0277   setup code can't be deleted.
0278 
0279 - Many drivers wrap drm_gem_fb_create() only to check for valid formats. For
0280   atomic drivers we could check for valid formats by calling
0281   drm_plane_check_pixel_format() against all planes, and pass if any plane
0282   supports the format. For non-atomic that's not possible since like the format
0283   list for the primary plane is fake and we'd therefor reject valid formats.
0284 
0285 - Many drivers subclass drm_framebuffer, we'd need a embedding compatible
0286   version of the varios drm_gem_fb_create functions. Maybe called
0287   drm_gem_fb_create/_with_dirty/_with_funcs as needed.
0288 
0289 Contact: Daniel Vetter
0290 
0291 Level: Intermediate
0292 
0293 Generic fbdev defio support
0294 ---------------------------
0295 
0296 The defio support code in the fbdev core has some very specific requirements,
0297 which means drivers need to have a special framebuffer for fbdev. The main
0298 issue is that it uses some fields in struct page itself, which breaks shmem
0299 gem objects (and other things). To support defio, affected drivers require
0300 the use of a shadow buffer, which may add CPU and memory overhead.
0301 
0302 Possible solution would be to write our own defio mmap code in the drm fbdev
0303 emulation. It would need to fully wrap the existing mmap ops, forwarding
0304 everything after it has done the write-protect/mkwrite trickery:
0305 
0306 - In the drm_fbdev_fb_mmap helper, if we need defio, change the
0307   default page prots to write-protected with something like this::
0308 
0309       vma->vm_page_prot = pgprot_wrprotect(vma->vm_page_prot);
0310 
0311 - Set the mkwrite and fsync callbacks with similar implementions to the core
0312   fbdev defio stuff. These should all work on plain ptes, they don't actually
0313   require a struct page.  uff. These should all work on plain ptes, they don't
0314   actually require a struct page.
0315 
0316 - Track the dirty pages in a separate structure (bitfield with one bit per page
0317   should work) to avoid clobbering struct page.
0318 
0319 Might be good to also have some igt testcases for this.
0320 
0321 Contact: Daniel Vetter, Noralf Tronnes
0322 
0323 Level: Advanced
0324 
0325 idr_init_base()
0326 ---------------
0327 
0328 DRM core&drivers uses a lot of idr (integer lookup directories) for mapping
0329 userspace IDs to internal objects, and in most places ID=0 means NULL and hence
0330 is never used. Switching to idr_init_base() for these would make the idr more
0331 efficient.
0332 
0333 Contact: Daniel Vetter
0334 
0335 Level: Starter
0336 
0337 struct drm_gem_object_funcs
0338 ---------------------------
0339 
0340 GEM objects can now have a function table instead of having the callbacks on the
0341 DRM driver struct. This is now the preferred way. Callbacks in drivers have been
0342 converted, except for struct drm_driver.gem_prime_mmap.
0343 
0344 Level: Intermediate
0345 
0346 Rename CMA helpers to DMA helpers
0347 ---------------------------------
0348 
0349 CMA (standing for contiguous memory allocator) is really a bit an accident of
0350 what these were used for first, a much better name would be DMA helpers. In the
0351 text these should even be called coherent DMA memory helpers (so maybe CDM, but
0352 no one knows what that means) since underneath they just use dma_alloc_coherent.
0353 
0354 Contact: Laurent Pinchart, Daniel Vetter
0355 
0356 Level: Intermediate (mostly because it is a huge tasks without good partial
0357 milestones, not technically itself that challenging)
0358 
0359 connector register/unregister fixes
0360 -----------------------------------
0361 
0362 - For most connectors it's a no-op to call drm_connector_register/unregister
0363   directly from driver code, drm_dev_register/unregister take care of this
0364   already. We can remove all of them.
0365 
0366 - For dp drivers it's a bit more a mess, since we need the connector to be
0367   registered when calling drm_dp_aux_register. Fix this by instead calling
0368   drm_dp_aux_init, and moving the actual registering into a late_register
0369   callback as recommended in the kerneldoc.
0370 
0371 Level: Intermediate
0372 
0373 Remove load/unload callbacks from all non-DRIVER_LEGACY drivers
0374 ---------------------------------------------------------------
0375 
0376 The load/unload callbacks in struct &drm_driver are very much midlayers, plus
0377 for historical reasons they get the ordering wrong (and we can't fix that)
0378 between setting up the &drm_driver structure and calling drm_dev_register().
0379 
0380 - Rework drivers to no longer use the load/unload callbacks, directly coding the
0381   load/unload sequence into the driver's probe function.
0382 
0383 - Once all non-DRIVER_LEGACY drivers are converted, disallow the load/unload
0384   callbacks for all modern drivers.
0385 
0386 Contact: Daniel Vetter
0387 
0388 Level: Intermediate
0389 
0390 Replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi
0391 ---------------------------------------------------------------
0392 
0393 Once EDID is parsed, the monitor HDMI support information is available through
0394 drm_display_info.is_hdmi. Many drivers still call drm_detect_hdmi_monitor() to
0395 retrieve the same information, which is less efficient.
0396 
0397 Audit each individual driver calling drm_detect_hdmi_monitor() and switch to
0398 drm_display_info.is_hdmi if applicable.
0399 
0400 Contact: Laurent Pinchart, respective driver maintainers
0401 
0402 Level: Intermediate
0403 
0404 Consolidate custom driver modeset properties
0405 --------------------------------------------
0406 
0407 Before atomic modeset took place, many drivers where creating their own
0408 properties. Among other things, atomic brought the requirement that custom,
0409 driver specific properties should not be used.
0410 
0411 For this task, we aim to introduce core helpers or reuse the existing ones
0412 if available:
0413 
0414 A quick, unconfirmed, examples list.
0415 
0416 Introduce core helpers:
0417 - audio (amdgpu, intel, gma500, radeon)
0418 - brightness, contrast, etc (armada, nouveau) - overlay only (?)
0419 - broadcast rgb (gma500, intel)
0420 - colorkey (armada, nouveau, rcar) - overlay only (?)
0421 - dither (amdgpu, nouveau, radeon) - varies across drivers
0422 - underscan family (amdgpu, radeon, nouveau)
0423 
0424 Already in core:
0425 - colorspace (sti)
0426 - tv format names, enhancements (gma500, intel)
0427 - tv overscan, margins, etc. (gma500, intel)
0428 - zorder (omapdrm) - same as zpos (?)
0429 
0430 
0431 Contact: Emil Velikov, respective driver maintainers
0432 
0433 Level: Intermediate
0434 
0435 Use struct iosys_map throughout codebase
0436 ----------------------------------------
0437 
0438 Pointers to shared device memory are stored in struct iosys_map. Each
0439 instance knows whether it refers to system or I/O memory. Most of the DRM-wide
0440 interface have been converted to use struct iosys_map, but implementations
0441 often still use raw pointers.
0442 
0443 The task is to use struct iosys_map where it makes sense.
0444 
0445 * Memory managers should use struct iosys_map for dma-buf-imported buffers.
0446 * TTM might benefit from using struct iosys_map internally.
0447 * Framebuffer copying and blitting helpers should operate on struct iosys_map.
0448 
0449 Contact: Thomas Zimmermann <tzimmermann@suse.de>, Christian König, Daniel Vetter
0450 
0451 Level: Intermediate
0452 
0453 Review all drivers for setting struct drm_mode_config.{max_width,max_height} correctly
0454 --------------------------------------------------------------------------------------
0455 
0456 The values in struct drm_mode_config.{max_width,max_height} describe the
0457 maximum supported framebuffer size. It's the virtual screen size, but many
0458 drivers treat it like limitations of the physical resolution.
0459 
0460 The maximum width depends on the hardware's maximum scanline pitch. The
0461 maximum height depends on the amount of addressable video memory. Review all
0462 drivers to initialize the fields to the correct values.
0463 
0464 Contact: Thomas Zimmermann <tzimmermann@suse.de>
0465 
0466 Level: Intermediate
0467 
0468 Request memory regions in all drivers
0469 -------------------------------------
0470 
0471 Go through all drivers and add code to request the memory regions that the
0472 driver uses. This requires adding calls to request_mem_region(),
0473 pci_request_region() or similar functions. Use helpers for managed cleanup
0474 where possible.
0475 
0476 Drivers are pretty bad at doing this and there used to be conflicts among
0477 DRM and fbdev drivers. Still, it's the correct thing to do.
0478 
0479 Contact: Thomas Zimmermann <tzimmermann@suse.de>
0480 
0481 Level: Starter
0482 
0483 
0484 Core refactorings
0485 =================
0486 
0487 Make panic handling work
0488 ------------------------
0489 
0490 This is a really varied tasks with lots of little bits and pieces:
0491 
0492 * The panic path can't be tested currently, leading to constant breaking. The
0493   main issue here is that panics can be triggered from hardirq contexts and
0494   hence all panic related callback can run in hardirq context. It would be
0495   awesome if we could test at least the fbdev helper code and driver code by
0496   e.g. trigger calls through drm debugfs files. hardirq context could be
0497   achieved by using an IPI to the local processor.
0498 
0499 * There's a massive confusion of different panic handlers. DRM fbdev emulation
0500   helpers had their own (long removed), but on top of that the fbcon code itself
0501   also has one. We need to make sure that they stop fighting over each other.
0502   This is worked around by checking ``oops_in_progress`` at various entry points
0503   into the DRM fbdev emulation helpers. A much cleaner approach here would be to
0504   switch fbcon to the `threaded printk support
0505   <https://lwn.net/Articles/800946/>`_.
0506 
0507 * ``drm_can_sleep()`` is a mess. It hides real bugs in normal operations and
0508   isn't a full solution for panic paths. We need to make sure that it only
0509   returns true if there's a panic going on for real, and fix up all the
0510   fallout.
0511 
0512 * The panic handler must never sleep, which also means it can't ever
0513   ``mutex_lock()``. Also it can't grab any other lock unconditionally, not
0514   even spinlocks (because NMI and hardirq can panic too). We need to either
0515   make sure to not call such paths, or trylock everything. Really tricky.
0516 
0517 * A clean solution would be an entirely separate panic output support in KMS,
0518   bypassing the current fbcon support. See `[PATCH v2 0/3] drm: Add panic handling
0519   <https://lore.kernel.org/dri-devel/20190311174218.51899-1-noralf@tronnes.org/>`_.
0520 
0521 * Encoding the actual oops and preceding dmesg in a QR might help with the
0522   dread "important stuff scrolled away" problem. See `[RFC][PATCH] Oops messages
0523   transfer using QR codes
0524   <https://lore.kernel.org/lkml/1446217392-11981-1-git-send-email-alexandru.murtaza@intel.com/>`_
0525   for some example code that could be reused.
0526 
0527 Contact: Daniel Vetter
0528 
0529 Level: Advanced
0530 
0531 Clean up the debugfs support
0532 ----------------------------
0533 
0534 There's a bunch of issues with it:
0535 
0536 - The drm_info_list ->show() function doesn't even bother to cast to the drm
0537   structure for you. This is lazy.
0538 
0539 - We probably want to have some support for debugfs files on crtc/connectors and
0540   maybe other kms objects directly in core. There's even drm_print support in
0541   the funcs for these objects to dump kms state, so it's all there. And then the
0542   ->show() functions should obviously give you a pointer to the right object.
0543 
0544 - The drm_info_list stuff is centered on drm_minor instead of drm_device. For
0545   anything we want to print drm_device (or maybe drm_file) is the right thing.
0546 
0547 - The drm_driver->debugfs_init hooks we have is just an artifact of the old
0548   midlayered load sequence. DRM debugfs should work more like sysfs, where you
0549   can create properties/files for an object anytime you want, and the core
0550   takes care of publishing/unpuplishing all the files at register/unregister
0551   time. Drivers shouldn't need to worry about these technicalities, and fixing
0552   this (together with the drm_minor->drm_device move) would allow us to remove
0553   debugfs_init.
0554 
0555 Previous RFC that hasn't landed yet: https://lore.kernel.org/dri-devel/20200513114130.28641-2-wambui.karugax@gmail.com/
0556 
0557 Contact: Daniel Vetter
0558 
0559 Level: Intermediate
0560 
0561 Object lifetime fixes
0562 ---------------------
0563 
0564 There's two related issues here
0565 
0566 - Cleanup up the various ->destroy callbacks, which often are all the same
0567   simple code.
0568 
0569 - Lots of drivers erroneously allocate DRM modeset objects using devm_kzalloc,
0570   which results in use-after free issues on driver unload. This can be serious
0571   trouble even for drivers for hardware integrated on the SoC due to
0572   EPROBE_DEFERRED backoff.
0573 
0574 Both these problems can be solved by switching over to drmm_kzalloc(), and the
0575 various convenience wrappers provided, e.g. drmm_crtc_alloc_with_planes(),
0576 drmm_universal_plane_alloc(), ... and so on.
0577 
0578 Contact: Daniel Vetter
0579 
0580 Level: Intermediate
0581 
0582 Remove automatic page mapping from dma-buf importing
0583 ----------------------------------------------------
0584 
0585 When importing dma-bufs, the dma-buf and PRIME frameworks automatically map
0586 imported pages into the importer's DMA area. drm_gem_prime_fd_to_handle() and
0587 drm_gem_prime_handle_to_fd() require that importers call dma_buf_attach()
0588 even if they never do actual device DMA, but only CPU access through
0589 dma_buf_vmap(). This is a problem for USB devices, which do not support DMA
0590 operations.
0591 
0592 To fix the issue, automatic page mappings should be removed from the
0593 buffer-sharing code. Fixing this is a bit more involved, since the import/export
0594 cache is also tied to &drm_gem_object.import_attach. Meanwhile we paper over
0595 this problem for USB devices by fishing out the USB host controller device, as
0596 long as that supports DMA. Otherwise importing can still needlessly fail.
0597 
0598 Contact: Thomas Zimmermann <tzimmermann@suse.de>, Daniel Vetter
0599 
0600 Level: Advanced
0601 
0602 
0603 Better Testing
0604 ==============
0605 
0606 Add unit tests using the Kernel Unit Testing (KUnit) framework
0607 --------------------------------------------------------------
0608 
0609 The `KUnit <https://www.kernel.org/doc/html/latest/dev-tools/kunit/index.html>`_
0610 provides a common framework for unit tests within the Linux kernel. Having a
0611 test suite would allow to identify regressions earlier.
0612 
0613 A good candidate for the first unit tests are the format-conversion helpers in
0614 ``drm_format_helper.c``.
0615 
0616 Contact: Javier Martinez Canillas <javierm@redhat.com>
0617 
0618 Level: Intermediate
0619 
0620 Convert Kernel Selftests (kselftest) to KUnit tests when appropriate
0621 --------------------------------------------------------------------
0622 
0623 Many of the `Kselftest <https://www.kernel.org/doc/html/latest/dev-tools/kselftest.html>`_
0624 tests in DRM could be converted to Kunit tests instead, since that framework
0625 is more suitable for unit testing.
0626 
0627 Contact: Javier Martinez Canillas <javierm@redhat.com>
0628 
0629 Level: Starter
0630 
0631 Enable trinity for DRM
0632 ----------------------
0633 
0634 And fix up the fallout. Should be really interesting ...
0635 
0636 Level: Advanced
0637 
0638 Make KMS tests in i-g-t generic
0639 -------------------------------
0640 
0641 The i915 driver team maintains an extensive testsuite for the i915 DRM driver,
0642 including tons of testcases for corner-cases in the modesetting API. It would
0643 be awesome if those tests (at least the ones not relying on Intel-specific GEM
0644 features) could be made to run on any KMS driver.
0645 
0646 Basic work to run i-g-t tests on non-i915 is done, what's now missing is mass-
0647 converting things over. For modeset tests we also first need a bit of
0648 infrastructure to use dumb buffers for untiled buffers, to be able to run all
0649 the non-i915 specific modeset tests.
0650 
0651 Level: Advanced
0652 
0653 Extend virtual test driver (VKMS)
0654 ---------------------------------
0655 
0656 See the documentation of :ref:`VKMS <vkms>` for more details. This is an ideal
0657 internship task, since it only requires a virtual machine and can be sized to
0658 fit the available time.
0659 
0660 Level: See details
0661 
0662 Backlight Refactoring
0663 ---------------------
0664 
0665 Backlight drivers have a triple enable/disable state, which is a bit overkill.
0666 Plan to fix this:
0667 
0668 1. Roll out backlight_enable() and backlight_disable() helpers everywhere. This
0669    has started already.
0670 2. In all, only look at one of the three status bits set by the above helpers.
0671 3. Remove the other two status bits.
0672 
0673 Contact: Daniel Vetter
0674 
0675 Level: Intermediate
0676 
0677 Driver Specific
0678 ===============
0679 
0680 AMD DC Display Driver
0681 ---------------------
0682 
0683 AMD DC is the display driver for AMD devices starting with Vega. There has been
0684 a bunch of progress cleaning it up but there's still plenty of work to be done.
0685 
0686 See drivers/gpu/drm/amd/display/TODO for tasks.
0687 
0688 Contact: Harry Wentland, Alex Deucher
0689 
0690 vmwgfx: Replace hashtable with Linux' implementation
0691 ----------------------------------------------------
0692 
0693 The vmwgfx driver uses its own hashtable implementation. Replace the
0694 code with Linux' implementation and update the callers. It's mostly a
0695 refactoring task, but the interfaces are different.
0696 
0697 Contact: Zack Rusin, Thomas Zimmermann <tzimmermann@suse.de>
0698 
0699 Level: Intermediate
0700 
0701 Bootsplash
0702 ==========
0703 
0704 There is support in place now for writing internal DRM clients making it
0705 possible to pick up the bootsplash work that was rejected because it was written
0706 for fbdev.
0707 
0708 - [v6,8/8] drm/client: Hack: Add bootsplash example
0709   https://patchwork.freedesktop.org/patch/306579/
0710 
0711 - [RFC PATCH v2 00/13] Kernel based bootsplash
0712   https://lore.kernel.org/r/20171213194755.3409-1-mstaudt@suse.de
0713 
0714 Contact: Sam Ravnborg
0715 
0716 Level: Advanced
0717 
0718 Outside DRM
0719 ===========
0720 
0721 Convert fbdev drivers to DRM
0722 ----------------------------
0723 
0724 There are plenty of fbdev drivers for older hardware. Some hardware has
0725 become obsolete, but some still provides good(-enough) framebuffers. The
0726 drivers that are still useful should be converted to DRM and afterwards
0727 removed from fbdev.
0728 
0729 Very simple fbdev drivers can best be converted by starting with a new
0730 DRM driver. Simple KMS helpers and SHMEM should be able to handle any
0731 existing hardware. The new driver's call-back functions are filled from
0732 existing fbdev code.
0733 
0734 More complex fbdev drivers can be refactored step-by-step into a DRM
0735 driver with the help of the DRM fbconv helpers. [1] These helpers provide
0736 the transition layer between the DRM core infrastructure and the fbdev
0737 driver interface. Create a new DRM driver on top of the fbconv helpers,
0738 copy over the fbdev driver, and hook it up to the DRM code. Examples for
0739 several fbdev drivers are available at [1] and a tutorial of this process
0740 available at [2]. The result is a primitive DRM driver that can run X11
0741 and Weston.
0742 
0743  - [1] https://gitlab.freedesktop.org/tzimmermann/linux/tree/fbconv
0744  - [2] https://gitlab.freedesktop.org/tzimmermann/linux/blob/fbconv/drivers/gpu/drm/drm_fbconv_helper.c
0745 
0746 Contact: Thomas Zimmermann <tzimmermann@suse.de>
0747 
0748 Level: Advanced