Skip to content

Commit

Permalink
media: phytium-jpeg: Fix the bug of switching resolution
Browse files Browse the repository at this point in the history
The timer30 and timer31 trigger interrupt threads, should
be an atomic operation. There shouldn't be disturbed by
other threads during the interval between the two interrupts.

Signed-off-by: Li Guohui <[email protected]>
Signed-off-by: Wang Min <[email protected]>
Signed-off-by: Wang Yinfeng <[email protected]>
  • Loading branch information
hhhui-L authored and Avenger-285714 committed May 21, 2024
1 parent 7695c14 commit 255e26b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/media/platform/phytium/phytium_jpeg_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,7 @@ static void phytium_jpeg_resolution_work(struct work_struct *work)
if (jpeg_dev->detected_timings.width != jpeg_dev->active_timings.width ||
jpeg_dev->detected_timings.height != jpeg_dev->active_timings.height ||
input_status != jpeg_dev->v4l2_input_status) {

static const struct v4l2_event event = {
.type = V4L2_EVENT_SOURCE_CHANGE,
.u.src_change.changes = V4L2_EVENT_SRC_CH_RESOLUTION,
Expand Down Expand Up @@ -899,7 +900,6 @@ static void phytium_jpeg_irq_res_change(struct phytium_jpeg_dev *jpeg_dev,
ulong delay)
{
dev_info(jpeg_dev->dev, "Source resolution is changed, resetting\n");
set_bit(VIDEO_RES_CHANGE, &jpeg_dev->status);

phytium_jpeg_off(jpeg_dev);

Expand Down Expand Up @@ -1116,6 +1116,7 @@ static irqreturn_t phytium_jpeg_timer30_irq(int irq, void *arg)
/* call SE to poweroff JPEG Engine */
arm_smccc_smc(0xc300fff4, 0x9, 0x2, 0x80000020, 0, 0, 0, 0, &res);

set_bit(VIDEO_RES_CHANGE, &jpeg_dev->status);
/* set JPEG Engine's status is poweroff */
set_bit(VIDEO_POWEROFF, &jpeg_dev->status);
dev_info(jpeg_dev->dev, "timer30 set jpeg status 0x%lx\n", jpeg_dev->status);
Expand Down

0 comments on commit 255e26b

Please sign in to comment.