Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a6f6cdef authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'imx-drm-next-2018-07-20' of git://git.pengutronix.de/git/pza/linux into drm-next



drm/imx: cleanup and csi improvements

- Remove the unused struct imx_drm_crtc and the unused pipes field
  from imx_drm_device and replace drm_dev_unref with drm_dev_put.
- Extend CSI configuration to support RGB888 and BGR888 capture,
  as well as 16-bit RGB565 capture via a parallel bus.
- Add CPMEM support for negative interlace offsets, which is
  necessary to support writing captured bottom-top interlaced
  fields to memory with interleaved lines.

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

Link: https://patchwork.freedesktop.org/patch/msgid/1532100583.3438.9.camel@pengutronix.de
parents 50077507 81f2b25a
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@

struct imx_drm_device {
	struct drm_device			*drm;
	unsigned int				pipes;
	struct drm_atomic_state			*state;
};

@@ -229,7 +228,7 @@ static int imx_drm_bind(struct device *dev)
	imxdrm = devm_kzalloc(dev, sizeof(*imxdrm), GFP_KERNEL);
	if (!imxdrm) {
		ret = -ENOMEM;
		goto err_unref;
		goto err_put;
	}

	imxdrm->drm = drm;
@@ -306,8 +305,8 @@ static int imx_drm_bind(struct device *dev)
	component_unbind_all(drm->dev, drm);
err_kms:
	drm_mode_config_cleanup(drm);
err_unref:
	drm_dev_unref(drm);
err_put:
	drm_dev_put(drm);

	return ret;
}
@@ -327,7 +326,7 @@ static void imx_drm_unbind(struct device *dev)
	component_unbind_all(drm->dev, drm);
	dev_set_drvdata(dev, NULL);

	drm_dev_unref(drm);
	drm_dev_put(drm);
}

static const struct component_master_ops imx_drm_ops = {
+0 −1
Original line number Diff line number Diff line
@@ -10,7 +10,6 @@ struct drm_display_mode;
struct drm_encoder;
struct drm_framebuffer;
struct drm_plane;
struct imx_drm_crtc;
struct platform_device;

struct imx_crtc_state {
+6 −3
Original line number Diff line number Diff line
@@ -611,6 +611,9 @@ static int imx_ldb_bind(struct device *dev, struct device *master, void *data)
		return PTR_ERR(imx_ldb->regmap);
	}

	/* disable LDB by resetting the control register to POR default */
	regmap_write(imx_ldb->regmap, IOMUXC_GPR2, 0);

	imx_ldb->dev = dev;

	if (of_id)
@@ -651,14 +654,14 @@ static int imx_ldb_bind(struct device *dev, struct device *master, void *data)
		if (ret || i < 0 || i > 1)
			return -EINVAL;

		if (!of_device_is_available(child))
			continue;

		if (dual && i > 0) {
			dev_warn(dev, "dual-channel mode, ignoring second output\n");
			continue;
		}

		if (!of_device_is_available(child))
			continue;

		channel = &imx_ldb->channel[i];
		channel->ldb = imx_ldb;
		channel->chno = i;
+0 −1
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@
struct ipu_crtc {
	struct device		*dev;
	struct drm_crtc		base;
	struct imx_drm_crtc	*imx_crtc;

	/* plane[0] is the full plane, plane[1] is the partial plane */
	struct ipu_plane	*plane[2];
+13 −2
Original line number Diff line number Diff line
@@ -269,9 +269,20 @@ EXPORT_SYMBOL_GPL(ipu_cpmem_set_uv_offset);

void ipu_cpmem_interlaced_scan(struct ipuv3_channel *ch, int stride)
{
	u32 ilo, sly;

	if (stride < 0) {
		stride = -stride;
		ilo = 0x100000 - (stride / 8);
	} else {
		ilo = stride / 8;
	}

	sly = (stride * 2) - 1;

	ipu_ch_param_write_field(ch, IPU_FIELD_SO, 1);
	ipu_ch_param_write_field(ch, IPU_FIELD_ILO, stride / 8);
	ipu_ch_param_write_field(ch, IPU_FIELD_SLY, (stride * 2) - 1);
	ipu_ch_param_write_field(ch, IPU_FIELD_ILO, ilo);
	ipu_ch_param_write_field(ch, IPU_FIELD_SLY, sly);
};
EXPORT_SYMBOL_GPL(ipu_cpmem_interlaced_scan);

Loading