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

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

Merge branch 'sti-drm-next-2016-09-20' of https://github.com/vinceab/linux into drm-next

Here are some patches for drm-next.
It contains:
- minor fixes for typo and warning.
- sparse and coccicheck warning fixes
- bunch of patches fixing issues found while testing drm/sti with an
atomic version of weston
- the removal of the support of stih415-416 sti platform

* 'sti-drm-next-2016-09-20' of https://github.com/vinceab/linux:
  drm/sti: remove stih415-416 platform support
  drm/sti: fix compositor debugfs creation
  drm/sti: use valid video mode
  drm/sti: in crtc_atomic_flush, enable only planes of this crtc
  drm/sti: use vtg array instead of vtg_main/aux
  drm/sti: use different notifier_block for each pipe
  drm/sti: fix atomic_disable check
  drm/sti: run gdp init sequence only once
  drm/sti: run hqvdp init sequence only once
  drm/sti: fix debug logs
  drm/sti: dpms function missing for HDMI connector
  drm/sti: Fix sparse warnings
  drm: sti: fix coccicheck warnings
  drm: sti: Replace drm_fb_get_bpp_depth() with drm_format_plane_cpp()
parents f8049dd8 b4bba92d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
config DRM_STI
	tristate "DRM Support for STMicroelectronics SoC stiH41x Series"
	depends on DRM && (SOC_STIH415 || SOC_STIH416 || ARCH_MULTIPLATFORM)
	tristate "DRM Support for STMicroelectronics SoC stiH4xx Series"
	depends on DRM && (ARCH_STI || ARCH_MULTIPLATFORM)
	select RESET_CONTROLLER
	select DRM_KMS_HELPER
	select DRM_GEM_CMA_HELPER
@@ -9,4 +9,4 @@ config DRM_STI
	select FW_LOADER
	select SND_SOC_HDMI_CODEC if SND_SOC
	help
	  Choose this option to enable DRM on STM stiH41x chipset
	  Choose this option to enable DRM on STM stiH4xx chipset
+0 −1
Original line number Diff line number Diff line
@@ -9,7 +9,6 @@ sti-drm-y := \
	sti_crtc.o \
	sti_plane.o \
	sti_hdmi.o \
	sti_hdmi_tx3g0c55phy.o \
	sti_hdmi_tx3g4c28phy.o \
	sti_dvo.o \
	sti_awg_utils.o \
+15 −36
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@
/*
 * stiH407 compositor properties
 */
struct sti_compositor_data stih407_compositor_data = {
static const struct sti_compositor_data stih407_compositor_data = {
	.nb_subdev = 8,
	.subdev_desc = {
			{STI_CURSOR_SUBDEV, (int)STI_CURSOR, 0x000},
@@ -39,38 +39,18 @@ struct sti_compositor_data stih407_compositor_data = {
	},
};

/*
 * stiH416 compositor properties
 * Note:
 * on stih416 MIXER_AUX has a different base address from MIXER_MAIN
 * Moreover, GDPx is different for Main and Aux Mixer. So this subdev map does
 * not fit for stiH416 if we want to enable the MIXER_AUX.
 */
struct sti_compositor_data stih416_compositor_data = {
	.nb_subdev = 3,
	.subdev_desc = {
			{STI_GPD_SUBDEV, (int)STI_GDP_0, 0x100},
			{STI_GPD_SUBDEV, (int)STI_GDP_1, 0x200},
			{STI_MIXER_MAIN_SUBDEV, STI_MIXER_MAIN, 0xC00}
	},
};

int sti_compositor_debufs_init(struct sti_compositor *compo,
int sti_compositor_debugfs_init(struct sti_compositor *compo,
				struct drm_minor *minor)
{
	int ret = 0, i;
	unsigned int i;

	for (i = 0; compo->vid[i]; i++) {
		ret = vid_debugfs_init(compo->vid[i], minor);
		if (ret)
			return ret;
	}
	for (i = 0; i < STI_MAX_VID; i++)
		if (compo->vid[i])
			vid_debugfs_init(compo->vid[i], minor);

	for (i = 0; compo->mixer[i]; i++) {
		ret = sti_mixer_debugfs_init(compo->mixer[i], minor);
		if (ret)
			return ret;
	}
	for (i = 0; i < STI_MAX_MIXER; i++)
		if (compo->mixer[i])
			sti_mixer_debugfs_init(compo->mixer[i], minor);

	return 0;
}
@@ -183,9 +163,6 @@ static const struct component_ops sti_compositor_ops = {

static const struct of_device_id compositor_of_match[] = {
	{
		.compatible = "st,stih416-compositor",
		.data = &stih416_compositor_data,
	}, {
		.compatible = "st,stih407-compositor",
		.data = &stih407_compositor_data,
	}, {
@@ -201,6 +178,7 @@ static int sti_compositor_probe(struct platform_device *pdev)
	struct device_node *vtg_np;
	struct sti_compositor *compo;
	struct resource *res;
	unsigned int i;

	compo = devm_kzalloc(dev, sizeof(*compo), GFP_KERNEL);
	if (!compo) {
@@ -208,7 +186,8 @@ static int sti_compositor_probe(struct platform_device *pdev)
		return -ENOMEM;
	}
	compo->dev = dev;
	compo->vtg_vblank_nb.notifier_call = sti_crtc_vblank_cb;
	for (i = 0; i < STI_MAX_MIXER; i++)
		compo->vtg_vblank_nb[i].notifier_call = sti_crtc_vblank_cb;

	/* populate data structure depending on compatibility */
	BUG_ON(!of_match_node(compositor_of_match, np)->data);
@@ -266,12 +245,12 @@ static int sti_compositor_probe(struct platform_device *pdev)

	vtg_np = of_parse_phandle(pdev->dev.of_node, "st,vtg", 0);
	if (vtg_np)
		compo->vtg_main = of_vtg_find(vtg_np);
		compo->vtg[STI_MIXER_MAIN] = of_vtg_find(vtg_np);
	of_node_put(vtg_np);

	vtg_np = of_parse_phandle(pdev->dev.of_node, "st,vtg", 1);
	if (vtg_np)
		compo->vtg_aux = of_vtg_find(vtg_np);
		compo->vtg[STI_MIXER_AUX] = of_vtg_find(vtg_np);
	of_node_put(vtg_np);

	platform_set_drvdata(pdev, compo);
+6 −8
Original line number Diff line number Diff line
@@ -60,9 +60,8 @@ struct sti_compositor_data {
 * @rst_aux: reset control of the aux path
 * @mixer: array of mixers
 * @vid: array of vids
 * @vtg_main: vtg for main data path
 * @vtg_aux: vtg for auxillary data path
 * @vtg_vblank_nb: callback for VTG VSYNC notification
 * @vtg: array of vtgs
 * @vtg_vblank_nb: array of callbacks for VTG VSYNC notification
 */
struct sti_compositor {
	struct device *dev;
@@ -76,12 +75,11 @@ struct sti_compositor {
	struct reset_control *rst_aux;
	struct sti_mixer *mixer[STI_MAX_MIXER];
	struct sti_vid *vid[STI_MAX_VID];
	struct sti_vtg *vtg_main;
	struct sti_vtg *vtg_aux;
	struct notifier_block vtg_vblank_nb;
	struct sti_vtg *vtg[STI_MAX_MIXER];
	struct notifier_block vtg_vblank_nb[STI_MAX_MIXER];
};

int sti_compositor_debufs_init(struct sti_compositor *compo,
int sti_compositor_debugfs_init(struct sti_compositor *compo,
				struct drm_minor *minor);

#endif
+14 −12
Original line number Diff line number Diff line
@@ -86,8 +86,7 @@ sti_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode)
		goto pix_error;
	}

	sti_vtg_set_config(mixer->id == STI_MIXER_MAIN ?
			compo->vtg_main : compo->vtg_aux, &crtc->mode);
	sti_vtg_set_config(compo->vtg[mixer->id], &crtc->mode);

	if (sti_mixer_active_video_area(mixer, &crtc->mode)) {
		DRM_ERROR("Can't set active video area\n");
@@ -166,6 +165,10 @@ static void sti_crtc_atomic_flush(struct drm_crtc *crtc,

		switch (plane->status) {
		case STI_PLANE_UPDATED:
			/* ignore update for other CRTC */
			if (p->state->crtc != crtc)
				continue;

			/* update planes tag as updated */
			DRM_DEBUG_DRIVER("update plane %s\n",
					 sti_plane_to_str(plane));
@@ -244,8 +247,7 @@ static int sti_crtc_set_property(struct drm_crtc *crtc,
int sti_crtc_vblank_cb(struct notifier_block *nb,
		       unsigned long event, void *data)
{
	struct sti_compositor *compo =
		container_of(nb, struct sti_compositor, vtg_vblank_nb);
	struct sti_compositor *compo;
	struct drm_crtc *crtc = data;
	struct sti_mixer *mixer;
	unsigned long flags;
@@ -254,6 +256,7 @@ int sti_crtc_vblank_cb(struct notifier_block *nb,

	priv = crtc->dev->dev_private;
	pipe = drm_crtc_index(crtc);
	compo = container_of(nb, struct sti_compositor, vtg_vblank_nb[pipe]);
	mixer = compo->mixer[pipe];

	if ((event != VTG_TOP_FIELD_EVENT) &&
@@ -295,14 +298,13 @@ int sti_crtc_enable_vblank(struct drm_device *dev, unsigned int pipe)
{
	struct sti_private *dev_priv = dev->dev_private;
	struct sti_compositor *compo = dev_priv->compo;
	struct notifier_block *vtg_vblank_nb = &compo->vtg_vblank_nb;
	struct notifier_block *vtg_vblank_nb = &compo->vtg_vblank_nb[pipe];
	struct drm_crtc *crtc = &compo->mixer[pipe]->drm_crtc;
	struct sti_vtg *vtg = compo->vtg[pipe];

	DRM_DEBUG_DRIVER("\n");

	if (sti_vtg_register_client(pipe == STI_MIXER_MAIN ?
			compo->vtg_main : compo->vtg_aux,
			vtg_vblank_nb, crtc)) {
	if (sti_vtg_register_client(vtg, vtg_vblank_nb, crtc)) {
		DRM_ERROR("Cannot register VTG notifier\n");
		return -EINVAL;
	}
@@ -314,13 +316,13 @@ void sti_crtc_disable_vblank(struct drm_device *drm_dev, unsigned int pipe)
{
	struct sti_private *priv = drm_dev->dev_private;
	struct sti_compositor *compo = priv->compo;
	struct notifier_block *vtg_vblank_nb = &compo->vtg_vblank_nb;
	struct notifier_block *vtg_vblank_nb = &compo->vtg_vblank_nb[pipe];
	struct drm_crtc *crtc = &compo->mixer[pipe]->drm_crtc;
	struct sti_vtg *vtg = compo->vtg[pipe];

	DRM_DEBUG_DRIVER("\n");

	if (sti_vtg_unregister_client(pipe == STI_MIXER_MAIN ?
			compo->vtg_main : compo->vtg_aux, vtg_vblank_nb))
	if (sti_vtg_unregister_client(vtg, vtg_vblank_nb))
		DRM_DEBUG_DRIVER("Warning: cannot unregister VTG notifier\n");

	/* free the resources of the pending requests */
@@ -336,7 +338,7 @@ static int sti_crtc_late_register(struct drm_crtc *crtc)
	struct sti_compositor *compo = dev_get_drvdata(mixer->dev);

	if (drm_crtc_index(crtc) == 0)
		return sti_compositor_debufs_init(compo, crtc->dev->primary);
		return sti_compositor_debugfs_init(compo, crtc->dev->primary);

	return 0;
}
Loading