Skip to content

Commit d19954e

Browse files
committed
Merge tag 'media/v6.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media fixes from Mauro Carvalho Chehab: - ov02c10: some fixes related to preserving bayer pattern and horizontal control - ipu-bridge: Add quirks for some Dell XPS laptops with inverted sensors - mali-c55: Fix version identifier logic - rzg2l-cru: csi-2: fix RZ/V2H input sizes on some variants * tag 'media/v6.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: media: ov02c10: Remove unnecessary hflip and vflip pointers media: ipu-bridge: Add DMI quirk for Dell XPS laptops with upside down sensors media: ov02c10: Fix the horizontal flip control media: ov02c10: Adjust x-win/y-win when changing flipping to preserve bayer-pattern media: ov02c10: Fix bayer-pattern change after default vflip change media: rzg2l-cru: csi-2: Support RZ/V2H input sizes media: uapi: mali-c55-config: Remove version identifier media: mali-c55: Remove duplicated version check media: Documentation: mali-c55: Use v4l2-isp version identifier
2 parents c537e12 + 69d6c6f commit d19954e

7 files changed

Lines changed: 68 additions & 50 deletions

File tree

Documentation/userspace-api/media/v4l/metafmt-arm-mali-c55.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ member and userspace must populate the type member with a value from
4444
struct v4l2_isp_params_buffer *params =
4545
(struct v4l2_isp_params_buffer *)buffer;
4646
47-
params->version = MALI_C55_PARAM_BUFFER_V1;
47+
params->version = V4L2_ISP_PARAMS_VERSION_V1;
4848
params->data_size = 0;
4949
5050
void *data = (void *)params->data;

drivers/media/i2c/ov02c10.c

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -165,16 +165,12 @@ static const struct reg_sequence sensor_1928x1092_30fps_setting[] = {
165165
{0x3809, 0x88},
166166
{0x380a, 0x04},
167167
{0x380b, 0x44},
168-
{0x3810, 0x00},
169-
{0x3811, 0x02},
170-
{0x3812, 0x00},
171-
{0x3813, 0x02},
172168
{0x3814, 0x01},
173169
{0x3815, 0x01},
174170
{0x3816, 0x01},
175171
{0x3817, 0x01},
176172

177-
{0x3820, 0xa0},
173+
{0x3820, 0xa8},
178174
{0x3821, 0x00},
179175
{0x3822, 0x80},
180176
{0x3823, 0x08},
@@ -385,8 +381,6 @@ struct ov02c10 {
385381
struct v4l2_ctrl *vblank;
386382
struct v4l2_ctrl *hblank;
387383
struct v4l2_ctrl *exposure;
388-
struct v4l2_ctrl *hflip;
389-
struct v4l2_ctrl *vflip;
390384

391385
struct clk *img_clk;
392386
struct gpio_desc *reset;
@@ -465,13 +459,17 @@ static int ov02c10_set_ctrl(struct v4l2_ctrl *ctrl)
465459
break;
466460

467461
case V4L2_CID_HFLIP:
462+
cci_write(ov02c10->regmap, OV02C10_ISP_X_WIN_CONTROL,
463+
ctrl->val ? 2 : 1, &ret);
468464
cci_update_bits(ov02c10->regmap, OV02C10_ROTATE_CONTROL,
469-
BIT(3), ov02c10->hflip->val << 3, &ret);
465+
BIT(3), ctrl->val ? 0 : BIT(3), &ret);
470466
break;
471467

472468
case V4L2_CID_VFLIP:
469+
cci_write(ov02c10->regmap, OV02C10_ISP_Y_WIN_CONTROL,
470+
ctrl->val ? 2 : 1, &ret);
473471
cci_update_bits(ov02c10->regmap, OV02C10_ROTATE_CONTROL,
474-
BIT(4), ov02c10->vflip->val << 4, &ret);
472+
BIT(4), ctrl->val << 4, &ret);
475473
break;
476474

477475
default:
@@ -549,15 +547,11 @@ static int ov02c10_init_controls(struct ov02c10 *ov02c10)
549547
OV02C10_EXPOSURE_STEP,
550548
exposure_max);
551549

552-
ov02c10->hflip = v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops,
553-
V4L2_CID_HFLIP, 0, 1, 1, 0);
554-
if (ov02c10->hflip)
555-
ov02c10->hflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;
550+
v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops, V4L2_CID_HFLIP,
551+
0, 1, 1, 0);
556552

557-
ov02c10->vflip = v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops,
558-
V4L2_CID_VFLIP, 0, 1, 1, 0);
559-
if (ov02c10->vflip)
560-
ov02c10->vflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;
553+
v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops, V4L2_CID_VFLIP,
554+
0, 1, 1, 0);
561555

562556
v4l2_ctrl_new_std_menu_items(ctrl_hdlr, &ov02c10_ctrl_ops,
563557
V4L2_CID_TEST_PATTERN,

drivers/media/pci/intel/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ source "drivers/media/pci/intel/ivsc/Kconfig"
66

77
config IPU_BRIDGE
88
tristate "Intel IPU Bridge"
9-
depends on ACPI || COMPILE_TEST
9+
depends on ACPI
1010
depends on I2C
1111
help
1212
The IPU bridge is a helper library for Intel IPU drivers to

drivers/media/pci/intel/ipu-bridge.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <acpi/acpi_bus.h>
66
#include <linux/cleanup.h>
77
#include <linux/device.h>
8+
#include <linux/dmi.h>
89
#include <linux/i2c.h>
910
#include <linux/mei_cl_bus.h>
1011
#include <linux/platform_device.h>
@@ -98,6 +99,28 @@ static const struct ipu_sensor_config ipu_supported_sensors[] = {
9899
IPU_SENSOR_CONFIG("XMCC0003", 1, 321468000),
99100
};
100101

102+
/*
103+
* DMI matches for laptops which have their sensor mounted upside-down
104+
* without reporting a rotation of 180° in neither the SSDB nor the _PLD.
105+
*/
106+
static const struct dmi_system_id upside_down_sensor_dmi_ids[] = {
107+
{
108+
.matches = {
109+
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
110+
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 13 9350"),
111+
},
112+
.driver_data = "OVTI02C1",
113+
},
114+
{
115+
.matches = {
116+
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
117+
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 16 9640"),
118+
},
119+
.driver_data = "OVTI02C1",
120+
},
121+
{} /* Terminating entry */
122+
};
123+
101124
static const struct ipu_property_names prop_names = {
102125
.clock_frequency = "clock-frequency",
103126
.rotation = "rotation",
@@ -248,6 +271,12 @@ static int ipu_bridge_read_acpi_buffer(struct acpi_device *adev, char *id,
248271
static u32 ipu_bridge_parse_rotation(struct acpi_device *adev,
249272
struct ipu_sensor_ssdb *ssdb)
250273
{
274+
const struct dmi_system_id *dmi_id;
275+
276+
dmi_id = dmi_first_match(upside_down_sensor_dmi_ids);
277+
if (dmi_id && acpi_dev_hid_match(adev, dmi_id->driver_data))
278+
return 180;
279+
251280
switch (ssdb->degree) {
252281
case IPU_SENSOR_ROTATION_NORMAL:
253282
return 0;

drivers/media/platform/arm/mali-c55/mali-c55-params.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -582,13 +582,6 @@ static int mali_c55_params_buf_prepare(struct vb2_buffer *vb)
582582
struct mali_c55 *mali_c55 = params->mali_c55;
583583
int ret;
584584

585-
if (config->version != MALI_C55_PARAM_BUFFER_V1) {
586-
dev_dbg(mali_c55->dev,
587-
"Unsupported extensible format version: %u\n",
588-
config->version);
589-
return -EINVAL;
590-
}
591-
592585
ret = v4l2_isp_params_validate_buffer_size(mali_c55->dev, vb,
593586
v4l2_isp_params_buffer_size(MALI_C55_PARAMS_MAX_SIZE));
594587
if (ret)

drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,6 @@
9696

9797
#define VSRSTS_RETRIES 20
9898

99-
#define RZG2L_CSI2_MIN_WIDTH 320
100-
#define RZG2L_CSI2_MIN_HEIGHT 240
101-
#define RZG2L_CSI2_MAX_WIDTH 2800
102-
#define RZG2L_CSI2_MAX_HEIGHT 4095
103-
104-
#define RZG2L_CSI2_DEFAULT_WIDTH RZG2L_CSI2_MIN_WIDTH
105-
#define RZG2L_CSI2_DEFAULT_HEIGHT RZG2L_CSI2_MIN_HEIGHT
10699
#define RZG2L_CSI2_DEFAULT_FMT MEDIA_BUS_FMT_UYVY8_1X16
107100

108101
enum rzg2l_csi2_pads {
@@ -137,6 +130,10 @@ struct rzg2l_csi2_info {
137130
int (*dphy_enable)(struct rzg2l_csi2 *csi2);
138131
int (*dphy_disable)(struct rzg2l_csi2 *csi2);
139132
bool has_system_clk;
133+
unsigned int min_width;
134+
unsigned int min_height;
135+
unsigned int max_width;
136+
unsigned int max_height;
140137
};
141138

142139
struct rzg2l_csi2_timings {
@@ -418,6 +415,10 @@ static const struct rzg2l_csi2_info rzg2l_csi2_info = {
418415
.dphy_enable = rzg2l_csi2_dphy_enable,
419416
.dphy_disable = rzg2l_csi2_dphy_disable,
420417
.has_system_clk = true,
418+
.min_width = 320,
419+
.min_height = 240,
420+
.max_width = 2800,
421+
.max_height = 4095,
421422
};
422423

423424
static int rzg2l_csi2_dphy_setting(struct v4l2_subdev *sd, bool on)
@@ -542,6 +543,10 @@ static const struct rzg2l_csi2_info rzv2h_csi2_info = {
542543
.dphy_enable = rzv2h_csi2_dphy_enable,
543544
.dphy_disable = rzv2h_csi2_dphy_disable,
544545
.has_system_clk = false,
546+
.min_width = 320,
547+
.min_height = 240,
548+
.max_width = 4096,
549+
.max_height = 4096,
545550
};
546551

547552
static int rzg2l_csi2_mipi_link_setting(struct v4l2_subdev *sd, bool on)
@@ -631,6 +636,7 @@ static int rzg2l_csi2_set_format(struct v4l2_subdev *sd,
631636
struct v4l2_subdev_state *state,
632637
struct v4l2_subdev_format *fmt)
633638
{
639+
struct rzg2l_csi2 *csi2 = sd_to_csi2(sd);
634640
struct v4l2_mbus_framefmt *src_format;
635641
struct v4l2_mbus_framefmt *sink_format;
636642

@@ -653,9 +659,11 @@ static int rzg2l_csi2_set_format(struct v4l2_subdev *sd,
653659
sink_format->ycbcr_enc = fmt->format.ycbcr_enc;
654660
sink_format->quantization = fmt->format.quantization;
655661
sink_format->width = clamp_t(u32, fmt->format.width,
656-
RZG2L_CSI2_MIN_WIDTH, RZG2L_CSI2_MAX_WIDTH);
662+
csi2->info->min_width,
663+
csi2->info->max_width);
657664
sink_format->height = clamp_t(u32, fmt->format.height,
658-
RZG2L_CSI2_MIN_HEIGHT, RZG2L_CSI2_MAX_HEIGHT);
665+
csi2->info->min_height,
666+
csi2->info->max_height);
659667
fmt->format = *sink_format;
660668

661669
/* propagate format to source pad */
@@ -668,9 +676,10 @@ static int rzg2l_csi2_init_state(struct v4l2_subdev *sd,
668676
struct v4l2_subdev_state *sd_state)
669677
{
670678
struct v4l2_subdev_format fmt = { .pad = RZG2L_CSI2_SINK, };
679+
struct rzg2l_csi2 *csi2 = sd_to_csi2(sd);
671680

672-
fmt.format.width = RZG2L_CSI2_DEFAULT_WIDTH;
673-
fmt.format.height = RZG2L_CSI2_DEFAULT_HEIGHT;
681+
fmt.format.width = csi2->info->min_width;
682+
fmt.format.height = csi2->info->min_height;
674683
fmt.format.field = V4L2_FIELD_NONE;
675684
fmt.format.code = RZG2L_CSI2_DEFAULT_FMT;
676685
fmt.format.colorspace = V4L2_COLORSPACE_SRGB;
@@ -697,16 +706,18 @@ static int rzg2l_csi2_enum_frame_size(struct v4l2_subdev *sd,
697706
struct v4l2_subdev_state *sd_state,
698707
struct v4l2_subdev_frame_size_enum *fse)
699708
{
709+
struct rzg2l_csi2 *csi2 = sd_to_csi2(sd);
710+
700711
if (fse->index != 0)
701712
return -EINVAL;
702713

703714
if (!rzg2l_csi2_code_to_fmt(fse->code))
704715
return -EINVAL;
705716

706-
fse->min_width = RZG2L_CSI2_MIN_WIDTH;
707-
fse->min_height = RZG2L_CSI2_MIN_HEIGHT;
708-
fse->max_width = RZG2L_CSI2_MAX_WIDTH;
709-
fse->max_height = RZG2L_CSI2_MAX_HEIGHT;
717+
fse->min_width = csi2->info->min_width;
718+
fse->min_height = csi2->info->min_height;
719+
fse->max_width = csi2->info->max_width;
720+
fse->max_height = csi2->info->max_height;
710721

711722
return 0;
712723
}

include/uapi/linux/media/arm/mali-c55-config.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,6 @@ struct mali_c55_stats_buffer {
194194
__u32 reserved3[15];
195195
} __attribute__((packed));
196196

197-
/**
198-
* enum mali_c55_param_buffer_version - Mali-C55 parameters block versioning
199-
*
200-
* @MALI_C55_PARAM_BUFFER_V1: First version of Mali-C55 parameters block
201-
*/
202-
enum mali_c55_param_buffer_version {
203-
MALI_C55_PARAM_BUFFER_V1,
204-
};
205-
206197
/**
207198
* enum mali_c55_param_block_type - Enumeration of Mali-C55 parameter blocks
208199
*

0 commit comments

Comments
 (0)