Commit ca10367a authored by Dave Airlie's avatar Dave Airlie

Merge tag 'drm-misc-fixes-2024-09-05' of...

Merge tag 'drm-misc-fixes-2024-09-05' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes

A zpos normalization fix for komeda, a register bitmask fix for nouveau,
a memory leak fix for imagination, three fixes for the recent bridge
HDMI work, a potential DoS fix and a cache coherency for panthor, a
change of panel compatible and a deferred-io fix when used with
non-highmem memory.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

From: Maxime Ripard <mripard@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240905-original-radical-guan-e7a2ae@houat
parents 4de4a0f1 5a498d4d
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2 %YAML 1.2
--- ---
$id: http://devicetree.org/schemas/display/panel/wl-355608-a8.yaml# $id: http://devicetree.org/schemas/display/panel/anbernic,rg35xx-plus-panel.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml#
title: WL-355608-A8 3.5" (640x480 pixels) 24-bit IPS LCD panel title: Anbernic RG35XX series (WL-355608-A8) 3.5" 640x480 24-bit IPS LCD panel
maintainers: maintainers:
- Ryan Walklin <ryan@testtoast.com> - Ryan Walklin <ryan@testtoast.com>
...@@ -15,7 +15,14 @@ allOf: ...@@ -15,7 +15,14 @@ allOf:
properties: properties:
compatible: compatible:
const: wl-355608-a8 oneOf:
- const: anbernic,rg35xx-plus-panel
- items:
- enum:
- anbernic,rg35xx-2024-panel
- anbernic,rg35xx-h-panel
- anbernic,rg35xx-sp-panel
- const: anbernic,rg35xx-plus-panel
reg: reg:
maxItems: 1 maxItems: 1
...@@ -40,7 +47,7 @@ examples: ...@@ -40,7 +47,7 @@ examples:
#size-cells = <0>; #size-cells = <0>;
panel@0 { panel@0 {
compatible = "wl-355608-a8"; compatible = "anbernic,rg35xx-plus-panel";
reg = <0>; reg = <0>;
spi-3wire; spi-3wire;
......
...@@ -7457,8 +7457,8 @@ S: Maintained ...@@ -7457,8 +7457,8 @@ S: Maintained
T: git https://gitlab.freedesktop.org/drm/misc/kernel.git T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
F: Documentation/devicetree/bindings/display/bridge/ F: Documentation/devicetree/bindings/display/bridge/
F: drivers/gpu/drm/bridge/ F: drivers/gpu/drm/bridge/
F: drivers/gpu/drm/display/drm_bridge_connector.c
F: drivers/gpu/drm/drm_bridge.c F: drivers/gpu/drm/drm_bridge.c
F: drivers/gpu/drm/drm_bridge_connector.c
F: include/drm/drm_bridge.h F: include/drm/drm_bridge.h
F: include/drm/drm_bridge_connector.h F: include/drm/drm_bridge_connector.h
......
...@@ -128,7 +128,6 @@ obj-$(CONFIG_DRM_TTM_HELPER) += drm_ttm_helper.o ...@@ -128,7 +128,6 @@ obj-$(CONFIG_DRM_TTM_HELPER) += drm_ttm_helper.o
drm_kms_helper-y := \ drm_kms_helper-y := \
drm_atomic_helper.o \ drm_atomic_helper.o \
drm_atomic_state_helper.o \ drm_atomic_state_helper.o \
drm_bridge_connector.o \
drm_crtc_helper.o \ drm_crtc_helper.o \
drm_damage_helper.o \ drm_damage_helper.o \
drm_encoder_slave.o \ drm_encoder_slave.o \
......
...@@ -160,6 +160,7 @@ static int komeda_crtc_normalize_zpos(struct drm_crtc *crtc, ...@@ -160,6 +160,7 @@ static int komeda_crtc_normalize_zpos(struct drm_crtc *crtc,
struct drm_plane *plane; struct drm_plane *plane;
struct list_head zorder_list; struct list_head zorder_list;
int order = 0, err; int order = 0, err;
u32 slave_zpos = 0;
DRM_DEBUG_ATOMIC("[CRTC:%d:%s] calculating normalized zpos values\n", DRM_DEBUG_ATOMIC("[CRTC:%d:%s] calculating normalized zpos values\n",
crtc->base.id, crtc->name); crtc->base.id, crtc->name);
...@@ -199,10 +200,13 @@ static int komeda_crtc_normalize_zpos(struct drm_crtc *crtc, ...@@ -199,10 +200,13 @@ static int komeda_crtc_normalize_zpos(struct drm_crtc *crtc,
plane_st->zpos, plane_st->normalized_zpos); plane_st->zpos, plane_st->normalized_zpos);
/* calculate max slave zorder */ /* calculate max slave zorder */
if (has_bit(drm_plane_index(plane), kcrtc->slave_planes)) if (has_bit(drm_plane_index(plane), kcrtc->slave_planes)) {
slave_zpos = plane_st->normalized_zpos;
if (to_kplane_st(plane_st)->layer_split)
slave_zpos++;
kcrtc_st->max_slave_zorder = kcrtc_st->max_slave_zorder =
max(plane_st->normalized_zpos, max(slave_zpos, kcrtc_st->max_slave_zorder);
kcrtc_st->max_slave_zorder); }
} }
crtc_st->zpos_changed = true; crtc_st->zpos_changed = true;
......
...@@ -390,6 +390,7 @@ config DRM_TI_SN65DSI86 ...@@ -390,6 +390,7 @@ config DRM_TI_SN65DSI86
depends on OF depends on OF
select DRM_DISPLAY_DP_HELPER select DRM_DISPLAY_DP_HELPER
select DRM_DISPLAY_HELPER select DRM_DISPLAY_HELPER
select DRM_BRIDGE_CONNECTOR
select DRM_KMS_HELPER select DRM_KMS_HELPER
select REGMAP_I2C select REGMAP_I2C
select DRM_PANEL select DRM_PANEL
......
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
config DRM_DISPLAY_DP_AUX_BUS
tristate
depends on DRM
depends on OF || COMPILE_TEST
config DRM_DISPLAY_HELPER config DRM_DISPLAY_HELPER
tristate tristate
depends on DRM depends on DRM
help help
DRM helpers for display adapters. DRM helpers for display adapters.
config DRM_DISPLAY_DP_AUX_BUS if DRM_DISPLAY_HELPER
tristate
depends on DRM config DRM_BRIDGE_CONNECTOR
depends on OF || COMPILE_TEST bool
select DRM_DISPLAY_HDMI_STATE_HELPER
help
DRM connector implementation terminating DRM bridge chains.
config DRM_DISPLAY_DP_AUX_CEC config DRM_DISPLAY_DP_AUX_CEC
bool "Enable DisplayPort CEC-Tunneling-over-AUX HDMI support" bool "Enable DisplayPort CEC-Tunneling-over-AUX HDMI support"
depends on DRM && DRM_DISPLAY_HELPER
select DRM_DISPLAY_DP_HELPER select DRM_DISPLAY_DP_HELPER
select CEC_CORE select CEC_CORE
help help
...@@ -25,7 +32,6 @@ config DRM_DISPLAY_DP_AUX_CEC ...@@ -25,7 +32,6 @@ config DRM_DISPLAY_DP_AUX_CEC
config DRM_DISPLAY_DP_AUX_CHARDEV config DRM_DISPLAY_DP_AUX_CHARDEV
bool "DRM DP AUX Interface" bool "DRM DP AUX Interface"
depends on DRM && DRM_DISPLAY_HELPER
select DRM_DISPLAY_DP_HELPER select DRM_DISPLAY_DP_HELPER
help help
Choose this option to enable a /dev/drm_dp_auxN node that allows to Choose this option to enable a /dev/drm_dp_auxN node that allows to
...@@ -34,7 +40,6 @@ config DRM_DISPLAY_DP_AUX_CHARDEV ...@@ -34,7 +40,6 @@ config DRM_DISPLAY_DP_AUX_CHARDEV
config DRM_DISPLAY_DP_HELPER config DRM_DISPLAY_DP_HELPER
bool bool
depends on DRM_DISPLAY_HELPER
help help
DRM display helpers for DisplayPort. DRM display helpers for DisplayPort.
...@@ -61,19 +66,18 @@ config DRM_DISPLAY_DP_TUNNEL_STATE_DEBUG ...@@ -61,19 +66,18 @@ config DRM_DISPLAY_DP_TUNNEL_STATE_DEBUG
config DRM_DISPLAY_HDCP_HELPER config DRM_DISPLAY_HDCP_HELPER
bool bool
depends on DRM_DISPLAY_HELPER
help help
DRM display helpers for HDCP. DRM display helpers for HDCP.
config DRM_DISPLAY_HDMI_HELPER config DRM_DISPLAY_HDMI_HELPER
bool bool
depends on DRM_DISPLAY_HELPER
help help
DRM display helpers for HDMI. DRM display helpers for HDMI.
config DRM_DISPLAY_HDMI_STATE_HELPER config DRM_DISPLAY_HDMI_STATE_HELPER
bool bool
depends on DRM_DISPLAY_HELPER
select DRM_DISPLAY_HDMI_HELPER select DRM_DISPLAY_HDMI_HELPER
help help
DRM KMS state helpers for HDMI. DRM KMS state helpers for HDMI.
endif # DRM_DISPLAY_HELPER
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
obj-$(CONFIG_DRM_DISPLAY_DP_AUX_BUS) += drm_dp_aux_bus.o obj-$(CONFIG_DRM_DISPLAY_DP_AUX_BUS) += drm_dp_aux_bus.o
drm_display_helper-y := drm_display_helper_mod.o drm_display_helper-y := drm_display_helper_mod.o
drm_display_helper-$(CONFIG_DRM_BRIDGE_CONNECTOR) += \
drm_bridge_connector.o
drm_display_helper-$(CONFIG_DRM_DISPLAY_DP_HELPER) += \ drm_display_helper-$(CONFIG_DRM_DISPLAY_DP_HELPER) += \
drm_dp_dual_mode_helper.o \ drm_dp_dual_mode_helper.o \
drm_dp_helper.o \ drm_dp_helper.o \
......
...@@ -216,8 +216,19 @@ static void drm_bridge_connector_debugfs_init(struct drm_connector *connector, ...@@ -216,8 +216,19 @@ static void drm_bridge_connector_debugfs_init(struct drm_connector *connector,
} }
} }
static void drm_bridge_connector_reset(struct drm_connector *connector)
{
struct drm_bridge_connector *bridge_connector =
to_drm_bridge_connector(connector);
drm_atomic_helper_connector_reset(connector);
if (bridge_connector->bridge_hdmi)
__drm_atomic_helper_connector_hdmi_reset(connector,
connector->state);
}
static const struct drm_connector_funcs drm_bridge_connector_funcs = { static const struct drm_connector_funcs drm_bridge_connector_funcs = {
.reset = drm_atomic_helper_connector_reset, .reset = drm_bridge_connector_reset,
.detect = drm_bridge_connector_detect, .detect = drm_bridge_connector_detect,
.fill_modes = drm_helper_probe_single_connector_modes, .fill_modes = drm_helper_probe_single_connector_modes,
.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
......
...@@ -36,20 +36,11 @@ static int drm_fbdev_dma_fb_release(struct fb_info *info, int user) ...@@ -36,20 +36,11 @@ static int drm_fbdev_dma_fb_release(struct fb_info *info, int user)
return 0; return 0;
} }
FB_GEN_DEFAULT_DEFERRED_DMAMEM_OPS(drm_fbdev_dma,
drm_fb_helper_damage_range,
drm_fb_helper_damage_area);
static int drm_fbdev_dma_fb_mmap(struct fb_info *info, struct vm_area_struct *vma) static int drm_fbdev_dma_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
{ {
struct drm_fb_helper *fb_helper = info->par; struct drm_fb_helper *fb_helper = info->par;
struct drm_framebuffer *fb = fb_helper->fb;
struct drm_gem_dma_object *dma = drm_fb_dma_get_gem_obj(fb, 0);
if (!dma->map_noncoherent) return drm_gem_prime_mmap(fb_helper->buffer->gem, vma);
vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
return fb_deferred_io_mmap(info, vma);
} }
static void drm_fbdev_dma_fb_destroy(struct fb_info *info) static void drm_fbdev_dma_fb_destroy(struct fb_info *info)
...@@ -70,13 +61,40 @@ static void drm_fbdev_dma_fb_destroy(struct fb_info *info) ...@@ -70,13 +61,40 @@ static void drm_fbdev_dma_fb_destroy(struct fb_info *info)
} }
static const struct fb_ops drm_fbdev_dma_fb_ops = { static const struct fb_ops drm_fbdev_dma_fb_ops = {
.owner = THIS_MODULE,
.fb_open = drm_fbdev_dma_fb_open,
.fb_release = drm_fbdev_dma_fb_release,
__FB_DEFAULT_DMAMEM_OPS_RDWR,
DRM_FB_HELPER_DEFAULT_OPS,
__FB_DEFAULT_DMAMEM_OPS_DRAW,
.fb_mmap = drm_fbdev_dma_fb_mmap,
.fb_destroy = drm_fbdev_dma_fb_destroy,
};
FB_GEN_DEFAULT_DEFERRED_DMAMEM_OPS(drm_fbdev_dma,
drm_fb_helper_damage_range,
drm_fb_helper_damage_area);
static int drm_fbdev_dma_deferred_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
{
struct drm_fb_helper *fb_helper = info->par;
struct drm_framebuffer *fb = fb_helper->fb;
struct drm_gem_dma_object *dma = drm_fb_dma_get_gem_obj(fb, 0);
if (!dma->map_noncoherent)
vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
return fb_deferred_io_mmap(info, vma);
}
static const struct fb_ops drm_fbdev_dma_deferred_fb_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.fb_open = drm_fbdev_dma_fb_open, .fb_open = drm_fbdev_dma_fb_open,
.fb_release = drm_fbdev_dma_fb_release, .fb_release = drm_fbdev_dma_fb_release,
__FB_DEFAULT_DEFERRED_OPS_RDWR(drm_fbdev_dma), __FB_DEFAULT_DEFERRED_OPS_RDWR(drm_fbdev_dma),
DRM_FB_HELPER_DEFAULT_OPS, DRM_FB_HELPER_DEFAULT_OPS,
__FB_DEFAULT_DEFERRED_OPS_DRAW(drm_fbdev_dma), __FB_DEFAULT_DEFERRED_OPS_DRAW(drm_fbdev_dma),
.fb_mmap = drm_fbdev_dma_fb_mmap, .fb_mmap = drm_fbdev_dma_deferred_fb_mmap,
.fb_destroy = drm_fbdev_dma_fb_destroy, .fb_destroy = drm_fbdev_dma_fb_destroy,
}; };
...@@ -89,6 +107,7 @@ static int drm_fbdev_dma_helper_fb_probe(struct drm_fb_helper *fb_helper, ...@@ -89,6 +107,7 @@ static int drm_fbdev_dma_helper_fb_probe(struct drm_fb_helper *fb_helper,
{ {
struct drm_client_dev *client = &fb_helper->client; struct drm_client_dev *client = &fb_helper->client;
struct drm_device *dev = fb_helper->dev; struct drm_device *dev = fb_helper->dev;
bool use_deferred_io = false;
struct drm_client_buffer *buffer; struct drm_client_buffer *buffer;
struct drm_gem_dma_object *dma_obj; struct drm_gem_dma_object *dma_obj;
struct drm_framebuffer *fb; struct drm_framebuffer *fb;
...@@ -111,6 +130,15 @@ static int drm_fbdev_dma_helper_fb_probe(struct drm_fb_helper *fb_helper, ...@@ -111,6 +130,15 @@ static int drm_fbdev_dma_helper_fb_probe(struct drm_fb_helper *fb_helper,
fb = buffer->fb; fb = buffer->fb;
/*
* Deferred I/O requires struct page for framebuffer memory,
* which is not guaranteed for all DMA ranges. We thus only
* install deferred I/O if we have a framebuffer that requires
* it.
*/
if (fb->funcs->dirty)
use_deferred_io = true;
ret = drm_client_buffer_vmap(buffer, &map); ret = drm_client_buffer_vmap(buffer, &map);
if (ret) { if (ret) {
goto err_drm_client_buffer_delete; goto err_drm_client_buffer_delete;
...@@ -130,6 +158,9 @@ static int drm_fbdev_dma_helper_fb_probe(struct drm_fb_helper *fb_helper, ...@@ -130,6 +158,9 @@ static int drm_fbdev_dma_helper_fb_probe(struct drm_fb_helper *fb_helper,
drm_fb_helper_fill_info(info, fb_helper, sizes); drm_fb_helper_fill_info(info, fb_helper, sizes);
if (use_deferred_io)
info->fbops = &drm_fbdev_dma_deferred_fb_ops;
else
info->fbops = &drm_fbdev_dma_fb_ops; info->fbops = &drm_fbdev_dma_fb_ops;
/* screen */ /* screen */
...@@ -144,7 +175,20 @@ static int drm_fbdev_dma_helper_fb_probe(struct drm_fb_helper *fb_helper, ...@@ -144,7 +175,20 @@ static int drm_fbdev_dma_helper_fb_probe(struct drm_fb_helper *fb_helper,
} }
info->fix.smem_len = info->screen_size; info->fix.smem_len = info->screen_size;
/*
* Only set up deferred I/O if the screen buffer supports
* it. If this disagrees with the previous test for ->dirty,
* mmap on the /dev/fb file might not work correctly.
*/
if (!is_vmalloc_addr(info->screen_buffer) && info->fix.smem_start) {
unsigned long pfn = info->fix.smem_start >> PAGE_SHIFT;
if (drm_WARN_ON(dev, !pfn_to_page(pfn)))
use_deferred_io = false;
}
/* deferred I/O */ /* deferred I/O */
if (use_deferred_io) {
fb_helper->fbdefio.delay = HZ / 20; fb_helper->fbdefio.delay = HZ / 20;
fb_helper->fbdefio.deferred_io = drm_fb_helper_deferred_io; fb_helper->fbdefio.deferred_io = drm_fb_helper_deferred_io;
...@@ -152,6 +196,7 @@ static int drm_fbdev_dma_helper_fb_probe(struct drm_fb_helper *fb_helper, ...@@ -152,6 +196,7 @@ static int drm_fbdev_dma_helper_fb_probe(struct drm_fb_helper *fb_helper,
ret = fb_deferred_io_init(info); ret = fb_deferred_io_init(info);
if (ret) if (ret)
goto err_drm_fb_helper_release_info; goto err_drm_fb_helper_release_info;
}
return 0; return 0;
......
...@@ -114,6 +114,8 @@ struct pvr_vm_gpuva { ...@@ -114,6 +114,8 @@ struct pvr_vm_gpuva {
struct drm_gpuva base; struct drm_gpuva base;
}; };
#define to_pvr_vm_gpuva(va) container_of_const(va, struct pvr_vm_gpuva, base)
enum pvr_vm_bind_type { enum pvr_vm_bind_type {
PVR_VM_BIND_TYPE_MAP, PVR_VM_BIND_TYPE_MAP,
PVR_VM_BIND_TYPE_UNMAP, PVR_VM_BIND_TYPE_UNMAP,
...@@ -386,6 +388,7 @@ pvr_vm_gpuva_unmap(struct drm_gpuva_op *op, void *op_ctx) ...@@ -386,6 +388,7 @@ pvr_vm_gpuva_unmap(struct drm_gpuva_op *op, void *op_ctx)
drm_gpuva_unmap(&op->unmap); drm_gpuva_unmap(&op->unmap);
drm_gpuva_unlink(op->unmap.va); drm_gpuva_unlink(op->unmap.va);
kfree(to_pvr_vm_gpuva(op->unmap.va));
return 0; return 0;
} }
...@@ -433,6 +436,7 @@ pvr_vm_gpuva_remap(struct drm_gpuva_op *op, void *op_ctx) ...@@ -433,6 +436,7 @@ pvr_vm_gpuva_remap(struct drm_gpuva_op *op, void *op_ctx)
} }
drm_gpuva_unlink(op->remap.unmap->va); drm_gpuva_unlink(op->remap.unmap->va);
kfree(to_pvr_vm_gpuva(op->remap.unmap->va));
return 0; return 0;
} }
......
...@@ -2,6 +2,8 @@ config DRM_IMX_DCSS ...@@ -2,6 +2,8 @@ config DRM_IMX_DCSS
tristate "i.MX8MQ DCSS" tristate "i.MX8MQ DCSS"
select IMX_IRQSTEER select IMX_IRQSTEER
select DRM_KMS_HELPER select DRM_KMS_HELPER
select DRM_DISPLAY_HELPER
select DRM_BRIDGE_CONNECTOR
select DRM_GEM_DMA_HELPER select DRM_GEM_DMA_HELPER
select VIDEOMODE_HELPERS select VIDEOMODE_HELPERS
depends on DRM && ARCH_MXC && ARM64 depends on DRM && ARCH_MXC && ARM64
......
...@@ -3,5 +3,7 @@ config DRM_IMX_LCDC ...@@ -3,5 +3,7 @@ config DRM_IMX_LCDC
depends on DRM && (ARCH_MXC || COMPILE_TEST) depends on DRM && (ARCH_MXC || COMPILE_TEST)
select DRM_GEM_DMA_HELPER select DRM_GEM_DMA_HELPER
select DRM_KMS_HELPER select DRM_KMS_HELPER
select DRM_DISPLAY_HELPER
select DRM_BRIDGE_CONNECTOR
help help
Found on i.MX1, i.MX21, i.MX25 and i.MX27. Found on i.MX1, i.MX21, i.MX25 and i.MX27.
...@@ -8,6 +8,8 @@ config DRM_INGENIC ...@@ -8,6 +8,8 @@ config DRM_INGENIC
select DRM_BRIDGE select DRM_BRIDGE
select DRM_PANEL_BRIDGE select DRM_PANEL_BRIDGE
select DRM_KMS_HELPER select DRM_KMS_HELPER
select DRM_DISPLAY_HELPER
select DRM_BRIDGE_CONNECTOR
select DRM_GEM_DMA_HELPER select DRM_GEM_DMA_HELPER
select REGMAP select REGMAP
select REGMAP_MMIO select REGMAP_MMIO
......
...@@ -3,6 +3,8 @@ config DRM_KMB_DISPLAY ...@@ -3,6 +3,8 @@ config DRM_KMB_DISPLAY
depends on DRM depends on DRM
depends on ARCH_KEEMBAY || COMPILE_TEST depends on ARCH_KEEMBAY || COMPILE_TEST
select DRM_KMS_HELPER select DRM_KMS_HELPER
select DRM_DISPLAY_HELPER
select DRM_BRIDGE_CONNECTOR
select DRM_GEM_DMA_HELPER select DRM_GEM_DMA_HELPER
select DRM_MIPI_DSI select DRM_MIPI_DSI
help help
......
...@@ -9,6 +9,8 @@ config DRM_MEDIATEK ...@@ -9,6 +9,8 @@ config DRM_MEDIATEK
depends on MTK_MMSYS depends on MTK_MMSYS
select DRM_GEM_DMA_HELPER if DRM_FBDEV_EMULATION select DRM_GEM_DMA_HELPER if DRM_FBDEV_EMULATION
select DRM_KMS_HELPER select DRM_KMS_HELPER
select DRM_DISPLAY_HELPER
select DRM_BRIDGE_CONNECTOR
select DRM_MIPI_DSI select DRM_MIPI_DSI
select DRM_PANEL select DRM_PANEL
select MEMORY select MEMORY
......
...@@ -4,6 +4,8 @@ config DRM_MESON ...@@ -4,6 +4,8 @@ config DRM_MESON
depends on DRM && OF && (ARM || ARM64) depends on DRM && OF && (ARM || ARM64)
depends on ARCH_MESON || COMPILE_TEST depends on ARCH_MESON || COMPILE_TEST
select DRM_KMS_HELPER select DRM_KMS_HELPER
select DRM_DISPLAY_HELPER
select DRM_BRIDGE_CONNECTOR
select DRM_GEM_DMA_HELPER select DRM_GEM_DMA_HELPER
select DRM_DISPLAY_CONNECTOR select DRM_DISPLAY_CONNECTOR
select VIDEOMODE_HELPERS select VIDEOMODE_HELPERS
......
...@@ -17,6 +17,7 @@ config DRM_MSM ...@@ -17,6 +17,7 @@ config DRM_MSM
select DRM_DISPLAY_DP_AUX_BUS select DRM_DISPLAY_DP_AUX_BUS
select DRM_DISPLAY_DP_HELPER select DRM_DISPLAY_DP_HELPER
select DRM_DISPLAY_HELPER select DRM_DISPLAY_HELPER
select DRM_BRIDGE_CONNECTOR
select DRM_EXEC select DRM_EXEC
select DRM_KMS_HELPER select DRM_KMS_HELPER
select DRM_PANEL select DRM_PANEL
......
...@@ -324,7 +324,7 @@ nvkm_gsp_fwsec_sb(struct nvkm_gsp *gsp) ...@@ -324,7 +324,7 @@ nvkm_gsp_fwsec_sb(struct nvkm_gsp *gsp)
return ret; return ret;
/* Verify. */ /* Verify. */
err = nvkm_rd32(device, 0x001400 + (0xf * 4)) & 0x0000ffff; err = nvkm_rd32(device, 0x001400 + (0x15 * 4)) & 0x0000ffff;
if (err) { if (err) {
nvkm_error(subdev, "fwsec-sb: 0x%04x\n", err); nvkm_error(subdev, "fwsec-sb: 0x%04x\n", err);
return -EIO; return -EIO;
......
...@@ -5,6 +5,8 @@ config DRM_OMAP ...@@ -5,6 +5,8 @@ config DRM_OMAP
depends on DRM && OF depends on DRM && OF
depends on ARCH_OMAP2PLUS || (COMPILE_TEST && PAGE_SIZE_LESS_THAN_64KB) depends on ARCH_OMAP2PLUS || (COMPILE_TEST && PAGE_SIZE_LESS_THAN_64KB)
select DRM_KMS_HELPER select DRM_KMS_HELPER
select DRM_DISPLAY_HELPER
select DRM_BRIDGE_CONNECTOR
select FB_DMAMEM_HELPERS_DEFERRED if DRM_FBDEV_EMULATION select FB_DMAMEM_HELPERS_DEFERRED if DRM_FBDEV_EMULATION
select VIDEOMODE_HELPERS select VIDEOMODE_HELPERS
select HDMI select HDMI
......
...@@ -925,7 +925,7 @@ MODULE_DEVICE_TABLE(spi, nv3052c_ids); ...@@ -925,7 +925,7 @@ MODULE_DEVICE_TABLE(spi, nv3052c_ids);
static const struct of_device_id nv3052c_of_match[] = { static const struct of_device_id nv3052c_of_match[] = {
{ .compatible = "leadtek,ltk035c5444t", .data = &ltk035c5444t_panel_info }, { .compatible = "leadtek,ltk035c5444t", .data = &ltk035c5444t_panel_info },
{ .compatible = "fascontek,fs035vg158", .data = &fs035vg158_panel_info }, { .compatible = "fascontek,fs035vg158", .data = &fs035vg158_panel_info },
{ .compatible = "wl-355608-a8", .data = &wl_355608_a8_panel_info }, { .compatible = "anbernic,rg35xx-plus-panel", .data = &wl_355608_a8_panel_info },
{ /* sentinel */ } { /* sentinel */ }
}; };
MODULE_DEVICE_TABLE(of, nv3052c_of_match); MODULE_DEVICE_TABLE(of, nv3052c_of_match);
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <drm/drm_auth.h>
#include <drm/drm_debugfs.h> #include <drm/drm_debugfs.h>
#include <drm/drm_drv.h> #include <drm/drm_drv.h>
#include <drm/drm_exec.h> #include <drm/drm_exec.h>
...@@ -996,6 +997,24 @@ static int panthor_ioctl_group_destroy(struct drm_device *ddev, void *data, ...@@ -996,6 +997,24 @@ static int panthor_ioctl_group_destroy(struct drm_device *ddev, void *data,
return panthor_group_destroy(pfile, args->group_handle); return panthor_group_destroy(pfile, args->group_handle);
} }
static int group_priority_permit(struct drm_file *file,
u8 priority)
{
/* Ensure that priority is valid */
if (priority > PANTHOR_GROUP_PRIORITY_HIGH)
return -EINVAL;
/* Medium priority and below are always allowed */
if (priority <= PANTHOR_GROUP_PRIORITY_MEDIUM)
return 0;
/* Higher priorities require CAP_SYS_NICE or DRM_MASTER */
if (capable(CAP_SYS_NICE) || drm_is_current_master(file))
return 0;
return -EACCES;
}
static int panthor_ioctl_group_create(struct drm_device *ddev, void *data, static int panthor_ioctl_group_create(struct drm_device *ddev, void *data,
struct drm_file *file) struct drm_file *file)
{ {
...@@ -1011,6 +1030,10 @@ static int panthor_ioctl_group_create(struct drm_device *ddev, void *data, ...@@ -1011,6 +1030,10 @@ static int panthor_ioctl_group_create(struct drm_device *ddev, void *data,
if (ret) if (ret)
return ret; return ret;
ret = group_priority_permit(file, args->priority);
if (ret)
return ret;
ret = panthor_group_create(pfile, args, queue_args); ret = panthor_group_create(pfile, args, queue_args);
if (ret >= 0) { if (ret >= 0) {
args->group_handle = ret; args->group_handle = ret;
......
...@@ -1089,6 +1089,12 @@ int panthor_fw_post_reset(struct panthor_device *ptdev) ...@@ -1089,6 +1089,12 @@ int panthor_fw_post_reset(struct panthor_device *ptdev)
panthor_fw_stop(ptdev); panthor_fw_stop(ptdev);
ptdev->fw->fast_reset = false; ptdev->fw->fast_reset = false;
drm_err(&ptdev->base, "FW fast reset failed, trying a slow reset"); drm_err(&ptdev->base, "FW fast reset failed, trying a slow reset");
ret = panthor_vm_flush_all(ptdev->fw->vm);
if (ret) {
drm_err(&ptdev->base, "FW slow reset failed (couldn't flush FW's AS l2cache)");
return ret;
}
} }
/* Reload all sections, including RO ones. We're not supposed /* Reload all sections, including RO ones. We're not supposed
...@@ -1099,7 +1105,7 @@ int panthor_fw_post_reset(struct panthor_device *ptdev) ...@@ -1099,7 +1105,7 @@ int panthor_fw_post_reset(struct panthor_device *ptdev)
ret = panthor_fw_start(ptdev); ret = panthor_fw_start(ptdev);
if (ret) { if (ret) {
drm_err(&ptdev->base, "FW slow reset failed"); drm_err(&ptdev->base, "FW slow reset failed (couldn't start the FW )");
return ret; return ret;
} }
......
...@@ -576,6 +576,12 @@ static int mmu_hw_do_operation_locked(struct panthor_device *ptdev, int as_nr, ...@@ -576,6 +576,12 @@ static int mmu_hw_do_operation_locked(struct panthor_device *ptdev, int as_nr,
if (as_nr < 0) if (as_nr < 0)
return 0; return 0;
/*
* If the AS number is greater than zero, then we can be sure
* the device is up and running, so we don't need to explicitly
* power it up
*/
if (op != AS_COMMAND_UNLOCK) if (op != AS_COMMAND_UNLOCK)
lock_region(ptdev, as_nr, iova, size); lock_region(ptdev, as_nr, iova, size);
...@@ -874,14 +880,23 @@ static int panthor_vm_flush_range(struct panthor_vm *vm, u64 iova, u64 size) ...@@ -874,14 +880,23 @@ static int panthor_vm_flush_range(struct panthor_vm *vm, u64 iova, u64 size)
if (!drm_dev_enter(&ptdev->base, &cookie)) if (!drm_dev_enter(&ptdev->base, &cookie))
return 0; return 0;
/* Flush the PTs only if we're already awake */
if (pm_runtime_active(ptdev->base.dev))
ret = mmu_hw_do_operation(vm, iova, size, AS_COMMAND_FLUSH_PT); ret = mmu_hw_do_operation(vm, iova, size, AS_COMMAND_FLUSH_PT);
drm_dev_exit(cookie); drm_dev_exit(cookie);
return ret; return ret;
} }
/**
* panthor_vm_flush_all() - Flush L2 caches for the entirety of a VM's AS
* @vm: VM whose cache to flush
*
* Return: 0 on success, a negative error code if flush failed.
*/
int panthor_vm_flush_all(struct panthor_vm *vm)
{
return panthor_vm_flush_range(vm, vm->base.mm_start, vm->base.mm_range);
}
static int panthor_vm_unmap_pages(struct panthor_vm *vm, u64 iova, u64 size) static int panthor_vm_unmap_pages(struct panthor_vm *vm, u64 iova, u64 size)
{ {
struct panthor_device *ptdev = vm->ptdev; struct panthor_device *ptdev = vm->ptdev;
......
...@@ -31,6 +31,7 @@ panthor_vm_get_bo_for_va(struct panthor_vm *vm, u64 va, u64 *bo_offset); ...@@ -31,6 +31,7 @@ panthor_vm_get_bo_for_va(struct panthor_vm *vm, u64 va, u64 *bo_offset);
int panthor_vm_active(struct panthor_vm *vm); int panthor_vm_active(struct panthor_vm *vm);
void panthor_vm_idle(struct panthor_vm *vm); void panthor_vm_idle(struct panthor_vm *vm);
int panthor_vm_as(struct panthor_vm *vm); int panthor_vm_as(struct panthor_vm *vm);
int panthor_vm_flush_all(struct panthor_vm *vm);
struct panthor_heap_pool * struct panthor_heap_pool *
panthor_vm_get_heap_pool(struct panthor_vm *vm, bool create); panthor_vm_get_heap_pool(struct panthor_vm *vm, bool create);
......
...@@ -3092,7 +3092,7 @@ int panthor_group_create(struct panthor_file *pfile, ...@@ -3092,7 +3092,7 @@ int panthor_group_create(struct panthor_file *pfile,
if (group_args->pad) if (group_args->pad)
return -EINVAL; return -EINVAL;
if (group_args->priority > PANTHOR_CSG_PRIORITY_HIGH) if (group_args->priority >= PANTHOR_CSG_PRIORITY_COUNT)
return -EINVAL; return -EINVAL;
if ((group_args->compute_core_mask & ~ptdev->gpu_info.shader_present) || if ((group_args->compute_core_mask & ~ptdev->gpu_info.shader_present) ||
......
...@@ -5,6 +5,8 @@ config DRM_RCAR_DU ...@@ -5,6 +5,8 @@ config DRM_RCAR_DU
depends on ARM || ARM64 || COMPILE_TEST depends on ARM || ARM64 || COMPILE_TEST
depends on ARCH_RENESAS || COMPILE_TEST depends on ARCH_RENESAS || COMPILE_TEST
select DRM_KMS_HELPER select DRM_KMS_HELPER
select DRM_DISPLAY_HELPER
select DRM_BRIDGE_CONNECTOR
select DRM_GEM_DMA_HELPER select DRM_GEM_DMA_HELPER
select VIDEOMODE_HELPERS select VIDEOMODE_HELPERS
help help
......
...@@ -6,6 +6,8 @@ config DRM_RZG2L_DU ...@@ -6,6 +6,8 @@ config DRM_RZG2L_DU
depends on VIDEO_RENESAS_VSP1 depends on VIDEO_RENESAS_VSP1
select DRM_GEM_DMA_HELPER select DRM_GEM_DMA_HELPER
select DRM_KMS_HELPER select DRM_KMS_HELPER
select DRM_DISPLAY_HELPER
select DRM_BRIDGE_CONNECTOR
select VIDEOMODE_HELPERS select VIDEOMODE_HELPERS
help help
Choose this option if you have an RZ/G2L alike chipset. Choose this option if you have an RZ/G2L alike chipset.
......
...@@ -5,6 +5,8 @@ config DRM_SHMOBILE ...@@ -5,6 +5,8 @@ config DRM_SHMOBILE
depends on ARCH_RENESAS || ARCH_SHMOBILE || COMPILE_TEST depends on ARCH_RENESAS || ARCH_SHMOBILE || COMPILE_TEST
select BACKLIGHT_CLASS_DEVICE select BACKLIGHT_CLASS_DEVICE
select DRM_KMS_HELPER select DRM_KMS_HELPER
select DRM_DISPLAY_HELPER
select DRM_BRIDGE_CONNECTOR
select DRM_GEM_DMA_HELPER select DRM_GEM_DMA_HELPER
select VIDEOMODE_HELPERS select VIDEOMODE_HELPERS
help help
......
...@@ -86,6 +86,8 @@ config ROCKCHIP_LVDS ...@@ -86,6 +86,8 @@ config ROCKCHIP_LVDS
bool "Rockchip LVDS support" bool "Rockchip LVDS support"
depends on DRM_ROCKCHIP depends on DRM_ROCKCHIP
depends on PINCTRL && OF depends on PINCTRL && OF
select DRM_DISPLAY_HELPER
select DRM_BRIDGE_CONNECTOR
help help
Choose this option to enable support for Rockchip LVDS controllers. Choose this option to enable support for Rockchip LVDS controllers.
Rockchip rk3288 SoC has LVDS TX Controller can be used, and it Rockchip rk3288 SoC has LVDS TX Controller can be used, and it
...@@ -96,6 +98,8 @@ config ROCKCHIP_RGB ...@@ -96,6 +98,8 @@ config ROCKCHIP_RGB
bool "Rockchip RGB support" bool "Rockchip RGB support"
depends on DRM_ROCKCHIP depends on DRM_ROCKCHIP
depends on PINCTRL depends on PINCTRL
select DRM_DISPLAY_HELPER
select DRM_BRIDGE_CONNECTOR
help help
Choose this option to enable support for Rockchip RGB output. Choose this option to enable support for Rockchip RGB output.
Some Rockchip CRTCs, like rv1108, can directly output parallel Some Rockchip CRTCs, like rv1108, can directly output parallel
......
...@@ -8,6 +8,7 @@ config DRM_TEGRA ...@@ -8,6 +8,7 @@ config DRM_TEGRA
select DRM_DISPLAY_DP_HELPER select DRM_DISPLAY_DP_HELPER
select DRM_DISPLAY_HDMI_HELPER select DRM_DISPLAY_HDMI_HELPER
select DRM_DISPLAY_HELPER select DRM_DISPLAY_HELPER
select DRM_BRIDGE_CONNECTOR
select DRM_DISPLAY_DP_AUX_BUS select DRM_DISPLAY_DP_AUX_BUS
select DRM_KMS_HELPER select DRM_KMS_HELPER
select DRM_MIPI_DSI select DRM_MIPI_DSI
......
...@@ -3,6 +3,8 @@ config DRM_TIDSS ...@@ -3,6 +3,8 @@ config DRM_TIDSS
depends on DRM && OF depends on DRM && OF
depends on ARM || ARM64 || COMPILE_TEST depends on ARM || ARM64 || COMPILE_TEST
select DRM_KMS_HELPER select DRM_KMS_HELPER
select DRM_DISPLAY_HELPER
select DRM_BRIDGE_CONNECTOR
select DRM_GEM_DMA_HELPER select DRM_GEM_DMA_HELPER
help help
The TI Keystone family SoCs introduced a new generation of The TI Keystone family SoCs introduced a new generation of
......
...@@ -8,6 +8,7 @@ config DRM_ZYNQMP_DPSUB ...@@ -8,6 +8,7 @@ config DRM_ZYNQMP_DPSUB
select DMA_ENGINE select DMA_ENGINE
select DRM_DISPLAY_DP_HELPER select DRM_DISPLAY_DP_HELPER
select DRM_DISPLAY_HELPER select DRM_DISPLAY_HELPER
select DRM_BRIDGE_CONNECTOR
select DRM_GEM_DMA_HELPER select DRM_GEM_DMA_HELPER
select DRM_KMS_HELPER select DRM_KMS_HELPER
select GENERIC_PHY select GENERIC_PHY
......
...@@ -692,7 +692,11 @@ enum drm_panthor_group_priority { ...@@ -692,7 +692,11 @@ enum drm_panthor_group_priority {
/** @PANTHOR_GROUP_PRIORITY_MEDIUM: Medium priority group. */ /** @PANTHOR_GROUP_PRIORITY_MEDIUM: Medium priority group. */
PANTHOR_GROUP_PRIORITY_MEDIUM, PANTHOR_GROUP_PRIORITY_MEDIUM,
/** @PANTHOR_GROUP_PRIORITY_HIGH: High priority group. */ /**
* @PANTHOR_GROUP_PRIORITY_HIGH: High priority group.
*
* Requires CAP_SYS_NICE or DRM_MASTER.
*/
PANTHOR_GROUP_PRIORITY_HIGH, PANTHOR_GROUP_PRIORITY_HIGH,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment