Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
9966d76
drm/bridge: tc358762: Set pre_enabled in pre_enable
henryzhang62 Nov 25, 2026
85ff281
drm/vc4: Fix the zpos range of the writeback overlay planes
YORROY123 Nov 25, 2026
42483c4
media/hevc_d: Fix off by one worst size cmd buffer checks
jc-kynesim Nov 17, 2026
31c1a18
media/hevc_d: Avoid unlikely race between decode & streamoff
jc-kynesim Nov 17, 2026
f7311f3
media/hevc_d: Fix setup order so error path is always valid
jc-kynesim Nov 17, 2026
b84df88
media/hevc_d: Fix PPS/SPS typo in comment
jc-kynesim Nov 19, 2026
90fa475
media/hevc_d: Only start decode h/w after both CAPTURE and OUTPUT hav…
jc-kynesim Nov 19, 2026
d971b46
media/hevc_d: Remove dev_mutex and replace usage with ctx_mutex
jc-kynesim Nov 19, 2026
cf48a75
hevc_d: Pick the fixes from the latest upstreaming reviews
jc-kynesim Mar 9, 2026
d7ea784
media/hevc_d: Ensure that a removed buffer is not in use
jc-kynesim Nov 19, 2026
961f42f
media/hevc_d: Remove min_queued_buffers = 1 from CAPTURE queue
jc-kynesim Nov 19, 2026
01187ed
media/hevc_d: Ensure media requests are cleaned up correctly
jc-kynesim Nov 19, 2026
58e72c1
media/hevc_d: Lock controls against change in phase 0
jc-kynesim Nov 19, 2026
7c7af11
media/hevc_d: Fix up hevc_d_open error handling
jc-kynesim Nov 19, 2026
1279705
media/hevc_d: Tighten up SPS/PPS/SH value checking
jc-kynesim Nov 19, 2026
7f33020
media/hevc_d: Ensure tiles are given in order
jc-kynesim Nov 19, 2026
1e5ed12
media/hevc_d: Prevent dst format change whilst streaming
jc-kynesim Nov 20, 2026
369b7e7
media/hevc_d: Use vb2_plane_size when checking plane sizes
jc-kynesim Nov 20, 2026
f358384
media/hevc_d: Fix behaviour if unbound whilst running
jc-kynesim Nov 20, 2026
5e2938a
media/hevc_d: try_fmt_vid_cap uses fmt from SPS if unmatched
jc-kynesim Nov 20, 2026
4382998
media/hevc_d: Change warning messages to debug for control misconfigu…
jc-kynesim Nov 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions drivers/gpu/drm/bridge/tc358762.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ static void tc358762_pre_enable(struct drm_bridge *bridge,
ret = tc358762_init(ctx);
if (ret < 0)
dev_err(ctx->dev, "error initializing bridge (%d)\n", ret);

ctx->pre_enabled = true;
}

static int tc358762_attach(struct drm_bridge *bridge,
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/vc4/vc4_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -2977,7 +2977,7 @@ int vc4_plane_create_additional_planes(struct drm_device *drm)
* 1 cursor plane on a crtc.
*/
drm_plane_create_zpos_property(plane, i + 1, 1,
VC4_NUM_OVERLAY_PLANES + 1);
VC4_NUM_TXP_OVERLAY_PLANES + 1);
}

drm_for_each_crtc(crtc, drm) {
Expand Down
67 changes: 47 additions & 20 deletions drivers/media/platform/raspberrypi/hevc_dec/hevc_d.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
* Copyright (C) 2018 Bootlin
*/

#include <linux/dma-mapping.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/module.h>
#include <linux/of.h>

#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
Expand Down Expand Up @@ -91,6 +91,7 @@ static int hevc_d_init_ctrls(struct hevc_d_dev *dev, struct hevc_d_ctx *ctx)
{
struct v4l2_ctrl_handler *hdl = &ctx->hdl;
unsigned int i;
int ret;

v4l2_ctrl_handler_init(hdl, ARRAY_SIZE(hevc_d_ctrls));
if (hdl->error) {
Expand All @@ -111,8 +112,14 @@ static int hevc_d_init_ctrls(struct hevc_d_dev *dev, struct hevc_d_ctx *ctx)
}
}

ret = v4l2_ctrl_handler_setup(hdl);
if (ret) {
v4l2_err(&dev->v4l2_dev, "Failed to set up control handler\n");
v4l2_ctrl_handler_free(hdl);
return ret;
}

ctx->fh.ctrl_handler = hdl;
v4l2_ctrl_handler_setup(hdl);

return 0;
}
Expand Down Expand Up @@ -155,6 +162,7 @@ static int hevc_d_open(struct file *file)
err_ctx:
v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
err_free:
v4l2_fh_exit(&ctx->fh);
mutex_destroy(&ctx->ctx_mutex);
kfree(ctx);
return ret;
Expand Down Expand Up @@ -190,13 +198,39 @@ static const struct v4l2_file_operations hevc_d_fops = {
.mmap = v4l2_m2m_fop_mmap,
};

/*
* Separate device release from unregister as unbind doesn't shut everything
* down. On unbind this may happen some time after unregister.
*/
static void hevc_d_video_device_release(struct video_device *vfd)
{
struct hevc_d_dev *dev = container_of(vfd, struct hevc_d_dev, vfd);

v4l2_device_unregister(&dev->v4l2_dev);
v4l2_m2m_release(dev->m2m_dev);
media_device_cleanup(&dev->mdev);
kfree(dev);
}

static void hevc_d_unregister(struct hevc_d_dev *dev)
{
/* Stop new jobs being started - never resumed */
v4l2_m2m_suspend(dev->m2m_dev);
/* Wait for any work still in flight */
hevc_d_h265_sync(dev);
/* H/w now idle so we can shut it down */
hevc_d_hw_remove(dev);
/* Must be last - drops what may be the final ref to dev */
video_unregister_device(&dev->vfd);
}

static const struct video_device hevc_d_video_device = {
.name = HEVC_D_NAME,
.vfl_dir = VFL_DIR_M2M,
.fops = &hevc_d_fops,
.ioctl_ops = &hevc_d_ioctl_ops,
.minor = -1,
.release = video_device_release_empty,
.release = hevc_d_video_device_release,
.device_caps = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_STREAMING,
};

Expand All @@ -215,7 +249,7 @@ static int hevc_d_probe(struct platform_device *pdev)
struct video_device *vfd;
int ret;

dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
dev = kzalloc_obj(*dev);
if (!dev)
return -ENOMEM;

Expand All @@ -226,8 +260,8 @@ static int hevc_d_probe(struct platform_device *pdev)

ret = hevc_d_hw_probe(dev);
if (ret) {
dev_err(&pdev->dev, "Failed to probe hardware - %d\n", ret);
return ret;
dev_err_probe(&pdev->dev, ret, "Failed to probe hardware\n");
goto err_free;
}

ret = v4l2_device_register(&pdev->dev, &dev->v4l2_dev);
Expand All @@ -236,10 +270,7 @@ static int hevc_d_probe(struct platform_device *pdev)
goto err_hw;
}

mutex_init(&dev->dev_mutex);

vfd = &dev->vfd;
vfd->lock = &dev->dev_mutex;
vfd->v4l2_dev = &dev->v4l2_dev;

snprintf(vfd->name, sizeof(vfd->name), "%s", hevc_d_video_device.name);
Expand Down Expand Up @@ -298,15 +329,18 @@ static int hevc_d_probe(struct platform_device *pdev)
err_m2m_mc:
v4l2_m2m_unregister_media_controller(dev->m2m_dev);
err_video:
video_unregister_device(&dev->vfd);
hevc_d_unregister(dev);
return ret;

err_m2m:
media_device_cleanup(&dev->mdev);
v4l2_m2m_release(dev->m2m_dev);
err_v4l2:
mutex_destroy(&dev->dev_mutex);
v4l2_device_unregister(&dev->v4l2_dev);
err_hw:
hevc_d_hw_remove(dev);
err_free:
kfree(dev);

return ret;
}
Expand All @@ -317,14 +351,7 @@ static void hevc_d_remove(struct platform_device *pdev)

media_device_unregister(&dev->mdev);
v4l2_m2m_unregister_media_controller(dev->m2m_dev);
media_device_cleanup(&dev->mdev);

v4l2_m2m_release(dev->m2m_dev);
video_unregister_device(&dev->vfd);
mutex_destroy(&dev->dev_mutex);
v4l2_device_unregister(&dev->v4l2_dev);

hevc_d_hw_remove(dev);
hevc_d_unregister(dev);
}

static int hevc_d_runtime_suspend(struct device *d)
Expand Down Expand Up @@ -392,7 +419,7 @@ static struct platform_driver hevc_d_driver = {
.remove = hevc_d_remove,
.driver = {
.name = HEVC_D_NAME,
.of_match_table = of_match_ptr(hevc_d_dt_match),
.of_match_table = hevc_d_dt_match,
.pm = pm_ptr(&hevc_d_pm_ops),
},
};
Expand Down
16 changes: 9 additions & 7 deletions drivers/media/platform/raspberrypi/hevc_dec/hevc_d.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ struct hevc_d_ctx {
*/
int fatal_err;

/* Lock for queue operations */
/* Lock for queue operations and src_fmt / dst_fmt */
struct mutex ctx_mutex;

struct v4l2_ctrl_handler hdl;
Expand All @@ -137,12 +137,17 @@ struct hevc_d_ctx {
size_t pu_size_max;
size_t coeff_size_max;

/* Spinlock protecting aux_free */
spinlock_t aux_lock;
/* Aux structures only used in setup so no locking needed */
struct hevc_d_q_aux *aux_free;

struct hevc_d_q_aux *aux_ents[HEVC_D_AUX_ENT_COUNT];

struct hevc_d_slot {
u32 refybase;
u32 refcbase;
u32 colbase;
u32 poc;
} slots[HEVC_D_AUX_ENT_COUNT];

unsigned int colmv_stride;
unsigned int colmv_picsize;
};
Expand Down Expand Up @@ -175,9 +180,6 @@ struct hevc_d_dev {
struct device *dev;
struct v4l2_m2m_dev *m2m_dev;

/* Video device file (vfd) mutex */
struct mutex dev_mutex;

void __iomem *base_irq;
void __iomem *base_h265;

Expand Down
Loading