linux-stable/include/drm
Arunpravin afea229fe1 drm: improve drm_buddy_alloc function
- Make drm_buddy_alloc a single function to handle
  range allocation and non-range allocation demands

- Implemented a new function alloc_range() which allocates
  the requested power-of-two block comply with range limitations

- Moved order computation and memory alignment logic from
  i915 driver to drm buddy

v2:
  merged below changes to keep the build unbroken
   - drm_buddy_alloc_range() becomes obsolete and may be removed
   - enable ttm range allocation (fpfn / lpfn) support in i915 driver
   - apply enhanced drm_buddy_alloc() function to i915 driver

v3(Matthew Auld):
  - Fix alignment issues and remove unnecessary list_empty check
  - add more validation checks for input arguments
  - make alloc_range() block allocations as bottom-up
  - optimize order computation logic
  - replace uint64_t with u64, which is preferred in the kernel

v4(Matthew Auld):
  - keep drm_buddy_alloc_range() function implementation for generic
    actual range allocations
  - keep alloc_range() implementation for end bias allocations

v5(Matthew Auld):
  - modify drm_buddy_alloc() passing argument place->lpfn to lpfn
    as place->lpfn will currently always be zero for i915

v6(Matthew Auld):
  - fixup potential uaf - If we are unlucky and can't allocate
    enough memory when splitting blocks, where we temporarily
    end up with the given block and its buddy on the respective
    free list, then we need to ensure we delete both blocks,
    and no just the buddy, before potentially freeing them

  - fix warnings reported by kernel test robot <lkp@intel.com>

v7(Matthew Auld):
  - revert fixup potential uaf
  - keep __alloc_range() add node to the list logic same as
    drm_buddy_alloc_blocks() by having a temporary list variable
  - at drm_buddy_alloc_blocks() keep i915 range_overflows macro
    and add a new check for end variable

v8:
  - fix warnings reported by kernel test robot <lkp@intel.com>

v9(Matthew Auld):
  - remove DRM_BUDDY_RANGE_ALLOCATION flag
  - remove unnecessary function description

v10:
   - keep DRM_BUDDY_RANGE_ALLOCATION flag as removing the flag
     and replacing with (end < size) logic fails amdgpu driver load

Signed-off-by: Arunpravin <Arunpravin.PaneerSelvam@amd.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220221164552.2434-1-Arunpravin.PaneerSelvam@amd.com
2022-02-22 12:54:41 +01:00
..
bridge drm/bridge/synopsys: dsi: extend the prototype of mode_valid() 2022-01-04 12:53:59 +01:00
dp drm-misc-next for v5.18: 2022-02-01 19:02:41 +10:00
i2c
ttm drm/ttm: add common accounting to the resource mgr v3 2022-02-14 14:35:09 +01:00
amd_asic_type.h drm/amdgpu: add new asic_type for IP discovery 2021-10-04 15:23:01 -04:00
drm_aperture.h drm/aperture: Pass DRM driver structure instead of driver name 2021-07-01 11:11:55 +02:00
drm_atomic.h drm: fix doc warnings in drm_atomic.h 2021-06-04 12:40:01 -04:00
drm_atomic_helper.h drm: automatic legacy gamma support 2020-12-15 15:46:03 +02:00
drm_atomic_state_helper.h
drm_atomic_uapi.h
drm_audio_component.h ALSA: hda/i915 - fix list corruption with concurrent probes 2020-10-09 16:46:04 +02:00
drm_auth.h drm: clarify usage of drm leases 2021-07-29 09:12:01 +02:00
drm_blend.h
drm_bridge.h drm: Plumb debugfs_init through to panels 2022-02-15 15:25:18 -08:00
drm_bridge_connector.h
drm_buddy.h drm: improve drm_buddy_alloc function 2022-02-22 12:54:41 +01:00
drm_cache.h drm: Add a prefetching memcpy_from_wc 2021-06-07 16:07:08 +02:00
drm_client.h drm/gem: Store client buffer mappings as struct dma_buf_map 2020-11-09 09:19:45 +01:00
drm_color_mgmt.h
drm_connector.h drm: Plumb debugfs_init through to panels 2022-02-15 15:25:18 -08:00
drm_crtc.h drm/docs: Document where the C8 color lut is stored 2022-01-25 09:36:20 +01:00
drm_crtc_helper.h
drm_damage_helper.h drm/plane: Move drm_plane_enable_fb_damage_clips into core 2021-07-27 12:21:22 +02:00
drm_debugfs.h
drm_debugfs_crc.h
drm_device.h drm: Declare hashtable as legacy 2021-11-30 09:41:28 +01:00
drm_displayid.h drm/edid: parse the DisplayID v2.0 VESA vendor block for MSO 2021-09-14 14:21:53 +03:00
drm_drv.h drm: Return error codes from struct drm_driver.gem_create_object 2021-12-02 11:12:39 +01:00
drm_dsc.h drm/dp: Move public DisplayPort headers into dp/ 2022-01-17 11:25:44 +01:00
drm_edid.h drm/edid: Rename drm_hdmi_avi_infoframe_colorspace to _colorimetry 2022-01-25 10:00:13 +01:00
drm_encoder.h drm/encoder: Add macro drmm_plain_encoder_alloc() 2021-03-29 16:46:43 +01:00
drm_encoder_slave.h
drm_fb_cma_helper.h drm: Add and export function drm_fb_cma_sync_non_coherent 2021-05-25 11:42:09 +01:00
drm_fb_helper.h drm/aperture: Inline fbdev conflict helpers into aperture helpers 2021-04-14 09:00:04 +02:00
drm_file.h drm: add lockdep assert to drm_is_current_master_locked 2021-08-05 12:08:15 +02:00
drm_fixed.h
drm_flip_work.h
drm_format_helper.h drm/format-helper: Add drm_fb_xrgb8888_to_mono_reversed() 2022-02-16 13:29:04 +01:00
drm_fourcc.h drm: Define DRM_FORMAT_MAX_PLANES 2021-08-02 16:41:20 +02:00
drm_framebuffer.h drm: Define DRM_FORMAT_MAX_PLANES 2021-08-02 16:41:20 +02:00
drm_gem.h drm: Drop drm_gem_object_put_locked() 2021-07-27 18:09:18 -07:00
drm_gem_atomic_helper.h drm/simpledrm: Support virtual screen sizes 2021-11-11 12:06:58 +01:00
drm_gem_cma_helper.h drm/cma-helper: Pass GEM CMA object in public interfaces 2021-11-30 09:49:58 +01:00
drm_gem_framebuffer_helper.h drm/gem: Provide offset-adjusted framebuffer BO mappings 2021-08-08 20:26:16 +02:00
drm_gem_shmem_helper.h drm/gem-shmem: Set vm_ops in static initializer 2022-02-14 09:42:01 +01:00
drm_gem_ttm_helper.h drm: Replace kernel.h with the necessary inclusions 2021-12-09 13:46:13 +01:00
drm_gem_vram_helper.h drm: Replace kernel.h with the necessary inclusions 2021-12-09 13:46:13 +01:00
drm_hdcp.h drm/hdcp: DP HDCP2.2 errata LC_Send_L_Prime=16 2021-03-31 14:27:43 +03:00
drm_ioctl.h drm: unexport drm_ioctl_permit 2021-08-13 17:50:48 +02:00
drm_lease.h
drm_legacy.h drm: Declare hashtable as legacy 2021-11-30 09:41:28 +01:00
drm_managed.h drm: Remove drmm_add_final_kfree() declaration from public headers 2020-12-05 20:01:12 +01:00
drm_mipi_dbi.h drm/dbi: Use a static inline stub for mipi_dbi_debugfs_init() 2021-12-22 22:41:01 +02:00
drm_mipi_dsi.h drm/mipi-dsi: Create devm device attachment 2021-09-24 19:25:33 +02:00
drm_mm.h drm: Replace kernel.h with the necessary inclusions 2021-12-09 13:46:13 +01:00
drm_mode_config.h drm: remove allow_fb_modifiers 2022-01-31 21:45:24 +01:00
drm_mode_object.h
drm_modes.h drm/modes: add non-OF stub for of_get_drm_display_mode 2021-01-08 19:42:14 +01:00
drm_modeset_helper.h
drm_modeset_helper_vtables.h drm/atomic-helper: make drm_gem_plane_helper_prepare_fb the default 2021-06-24 15:35:13 +02:00
drm_modeset_lock.h drm/locking: fix drm_modeset_acquire_ctx kernel-doc 2022-01-20 14:41:25 +02:00
drm_module.h drm: Provide platform module-init macro 2022-01-19 18:40:18 +01:00
drm_of.h drm: of: Add drm_of_lvds_get_data_mapping 2021-10-14 20:47:30 +02:00
drm_panel.h drm: Plumb debugfs_init through to panels 2022-02-15 15:25:18 -08:00
drm_pciids.h
drm_plane.h drm: add support modifiers for drivers whose planes only support linear layout 2022-01-31 21:45:24 +01:00
drm_plane_helper.h
drm_prime.h drm/prime: split array import functions v4 2020-11-30 15:00:45 +01:00
drm_print.h drm/print: Add deprecation notes to DRM_...() functions 2021-09-24 14:56:56 -07:00
drm_privacy_screen_consumer.h drm/privacy-screen: Add notifier support (v2) 2021-10-14 13:12:25 +02:00
drm_privacy_screen_driver.h drm/privacy_screen: Add drvdata in drm_privacy_screen 2022-01-10 12:17:37 +01:00
drm_privacy_screen_machine.h drm/privacy-screen: Add X86 specific arch init code 2021-10-14 13:12:24 +02:00
drm_probe_helper.h drm/probe-helper: add drm_kms_helper_connector_hotplug_event 2021-11-02 14:27:10 +01:00
drm_property.h drm: document drm_property_enum.value for bitfields 2021-07-26 10:08:22 +02:00
drm_rect.h drm/plane: remove drm_helper_get_plane_damage_clips 2021-07-27 12:21:22 +02:00
drm_scdc_helper.h
drm_self_refresh_helper.h
drm_simple_kms_helper.h drm/simple-kms: Support custom CRTC state 2021-08-08 20:14:08 +02:00
drm_syncobj.h
drm_sysfs.h drm/sysfs: introduce drm_sysfs_connector_hotplug_event 2021-11-02 14:27:06 +01:00
drm_util.h
drm_utils.h
drm_vblank.h drm/vblank: Document drm_crtc_vblank_restore constraints 2021-02-10 12:38:55 +01:00
drm_vblank_work.h
drm_vma_manager.h drm/vma: Add a driver_private member to vma_node. 2021-06-11 10:53:18 +02:00
drm_writeback.h
gma_drm.h
gpu_scheduler.h drm/sched: Avoid lockdep spalt on killing a processes 2021-11-01 11:08:21 -04:00
gud.h drm/gud: Add GUD_PIXEL_FORMAT_RGB888 2021-10-04 12:06:14 +02:00
i915_component.h drm/i915/pxp: Define PXP component interface 2021-10-04 13:09:53 -04:00
i915_drm.h
i915_mei_hdcp_interface.h
i915_pciids.h drm/i915/rpl-s: Add PCI IDS for Raptor Lake S 2021-12-08 13:02:54 -08:00
i915_pxp_tee_interface.h drm/i915/pxp: Define PXP component interface 2021-10-04 13:09:53 -04:00
intel-gtt.h agp/intel-gtt: reduce intel-gtt dependencies more 2021-11-15 19:20:14 +02:00
intel_lpe_audio.h
spsc_queue.h
task_barrier.h