Merge tag 'drm-next-2023-04-24' of git://anongit.freedesktop.org/drm/drm

Pull drm updates from Dave Airlie:
 "There is a new Qualcomm accel driver for their QAIC, dma-fence got a
  deadline feature added, lots of refactoring around fbdev emulation,
  and the usual pre-release hw enablements from AMD and Intel and fixes
  everywhere.

  New drivers:
   - add QAIC acceleration driver

  dma-buf:
   - constify kobj_type structs
   - Reject prime DMA-Buf attachment if get_sg_table is missing.

  fbdev:
   - cmdline parser fixes
   - implement fbdev emulation for GEM DMA drivers
   - always use shadow buffer in fbdev emulation helpers

  dma-fence:
   - add deadline hint to fences
   - signal private stub fence

  core:
   - improve DisplayID 2.0 and EDID parsing
   - add gem eviction function + callback
   - prep to convert shmem helper to GEM resv lock
   - move suballocator from radeon/amdgpu to core for Xe
   - HPD polling fixes
   - Documentation improvements
   - Add atomic enable_plane callback
   - use tgid instead of pid for client tracking
   - DP: Add SDP Error Detection Configuration Register
   - Add prime import/export to vram-helper
   - use pci aperture helpers in more drivers

  panel:
   - Radxa 8/10HD support
   - Samsung AMD495QA01 support
   - Elida KD50T048A
   - Sony TD4353
   - Novatek NT36523
   - STARRY 2081101QFH032011-53G
   - B133UAN01.0
   - AUO NE135FBM-N41

  i915:
   - More MTL enabling
   - fix s/r problems with MEI/PXP
   - Implement fb_dirty for PSR,FBC,DRRS fixes
   - Fix eDP+DSI dual panel systems
   - Fix issue #6333: "list_add corruption" and full system lockup from
     performance monitoring
   - Don't use stolen memory or BAR for ring buffers on LLC platforms
   - Make sure DSM size has correct 1MiB granularity on Gen12+
   - Whitelist COMMON_SLICE_CHICKEN3 for UMD access on Gen12+
   - Add engine TLB invalidation for Meteorlake
   - Fix GSC races on driver load/unload on Meteorlake+
   - Make kobj_type structures constant
   - Move fd_install after last use of fence
   - wm/vblank refactoring
   - display code refactoring
   - Create GSC submission targeting HDCP and PXP usages on MTL+
   - Enable HDCP2.x via GSC CS
   - Fix context runtime accounting on sysfs fdinfo for heavy workloads
   - Use i915 instead of dev_priv insied the file_priv structure
   - Replace fake flex-array with flexible-array member

  amdgpu:
   - Make kobj structures const
   - Generalize dmabuf import to work with KFD
   - Add capped/uncapped workload handling for supported APUs
   - Expose additional memory stats via fdinfo
   - Register vga_switcheroo for apple-gmux
   - Initial NBIO7.9, GC 9.4.3, GFXHUB 1.2, MMHUB 1.8 support
   - Initial DC FAM infrastructure
   - Link DC backlight to connector device rather than PCI device
   - Add sysfs nodes for secondary VCN clocks

  amdkfd:
   - Make kobj structures const
   - Support for exporting buffers via dmabuf
   - Multi-VMA page migration fixes
   - initial GC 9.4.3 support

  radeon:
   - iMac fix
   - convert to client based fbdev emulation

  habanalabs:
   - Add opcodes to the CS ioctl to allow user to stall/resume specific
     engines inside Gaudi2.
   - INFO ioctl the amount of device memory that the driver and f/w
     reserve for themselves.
   - INFO ioctl a bit-mask of the available rotator engines
   - INFO ioctl the register's address of the f/w that should be used to
     trigger interrupts
   - INFO ioctl two new opcodes to fetch information on h/w and f/w
     events
   - Enable graceful reset mechanism for compute-reset.
   - Align to the latest firmware specs.
   - Enforce the release order of the compute device and dma-buf.

  msm:
   - UBWC decoder programming rework
   - SM8550, SM8450 bindings update
   - uapi C++ fix
   - a3xx and a4xx devfreq support
   - GPU and GEM updates to avoid allocations which could trigger
     reclaim (shrinker) in fence signaling path
   - dma-fence deadline hint support and wait-boost
   - a640/650 speed bin support

  cirrus:
   - convert to regular atomic helpers
   - add damage clipping

  mediatek:
   - 10-bit overlay support
   - mt8195 support
   - Only trigger DRM HPD events if bridge is attached
   - Change the aux retries times when receiving AUX_DEFER

  rockchip:
   - add 4K support

  vc4:
   - use drm_gem_objects

  virtio:
   - allow KMS support to be disabled
   - add damage clipping

  vmwgfx:
   - buffer object lifetime fixes

  exynos:
   - move MIPI DSI driver to drm bridge for iMX sharing
   - use kernel fbdev emulation

  panfrost:
   - add support for mali MT81xx devices
   - add speed binning support

  lima:
   - add usage stats

  tegra:
   - fbdev client conversion

  vkms:
   - Add primary plane positioning support"

* tag 'drm-next-2023-04-24' of git://anongit.freedesktop.org/drm/drm: (1495 commits)
  drm/i915/dp_mst: Fix active port PLL selection for secondary MST streams
  drm/exynos: Implement fbdev emulation as in-kernel client
  drm/exynos: Initialize fbdev DRM client
  drm/exynos: Remove fb_helper from struct exynos_drm_private
  drm/exynos: Remove struct exynos_drm_fbdev
  drm/exynos: Remove exynos_gem from struct exynos_drm_fbdev
  drm/i915: Fix memory leaks in i915 selftests
  drm/i915: Make intel_get_crtc_new_encoder() less oopsy
  drm/i915/gt: Avoid out-of-bounds access when loading HuC
  drm/amdgpu: add some basic elements for multiple XCD case
  drm/amdgpu: move vmhub out of amdgpu_ring_funcs (v4)
  Revert "drm/amdgpu: enable ras for mp0 v13_0_10 on SRIOV"
  drm/amdgpu: add common ip block for GC 9.4.3
  drm/amd/display: Add logging when DP link training Clock recovery is Successful
  drm/amdgpu: add common early init support for GC 9.4.3
  drm/amdgpu: switch to v9_4_3 gfx_funcs callbacks for GC 9.4.3
  drm/amd/display: Add logging when setting DP sink power state fails
  drm/amdkfd: Add gfx_target_version for GC 9.4.3
  drm/amdkfd: Enable HW_UPDATE_RPTR on GC 9.4.3
  drm/amdgpu: reserve the old gc_11_0_*_mes.bin
  ...
This commit is contained in:
Linus Torvalds
2023-04-25 16:12:15 -07:00
1192 changed files with 183422 additions and 30711 deletions

View File

@@ -0,0 +1,115 @@
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Copyright (C) 2022 Amarula Solutions(India)
* Author: Jagan Teki <jagan@amarulasolutions.com>
*/
#ifndef __SAMSUNG_DSIM__
#define __SAMSUNG_DSIM__
#include <linux/gpio/consumer.h>
#include <linux/regulator/consumer.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_of.h>
#include <drm/drm_mipi_dsi.h>
struct samsung_dsim;
#define DSIM_STATE_ENABLED BIT(0)
#define DSIM_STATE_INITIALIZED BIT(1)
#define DSIM_STATE_CMD_LPM BIT(2)
#define DSIM_STATE_VIDOUT_AVAILABLE BIT(3)
enum samsung_dsim_type {
DSIM_TYPE_EXYNOS3250,
DSIM_TYPE_EXYNOS4210,
DSIM_TYPE_EXYNOS5410,
DSIM_TYPE_EXYNOS5422,
DSIM_TYPE_EXYNOS5433,
DSIM_TYPE_IMX8MM,
DSIM_TYPE_IMX8MP,
DSIM_TYPE_COUNT,
};
#define samsung_dsim_hw_is_exynos(hw) \
((hw) >= DSIM_TYPE_EXYNOS3250 && (hw) <= DSIM_TYPE_EXYNOS5433)
struct samsung_dsim_transfer {
struct list_head list;
struct completion completed;
int result;
struct mipi_dsi_packet packet;
u16 flags;
u16 tx_done;
u8 *rx_payload;
u16 rx_len;
u16 rx_done;
};
struct samsung_dsim_driver_data {
const unsigned int *reg_ofs;
unsigned int plltmr_reg;
unsigned int has_freqband:1;
unsigned int has_clklane_stop:1;
unsigned int num_clks;
unsigned int max_freq;
unsigned int wait_for_reset;
unsigned int num_bits_resol;
unsigned int pll_p_offset;
const unsigned int *reg_values;
};
struct samsung_dsim_host_ops {
int (*register_host)(struct samsung_dsim *dsim);
void (*unregister_host)(struct samsung_dsim *dsim);
int (*attach)(struct samsung_dsim *dsim, struct mipi_dsi_device *device);
void (*detach)(struct samsung_dsim *dsim, struct mipi_dsi_device *device);
irqreturn_t (*te_irq_handler)(struct samsung_dsim *dsim);
};
struct samsung_dsim_plat_data {
enum samsung_dsim_type hw_type;
const struct samsung_dsim_host_ops *host_ops;
};
struct samsung_dsim {
struct mipi_dsi_host dsi_host;
struct drm_bridge bridge;
struct drm_bridge *out_bridge;
struct device *dev;
struct drm_display_mode mode;
void __iomem *reg_base;
struct phy *phy;
struct clk **clks;
struct regulator_bulk_data supplies[2];
int irq;
struct gpio_desc *te_gpio;
u32 pll_clk_rate;
u32 burst_clk_rate;
u32 esc_clk_rate;
u32 lanes;
u32 mode_flags;
u32 format;
int state;
struct drm_property *brightness;
struct completion completed;
spinlock_t transfer_lock; /* protects transfer_list */
struct list_head transfer_list;
const struct samsung_dsim_driver_data *driver_data;
const struct samsung_dsim_plat_data *plat_data;
void *priv;
};
extern int samsung_dsim_probe(struct platform_device *pdev);
extern int samsung_dsim_remove(struct platform_device *pdev);
extern const struct dev_pm_ops samsung_dsim_pm_ops;
#endif /* __SAMSUNG_DSIM__ */

View File

@@ -692,6 +692,9 @@
# define DP_FEC_LANE_2_SELECT (2 << 4)
# define DP_FEC_LANE_3_SELECT (3 << 4)
#define DP_SDP_ERROR_DETECTION_CONFIGURATION 0x121 /* DP 2.0 E11 */
#define DP_SDP_CRC16_128B132B_EN BIT(0)
#define DP_AUX_FRAME_SYNC_VALUE 0x15c /* eDP 1.4 */
# define DP_AUX_FRAME_SYNC_VALID (1 << 0)

View File

@@ -194,6 +194,19 @@ drm_dp_dsc_sink_max_slice_width(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE])
DP_DSC_SLICE_WIDTH_MULTIPLIER;
}
/**
* drm_dp_dsc_sink_supports_format() - check if sink supports DSC with given output format
* @dsc_dpcd : DSC-capability DPCDs of the sink
* @output_format: output_format which is to be checked
*
* Returns true if the sink supports DSC with the given output_format, false otherwise.
*/
static inline bool
drm_dp_dsc_sink_supports_format(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE], u8 output_format)
{
return dsc_dpcd[DP_DSC_DEC_COLOR_FORMAT_CAP - DP_DSC_SUPPORT] & output_format;
}
/* Forward Error Correction Support on DP 1.4 */
static inline bool
drm_dp_sink_supports_fec(const u8 fec_capable)

View File

@@ -28,6 +28,7 @@
#include <drm/display/drm_scdc.h>
struct drm_connector;
struct i2c_adapter;
ssize_t drm_scdc_read(struct i2c_adapter *adapter, u8 offset, void *buffer,
@@ -71,9 +72,9 @@ static inline int drm_scdc_writeb(struct i2c_adapter *adapter, u8 offset,
return drm_scdc_write(adapter, offset, &value, sizeof(value));
}
bool drm_scdc_get_scrambling_status(struct i2c_adapter *adapter);
bool drm_scdc_get_scrambling_status(struct drm_connector *connector);
bool drm_scdc_set_scrambling(struct i2c_adapter *adapter, bool enable);
bool drm_scdc_set_high_tmds_clock_ratio(struct i2c_adapter *adapter, bool set);
bool drm_scdc_set_scrambling(struct drm_connector *connector, bool enable);
bool drm_scdc_set_high_tmds_clock_ratio(struct drm_connector *connector, bool set);
#endif

View File

@@ -528,6 +528,13 @@ struct drm_connector *
drm_atomic_get_new_connector_for_encoder(const struct drm_atomic_state *state,
struct drm_encoder *encoder);
struct drm_crtc *
drm_atomic_get_old_crtc_for_encoder(struct drm_atomic_state *state,
struct drm_encoder *encoder);
struct drm_crtc *
drm_atomic_get_new_crtc_for_encoder(struct drm_atomic_state *state,
struct drm_encoder *encoder);
/**
* drm_atomic_get_existing_crtc_state - get CRTC state, if it exists
* @state: global atomic state object

View File

@@ -209,6 +209,32 @@ int drm_atomic_helper_page_flip_target(
__drm_atomic_get_current_plane_state((crtc_state)->state, \
plane)))
/**
* drm_atomic_plane_enabling - check whether a plane is being enabled
* @old_plane_state: old atomic plane state
* @new_plane_state: new atomic plane state
*
* Checks the atomic state of a plane to determine whether it's being enabled
* or not. This also WARNs if it detects an invalid state (both CRTC and FB
* need to either both be NULL or both be non-NULL).
*
* RETURNS:
* True if the plane is being enabled, false otherwise.
*/
static inline bool drm_atomic_plane_enabling(struct drm_plane_state *old_plane_state,
struct drm_plane_state *new_plane_state)
{
/*
* When enabling a plane, CRTC and FB should always be set together.
* Anything else should be considered a bug in the atomic core, so we
* gently warn about it.
*/
WARN_ON((!new_plane_state->crtc && new_plane_state->fb) ||
(new_plane_state->crtc && !new_plane_state->fb));
return !old_plane_state->crtc && new_plane_state->crtc;
}
/**
* drm_atomic_plane_disabling - check whether a plane is being disabled
* @old_plane_state: old atomic plane state

View File

@@ -139,7 +139,11 @@ struct displayid_vesa_vendor_specific_block {
u8 mso;
} __packed;
/* DisplayID iteration */
/*
* DisplayID iteration.
*
* Do not access directly, this is private.
*/
struct displayid_iter {
const struct drm_edid *drm_edid;
@@ -147,6 +151,9 @@ struct displayid_iter {
int length;
int idx;
int ext_index;
u8 version;
u8 primary_use;
};
void displayid_iter_edid_begin(const struct drm_edid *drm_edid,
@@ -157,4 +164,7 @@ __displayid_iter_next(struct displayid_iter *iter);
while (((__block) = __displayid_iter_next(__iter)))
void displayid_iter_end(struct displayid_iter *iter);
u8 displayid_version(const struct displayid_iter *iter);
u8 displayid_primary_use(const struct displayid_iter *iter);
#endif

View File

@@ -400,25 +400,6 @@ struct drm_driver {
int (*dumb_map_offset)(struct drm_file *file_priv,
struct drm_device *dev, uint32_t handle,
uint64_t *offset);
/**
* @dumb_destroy:
*
* This destroys the userspace handle for the given dumb backing storage buffer.
* Since buffer objects must be reference counted in the kernel a buffer object
* won't be immediately freed if a framebuffer modeset object still uses it.
*
* Called by the user via ioctl.
*
* The default implementation is drm_gem_dumb_destroy(). GEM based drivers
* must not overwrite this.
*
* Returns:
*
* Zero on success, negative errno on failure.
*/
int (*dumb_destroy)(struct drm_file *file_priv,
struct drm_device *dev,
uint32_t handle);
/** @major: driver major number */
int major;
@@ -603,8 +584,6 @@ static inline bool drm_drv_uses_atomic_modeset(struct drm_device *dev)
}
int drm_dev_set_unique(struct drm_device *dev, const char *name);
/* TODO: Inline drm_firmware_drivers_only() in all its callers. */
static inline bool drm_firmware_drivers_only(void)
{

View File

@@ -61,9 +61,15 @@ struct std_timing {
u8 vfreq_aspect;
} __attribute__((packed));
#define DRM_EDID_PT_HSYNC_POSITIVE (1 << 1)
#define DRM_EDID_PT_VSYNC_POSITIVE (1 << 2)
#define DRM_EDID_PT_SEPARATE_SYNC (3 << 3)
#define DRM_EDID_PT_SYNC_MASK (3 << 3)
# define DRM_EDID_PT_ANALOG_CSYNC (0 << 3)
# define DRM_EDID_PT_BIPOLAR_ANALOG_CSYNC (1 << 3)
# define DRM_EDID_PT_DIGITAL_CSYNC (2 << 3)
# define DRM_EDID_PT_CSYNC_ON_RGB (1 << 1) /* analog csync only */
# define DRM_EDID_PT_CSYNC_SERRATE (1 << 2)
# define DRM_EDID_PT_DIGITAL_SEPARATE_SYNC (3 << 3)
# define DRM_EDID_PT_HSYNC_POSITIVE (1 << 1) /* also digital csync */
# define DRM_EDID_PT_VSYNC_POSITIVE (1 << 2)
#define DRM_EDID_PT_STEREO (1 << 5)
#define DRM_EDID_PT_INTERLACED (1 << 7)

View File

@@ -195,15 +195,6 @@ struct drm_fb_helper {
*/
int preferred_bpp;
/**
* @hint_leak_smem_start:
*
* Hint to the fbdev emulation to store the framebuffer's physical
* address in struct &fb_info.fix.smem_start. If the hint is unset,
* the smem_start field should always be cleared to zero.
*/
bool hint_leak_smem_start;
#ifdef CONFIG_FB_DEFERRED_IO
/**
* @fbdefio:
@@ -256,6 +247,7 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
int drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper);
struct fb_info *drm_fb_helper_alloc_info(struct drm_fb_helper *fb_helper);
void drm_fb_helper_release_info(struct drm_fb_helper *fb_helper);
void drm_fb_helper_unregister_info(struct drm_fb_helper *fb_helper);
void drm_fb_helper_fill_info(struct fb_info *info,
struct drm_fb_helper *fb_helper,
@@ -365,6 +357,10 @@ drm_fb_helper_alloc_info(struct drm_fb_helper *fb_helper)
return NULL;
}
static inline void drm_fb_helper_release_info(struct drm_fb_helper *fb_helper)
{
}
static inline void drm_fb_helper_unregister_info(struct drm_fb_helper *fb_helper)
{
}

View File

@@ -0,0 +1,15 @@
/* SPDX-License-Identifier: MIT */
#ifndef DRM_FBDEV_DMA_H
#define DRM_FBDEV_DMA_H
struct drm_device;
#ifdef CONFIG_DRM_FBDEV_EMULATION
void drm_fbdev_dma_setup(struct drm_device *dev, unsigned int preferred_bpp);
#else
static inline void drm_fbdev_dma_setup(struct drm_device *dev, unsigned int preferred_bpp)
{ }
#endif
#endif

View File

@@ -408,7 +408,8 @@ static inline bool drm_is_render_client(const struct drm_file *file_priv)
* Returns true if this is an open file of the compute acceleration node, i.e.
* &drm_file.minor of @file_priv is a accel minor.
*
* See also the :ref:`section on accel nodes <drm_accel_node>`.
* See also :doc:`Introduction to compute accelerators subsystem
* </accel/introduction>`.
*/
static inline bool drm_is_accel_client(const struct drm_file *file_priv)
{

View File

@@ -164,6 +164,16 @@ struct drm_gem_object_funcs {
*/
int (*mmap)(struct drm_gem_object *obj, struct vm_area_struct *vma);
/**
* @evict:
*
* Evicts gem object out from memory. Used by the drm_gem_object_evict()
* helper. Returns 0 on success, -errno otherwise.
*
* This callback is optional.
*/
int (*evict)(struct drm_gem_object *obj);
/**
* @vm_ops:
*
@@ -475,10 +485,13 @@ int drm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
void drm_gem_lru_init(struct drm_gem_lru *lru, struct mutex *lock);
void drm_gem_lru_remove(struct drm_gem_object *obj);
void drm_gem_lru_move_tail_locked(struct drm_gem_lru *lru, struct drm_gem_object *obj);
void drm_gem_lru_move_tail(struct drm_gem_lru *lru, struct drm_gem_object *obj);
unsigned long drm_gem_lru_scan(struct drm_gem_lru *lru,
unsigned int nr_to_scan,
unsigned long *remaining,
bool (*shrink)(struct drm_gem_object *obj));
int drm_gem_evict(struct drm_gem_object *obj);
#endif /* __DRM_GEM_H__ */

View File

@@ -60,20 +60,6 @@ struct drm_gem_shmem_object {
*/
struct list_head madv_list;
/**
* @pages_mark_dirty_on_put:
*
* Mark pages as dirty when they are put.
*/
unsigned int pages_mark_dirty_on_put : 1;
/**
* @pages_mark_accessed_on_put:
*
* Mark pages as accessed when they are put.
*/
unsigned int pages_mark_accessed_on_put : 1;
/**
* @sgt: Scatter/gather table for imported PRIME buffers
*/
@@ -97,10 +83,24 @@ struct drm_gem_shmem_object {
*/
unsigned int vmap_use_count;
/**
* @pages_mark_dirty_on_put:
*
* Mark pages as dirty when they are put.
*/
bool pages_mark_dirty_on_put : 1;
/**
* @pages_mark_accessed_on_put:
*
* Mark pages as accessed when they are put.
*/
bool pages_mark_accessed_on_put : 1;
/**
* @map_wc: map object write-combined (instead of using shmem defaults).
*/
bool map_wc;
bool map_wc : 1;
};
#define to_drm_gem_shmem_obj(obj) \

View File

@@ -160,7 +160,9 @@ void drm_gem_vram_simple_display_pipe_cleanup_fb(
.debugfs_init = drm_vram_mm_debugfs_init, \
.dumb_create = drm_gem_vram_driver_dumb_create, \
.dumb_map_offset = drm_gem_ttm_dumb_map_offset, \
.gem_prime_mmap = drm_gem_prime_mmap
.gem_prime_mmap = drm_gem_prime_mmap, \
.prime_handle_to_fd = drm_gem_prime_handle_to_fd, \
.prime_fd_to_handle = drm_gem_prime_fd_to_handle
/*
* VRAM memory manager

View File

@@ -890,13 +890,6 @@ struct drm_mode_config {
/* dumb ioctl parameters */
uint32_t preferred_depth, prefer_shadow;
/**
* @prefer_shadow_fbdev:
*
* Hint to framebuffer emulation to prefer shadow-fb rendering.
*/
bool prefer_shadow_fbdev;
/**
* @quirk_addfb_prefer_xbgr_30bpp:
*

View File

@@ -1331,6 +1331,32 @@ struct drm_plane_helper_funcs {
*/
void (*atomic_update)(struct drm_plane *plane,
struct drm_atomic_state *state);
/**
* @atomic_enable:
*
* Drivers should use this function to unconditionally enable a plane.
* This hook is called in-between the &drm_crtc_helper_funcs.atomic_begin
* and drm_crtc_helper_funcs.atomic_flush callbacks. It is called after
* @atomic_update, which will be called for all enabled planes. Drivers
* that use @atomic_enable should set up a plane in @atomic_update and
* afterwards enable the plane in @atomic_enable. If a plane needs to be
* enabled before installing the scanout buffer, drivers can still do
* so in @atomic_update.
*
* Note that the power state of the display pipe when this function is
* called depends upon the exact helpers and calling sequence the driver
* has picked. See drm_atomic_helper_commit_planes() for a discussion of
* the tradeoffs and variants of plane commit helpers.
*
* This callback is used by the atomic modeset helpers, but it is
* optional. If implemented, @atomic_enable should be the inverse of
* @atomic_disable. Drivers that don't want to use either can still
* implement the complete plane update in @atomic_update.
*/
void (*atomic_enable)(struct drm_plane *plane,
struct drm_atomic_state *state);
/**
* @atomic_disable:
*
@@ -1351,7 +1377,8 @@ struct drm_plane_helper_funcs {
* the tradeoffs and variants of plane commit helpers.
*
* This callback is used by the atomic modeset helpers and by the
* transitional plane helpers, but it is optional.
* transitional plane helpers, but it is optional. It's intended to
* reverse the effects of @atomic_enable.
*/
void (*atomic_disable)(struct drm_plane *plane,
struct drm_atomic_state *state);

View File

@@ -15,6 +15,8 @@ struct drm_encoder;
struct drm_panel;
struct drm_bridge;
struct device_node;
struct mipi_dsi_device_info;
struct mipi_dsi_host;
/**
* enum drm_lvds_dual_link_pixels - Pixel order of an LVDS dual-link connection
@@ -129,6 +131,16 @@ drm_of_get_data_lanes_count_ep(const struct device_node *port,
}
#endif
#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_DRM_MIPI_DSI)
struct mipi_dsi_host *drm_of_get_dsi_bus(struct device *dev);
#else
static inline struct
mipi_dsi_host *drm_of_get_dsi_bus(struct device *dev)
{
return ERR_PTR(-EINVAL);
}
#endif /* CONFIG_OF && CONFIG_DRM_MIPI_DSI */
/*
* drm_of_panel_bridge_remove - remove panel bridge
* @np: device tree node containing panel bridge output ports

108
include/drm/drm_suballoc.h Normal file
View File

@@ -0,0 +1,108 @@
/* SPDX-License-Identifier: GPL-2.0 OR MIT */
/*
* Copyright 2011 Red Hat Inc.
* Copyright © 2022 Intel Corporation
*/
#ifndef _DRM_SUBALLOC_H_
#define _DRM_SUBALLOC_H_
#include <drm/drm_mm.h>
#include <linux/dma-fence.h>
#include <linux/types.h>
#define DRM_SUBALLOC_MAX_QUEUES 32
/**
* struct drm_suballoc_manager - fenced range allocations
* @wq: Wait queue for sleeping allocations on contention.
* @hole: Pointer to first hole node.
* @olist: List of allocated ranges.
* @flist: Array[fence context hash] of queues of fenced allocated ranges.
* @size: Size of the managed range.
* @align: Default alignment for the managed range.
*/
struct drm_suballoc_manager {
wait_queue_head_t wq;
struct list_head *hole;
struct list_head olist;
struct list_head flist[DRM_SUBALLOC_MAX_QUEUES];
size_t size;
size_t align;
};
/**
* struct drm_suballoc - Sub-allocated range
* @olist: List link for list of allocated ranges.
* @flist: List linkk for the manager fenced allocated ranges queues.
* @manager: The drm_suballoc_manager.
* @soffset: Start offset.
* @eoffset: End offset + 1 so that @eoffset - @soffset = size.
* @dma_fence: The fence protecting the allocation.
*/
struct drm_suballoc {
struct list_head olist;
struct list_head flist;
struct drm_suballoc_manager *manager;
size_t soffset;
size_t eoffset;
struct dma_fence *fence;
};
void drm_suballoc_manager_init(struct drm_suballoc_manager *sa_manager,
size_t size, size_t align);
void drm_suballoc_manager_fini(struct drm_suballoc_manager *sa_manager);
struct drm_suballoc *
drm_suballoc_new(struct drm_suballoc_manager *sa_manager, size_t size,
gfp_t gfp, bool intr, size_t align);
void drm_suballoc_free(struct drm_suballoc *sa, struct dma_fence *fence);
/**
* drm_suballoc_soffset - Range start.
* @sa: The struct drm_suballoc.
*
* Return: The start of the allocated range.
*/
static inline size_t drm_suballoc_soffset(struct drm_suballoc *sa)
{
return sa->soffset;
}
/**
* drm_suballoc_eoffset - Range end.
* @sa: The struct drm_suballoc.
*
* Return: The end of the allocated range + 1.
*/
static inline size_t drm_suballoc_eoffset(struct drm_suballoc *sa)
{
return sa->eoffset;
}
/**
* drm_suballoc_size - Range size.
* @sa: The struct drm_suballoc.
*
* Return: The size of the allocated range.
*/
static inline size_t drm_suballoc_size(struct drm_suballoc *sa)
{
return sa->eoffset - sa->soffset;
}
#ifdef CONFIG_DEBUG_FS
void drm_suballoc_dump_debug_info(struct drm_suballoc_manager *sa_manager,
struct drm_printer *p,
unsigned long long suballoc_base);
#else
static inline void
drm_suballoc_dump_debug_info(struct drm_suballoc_manager *sa_manager,
struct drm_printer *p,
unsigned long long suballoc_base)
{ }
#endif
#endif /* _DRM_SUBALLOC_H_ */

View File

@@ -230,6 +230,7 @@ bool drm_dev_has_vblank(const struct drm_device *dev);
u64 drm_crtc_vblank_count(struct drm_crtc *crtc);
u64 drm_crtc_vblank_count_and_time(struct drm_crtc *crtc,
ktime_t *vblanktime);
int drm_crtc_next_vblank_start(struct drm_crtc *crtc, ktime_t *vblanktime);
void drm_crtc_send_vblank_event(struct drm_crtc *crtc,
struct drm_pending_vblank_event *e);
void drm_crtc_arm_vblank_event(struct drm_crtc *crtc,

Some files were not shown because too many files have changed in this diff Show More