Skip to content

Commit

Permalink
Merge tag 'drm-misc-next-2023-07-21' of ssh://git.freedesktop.org/git…
Browse files Browse the repository at this point in the history
…/drm/drm-misc into drm-next

drm-misc-next for 6.6:

UAPI Changes:
  - syncobj: New DRM_IOCTL_SYNCOBJ_EVENTFD ioctl

Cross-subsystem Changes:
  - Converge to use of_device_uevent()

Core Changes:
  - GPU VA Manager
  - improvements to make it clearer that drm_minor_type is uAPI

Driver Changes:
  - ssd130x: Improve intermediate buffer size computation
  - bridges:
    - adv7511: Fix low refresh rate
    - anx7625: Switch to macros instead of hardcoded values
  - panel:
    - ld9040: Backlight support, magic improved

Signed-off-by: Daniel Vetter <[email protected]>
From: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/urs7omo5xnhglztxgwgsslws7duqfj4jhzrtppaenuvdh2lwuz@4htm4iiqhkep
  • Loading branch information
danvet committed Jul 27, 2023
2 parents 6c7f274 + d281eea commit 5c1b19b
Show file tree
Hide file tree
Showing 172 changed files with 3,014 additions and 215 deletions.
36 changes: 36 additions & 0 deletions Documentation/gpu/drm-mm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,42 @@ DRM MM Range Allocator Function References
.. kernel-doc:: drivers/gpu/drm/drm_mm.c
:export:

DRM GPU VA Manager
==================

Overview
--------

.. kernel-doc:: drivers/gpu/drm/drm_gpuva_mgr.c
:doc: Overview

Split and Merge
---------------

.. kernel-doc:: drivers/gpu/drm/drm_gpuva_mgr.c
:doc: Split and Merge

Locking
-------

.. kernel-doc:: drivers/gpu/drm/drm_gpuva_mgr.c
:doc: Locking

Examples
--------

.. kernel-doc:: drivers/gpu/drm/drm_gpuva_mgr.c
:doc: Examples

DRM GPU VA Manager Function References
--------------------------------------

.. kernel-doc:: include/drm/drm_gpuva_mgr.h
:internal:

.. kernel-doc:: drivers/gpu/drm/drm_gpuva_mgr.c
:export:

DRM Buddy Allocator
===================

Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ drm-y := \
drm_vblank.o \
drm_vblank_work.o \
drm_vma_manager.o \
drm_gpuva_mgr.o \
drm_writeback.o
drm-$(CONFIG_DRM_LEGACY) += \
drm_agpsupport.o \
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/arm/display/komeda/komeda_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
#include <linux/io.h>
#include <linux/iommu.h>
#include <linux/of_device.h>
#include <linux/of.h>
#include <linux/of_graph.h>
#include <linux/of_reserved_mem.h>
#include <linux/platform_device.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/arm/malidp_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <linux/of_device.h>
#include <linux/of_graph.h>
#include <linux/of_reserved_mem.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/debugfs.h>

Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/bridge/adv7511/adv7511_cec.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#include <linux/device.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/slab.h>
#include <linux/clk.h>

Expand Down
11 changes: 8 additions & 3 deletions drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <linux/device.h>
#include <linux/gpio/consumer.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/of.h>
#include <linux/slab.h>

#include <media/cec.h>
Expand Down Expand Up @@ -786,8 +786,13 @@ static void adv7511_mode_set(struct adv7511 *adv7511,
else
low_refresh_rate = ADV7511_LOW_REFRESH_RATE_NONE;

regmap_update_bits(adv7511->regmap, 0xfb,
0x6, low_refresh_rate << 1);
if (adv7511->type == ADV7511)
regmap_update_bits(adv7511->regmap, 0xfb,
0x6, low_refresh_rate << 1);
else
regmap_update_bits(adv7511->regmap, 0x4a,
0xc, low_refresh_rate << 2);

regmap_update_bits(adv7511->regmap, 0x17,
0x60, (vsync_polarity << 6) | (hsync_polarity << 5));

Expand Down
12 changes: 6 additions & 6 deletions drivers/gpu/drm/bridge/analogix/anx7625.c
Original file line number Diff line number Diff line change
Expand Up @@ -872,11 +872,11 @@ static int anx7625_hdcp_enable(struct anx7625_data *ctx)
}

/* Read downstream capability */
ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_READ, 0x68028, 1, &bcap);
ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_READ, DP_AUX_HDCP_BCAPS, 1, &bcap);
if (ret < 0)
return ret;

if (!(bcap & 0x01)) {
if (!(bcap & DP_BCAPS_HDCP_CAPABLE)) {
pr_warn("downstream not support HDCP 1.4, cap(%x).\n", bcap);
return 0;
}
Expand Down Expand Up @@ -931,8 +931,8 @@ static void anx7625_dp_start(struct anx7625_data *ctx)

dev_dbg(dev, "set downstream sink into normal\n");
/* Downstream sink enter into normal mode */
data = 1;
ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, 0x000600, 1, &data);
data = DP_SET_POWER_D0;
ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, DP_SET_POWER, 1, &data);
if (ret < 0)
dev_err(dev, "IO error : set sink into normal mode fail\n");

Expand Down Expand Up @@ -971,8 +971,8 @@ static void anx7625_dp_stop(struct anx7625_data *ctx)

dev_dbg(dev, "notify downstream enter into standby\n");
/* Downstream monitor enter into standby mode */
data = 2;
ret |= anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, 0x000600, 1, &data);
data = DP_SET_POWER_D3;
ret |= anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, DP_SET_POWER, 1, &data);
if (ret < 0)
DRM_DEV_ERROR(dev, "IO error : mute video fail\n");

Expand Down
3 changes: 1 addition & 2 deletions drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
#include <linux/interrupt.h>
#include <linux/iopoll.h>
#include <linux/module.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/of.h>
#include <linux/of_graph.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <linux/media-bus-format.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/phy/phy.h>
#include <linux/phy/phy-dp.h>
#include <linux/platform_device.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/bridge/chipone-icn6211.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <linux/i2c.h>
#include <linux/media-bus-format.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/of.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>

Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/bridge/display-connector.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>

Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/bridge/fsl-ldb.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/of_graph.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/bridge/imx/imx8qm-ldb.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/of_graph.h>
#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>

Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <linux/of_device.h>
#include <linux/of_graph.h>
#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>

Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/bridge/lontium-lt9211.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <linux/i2c.h>
#include <linux/media-bus-format.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/of_graph.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/bridge/lvds-codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <linux/gpio/consumer.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/of_graph.h>
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/bridge/nwl-dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#include <linux/module.h>
#include <linux/mux/consumer.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/reset.h>
#include <linux/sys_soc.h>
Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/bridge/parade-ps8622.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/pm.h>
#include <linux/regulator/consumer.h>

Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/bridge/samsung-dsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
#include <linux/delay.h>
#include <linux/irq.h>
#include <linux/media-bus-format.h>
#include <linux/of_device.h>
#include <linux/of.h>
#include <linux/phy/phy.h>
#include <linux/platform_device.h>

#include <video/mipi_display.h>

Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/bridge/simple-bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@

#include <linux/gpio/consumer.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/of.h>
#include <linux/of_graph.h>
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>

#include <drm/drm_atomic_helper.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of_device.h>
#include <linux/of.h>
#include <linux/pinctrl/consumer.h>
#include <linux/regmap.h>
#include <linux/dma-mapping.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <linux/debugfs.h>
#include <linux/iopoll.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/reset.h>

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/bridge/ti-sn65dsi83.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <linux/i2c.h>
#include <linux/media-bus-format.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/of.h>
#include <linux/of_graph.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
Expand Down
40 changes: 40 additions & 0 deletions drivers/gpu/drm/drm_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <drm/drm_file.h>
#include <drm/drm_gem.h>
#include <drm/drm_managed.h>
#include <drm/drm_gpuva_mgr.h>

#include "drm_crtc_internal.h"
#include "drm_internal.h"
Expand Down Expand Up @@ -175,6 +176,45 @@ static const struct file_operations drm_debugfs_fops = {
.release = single_release,
};

/**
* drm_debugfs_gpuva_info - dump the given DRM GPU VA space
* @m: pointer to the &seq_file to write
* @mgr: the &drm_gpuva_manager representing the GPU VA space
*
* Dumps the GPU VA mappings of a given DRM GPU VA manager.
*
* For each DRM GPU VA space drivers should call this function from their
* &drm_info_list's show callback.
*
* Returns: 0 on success, -ENODEV if the &mgr is not initialized
*/
int drm_debugfs_gpuva_info(struct seq_file *m,
struct drm_gpuva_manager *mgr)
{
struct drm_gpuva *va, *kva = &mgr->kernel_alloc_node;

if (!mgr->name)
return -ENODEV;

seq_printf(m, "DRM GPU VA space (%s) [0x%016llx;0x%016llx]\n",
mgr->name, mgr->mm_start, mgr->mm_start + mgr->mm_range);
seq_printf(m, "Kernel reserved node [0x%016llx;0x%016llx]\n",
kva->va.addr, kva->va.addr + kva->va.range);
seq_puts(m, "\n");
seq_puts(m, " VAs | start | range | end | object | object offset\n");
seq_puts(m, "-------------------------------------------------------------------------------------------------------------\n");
drm_gpuva_for_each_va(va, mgr) {
if (unlikely(va == kva))
continue;

seq_printf(m, " | 0x%016llx | 0x%016llx | 0x%016llx | 0x%016llx | 0x%016llx\n",
va->va.addr, va->va.range, va->va.addr + va->va.range,
(u64)(uintptr_t)va->gem.obj, va->gem.offset);
}

return 0;
}
EXPORT_SYMBOL(drm_debugfs_gpuva_info);

/**
* drm_debugfs_create_files - Initialize a given set of debugfs files for DRM
Expand Down
8 changes: 4 additions & 4 deletions drivers/gpu/drm/drm_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ DEFINE_STATIC_SRCU(drm_unplug_srcu);
*/

static struct drm_minor **drm_minor_get_slot(struct drm_device *dev,
unsigned int type)
enum drm_minor_type type)
{
switch (type) {
case DRM_MINOR_PRIMARY:
Expand Down Expand Up @@ -116,7 +116,7 @@ static void drm_minor_alloc_release(struct drm_device *dev, void *data)
}
}

static int drm_minor_alloc(struct drm_device *dev, unsigned int type)
static int drm_minor_alloc(struct drm_device *dev, enum drm_minor_type type)
{
struct drm_minor *minor;
unsigned long flags;
Expand Down Expand Up @@ -160,7 +160,7 @@ static int drm_minor_alloc(struct drm_device *dev, unsigned int type)
return 0;
}

static int drm_minor_register(struct drm_device *dev, unsigned int type)
static int drm_minor_register(struct drm_device *dev, enum drm_minor_type type)
{
struct drm_minor *minor;
unsigned long flags;
Expand Down Expand Up @@ -203,7 +203,7 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type)
return ret;
}

static void drm_minor_unregister(struct drm_device *dev, unsigned int type)
static void drm_minor_unregister(struct drm_device *dev, enum drm_minor_type type)
{
struct drm_minor *minor;
unsigned long flags;
Expand Down
3 changes: 3 additions & 0 deletions drivers/gpu/drm/drm_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ void drm_gem_private_object_init(struct drm_device *dev,
if (!obj->resv)
obj->resv = &obj->_resv;

if (drm_core_check_feature(dev, DRIVER_GEM_GPUVA))
drm_gem_gpuva_init(obj);

drm_vma_node_reset(&obj->vma_node);
INIT_LIST_HEAD(&obj->lru_node);
}
Expand Down
Loading

0 comments on commit 5c1b19b

Please sign in to comment.