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

Commit be4773e6 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux

Pull drm sti driver updates from Dave Airlie:
 "The sti driver had a requirement on some patches in Greg's tree, they
  are in, so I see no problems just merging this one now"

* 'drm-next' of git://people.freedesktop.org/~airlied/linux:
  drm/sti: load HQVDP firmware the first time HQVDP's plane is used
  drm/sti: fix typo issue in sti_mode_config_init
  drm/sti: set mixer background color through module param
  drm/sti: Remove local fbdev emulation Kconfig option
  drm/sti: remove redundant sign extensions
  drm/sti: hdmi use of_get_i2c_adapter_by_node interface
  drm/sti: hdmi fix i2c adapter device refcounting
  drm/sti: Do not export symbols
  drm/sti: Build monolithic driver
  drm/sti: Use drm_crtc_vblank_*() API
  drm/sti: Store correct CRTC index in events
  drm/sti: Select FW_LOADER
  drm/sti: Constify function pointer structs
parents f6d07dfc f20780f3
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -6,12 +6,6 @@ config DRM_STI
	select DRM_GEM_CMA_HELPER
	select DRM_KMS_CMA_HELPER
	select DRM_PANEL
	select FW_LOADER_USER_HELPER_FALLBACK
	select FW_LOADER
	help
	  Choose this option to enable DRM on STM stiH41x chipset

config DRM_STI_FBDEV
	bool "DRM frame buffer device for STMicroelectronics SoC stiH41x Serie"
	depends on DRM_STI
	help
	  Choose this option to enable FBDEV on top of DRM for STM stiH41x chipset
+9 −12
Original line number Diff line number Diff line
sticompositor-y := \
sti-drm-y := \
	sti_mixer.o \
	sti_gdp.o \
	sti_vid.o \
	sti_cursor.o \
	sti_compositor.o \
	sti_crtc.o \
	sti_plane.o

stihdmi-y := sti_hdmi.o \
	sti_plane.o \
	sti_crtc.o \
	sti_plane.o \
	sti_hdmi.o \
	sti_hdmi_tx3g0c55phy.o \
	sti_hdmi_tx3g4c28phy.o \

stidvo-y := sti_dvo.o \
	sti_awg_utils.o

obj-$(CONFIG_DRM_STI) = \
	sti_dvo.o \
	sti_awg_utils.o \
	sti_vtg.o \
	sti_vtac.o \
	stihdmi.o \
	sti_hda.o \
	sti_tvout.o \
	sticompositor.o \
	sti_hqvdp.o \
	stidvo.o \
	sti_drv.o

obj-$(CONFIG_DRM_STI) = sti-drm.o
+0 −4
Original line number Diff line number Diff line
@@ -65,7 +65,6 @@ static int awg_generate_instr(enum opcode opcode,

			mux = 0;
			data_enable = 0;
			arg = (arg << 22) >> 22;
			arg &= (0x3ff);
			break;
		case REPEAT:
@@ -77,14 +76,12 @@ static int awg_generate_instr(enum opcode opcode,

			mux = 0;
			data_enable = 0;
			arg = (arg << 22) >> 22;
			arg &= (0x3ff);
			break;
		case JUMP:
			mux = 0;
			data_enable = 0;
			arg |= 0x40; /* for jump instruction 7th bit is 1 */
			arg = (arg << 22) >> 22;
			arg &= 0x3ff;
			break;
		case STOP:
@@ -94,7 +91,6 @@ static int awg_generate_instr(enum opcode opcode,
		case RPTSET:
		case RPLSET:
		case HOLD:
			arg = (arg << 24) >> 24;
			arg &= (0x0ff);
			break;
		default:
+1 −3
Original line number Diff line number Diff line
@@ -263,7 +263,7 @@ static int sti_compositor_remove(struct platform_device *pdev)
	return 0;
}

static struct platform_driver sti_compositor_driver = {
struct platform_driver sti_compositor_driver = {
	.driver = {
		.name = "sti-compositor",
		.of_match_table = compositor_of_match,
@@ -272,8 +272,6 @@ static struct platform_driver sti_compositor_driver = {
	.remove = sti_compositor_remove,
};

module_platform_driver(sti_compositor_driver);

MODULE_AUTHOR("Benjamin Gaignard <benjamin.gaignard@st.com>");
MODULE_DESCRIPTION("STMicroelectronics SoC DRM driver");
MODULE_LICENSE("GPL");
+23 −22
Original line number Diff line number Diff line
@@ -226,7 +226,7 @@ static void sti_crtc_atomic_flush(struct drm_crtc *crtc,
	}
}

static struct drm_crtc_helper_funcs sti_crtc_helper_funcs = {
static const struct drm_crtc_helper_funcs sti_crtc_helper_funcs = {
	.enable = sti_crtc_enable,
	.disable = sti_crtc_disabling,
	.mode_fixup = sti_crtc_mode_fixup,
@@ -254,15 +254,17 @@ 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 drm_device *drm_dev;
	struct sti_compositor *compo =
		container_of(nb, struct sti_compositor, vtg_vblank_nb);
	int *crtc = data;
	struct drm_crtc *crtc = data;
	struct sti_mixer *mixer;
	unsigned long flags;
	struct sti_private *priv;
	unsigned int pipe;

	drm_dev = compo->mixer[*crtc]->drm_crtc.dev;
	priv = drm_dev->dev_private;
	priv = crtc->dev->dev_private;
	pipe = drm_crtc_index(crtc);
	mixer = compo->mixer[pipe];

	if ((event != VTG_TOP_FIELD_EVENT) &&
	    (event != VTG_BOTTOM_FIELD_EVENT)) {
@@ -270,30 +272,30 @@ int sti_crtc_vblank_cb(struct notifier_block *nb,
		return -EINVAL;
	}

	drm_handle_vblank(drm_dev, *crtc);
	drm_crtc_handle_vblank(crtc);

	spin_lock_irqsave(&drm_dev->event_lock, flags);
	if (compo->mixer[*crtc]->pending_event) {
		drm_send_vblank_event(drm_dev, -1,
				      compo->mixer[*crtc]->pending_event);
		drm_vblank_put(drm_dev, *crtc);
		compo->mixer[*crtc]->pending_event = NULL;
	spin_lock_irqsave(&crtc->dev->event_lock, flags);
	if (mixer->pending_event) {
		drm_crtc_send_vblank_event(crtc, mixer->pending_event);
		drm_crtc_vblank_put(crtc);
		mixer->pending_event = NULL;
	}
	spin_unlock_irqrestore(&drm_dev->event_lock, flags);
	spin_unlock_irqrestore(&crtc->dev->event_lock, flags);

	if (compo->mixer[*crtc]->status == STI_MIXER_DISABLING) {
	if (mixer->status == STI_MIXER_DISABLING) {
		struct drm_plane *p;

		/* Disable mixer only if all overlay planes (GDP and VDP)
		 * are disabled */
		list_for_each_entry(p, &drm_dev->mode_config.plane_list, head) {
		list_for_each_entry(p, &crtc->dev->mode_config.plane_list,
				    head) {
			struct sti_plane *plane = to_sti_plane(p);

			if ((plane->desc & STI_PLANE_TYPE_MASK) <= STI_VDP)
				if (plane->status != STI_PLANE_DISABLED)
					return 0;
		}
		sti_crtc_disable(&compo->mixer[*crtc]->drm_crtc);
		sti_crtc_disable(crtc);
	}

	return 0;
@@ -304,25 +306,26 @@ 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 drm_crtc *crtc = &compo->mixer[pipe]->drm_crtc;

	DRM_DEBUG_DRIVER("\n");

	if (sti_vtg_register_client(pipe == STI_MIXER_MAIN ?
			compo->vtg_main : compo->vtg_aux,
			vtg_vblank_nb, pipe)) {
			vtg_vblank_nb, crtc)) {
		DRM_ERROR("Cannot register VTG notifier\n");
		return -EINVAL;
	}

	return 0;
}
EXPORT_SYMBOL(sti_crtc_enable_vblank);

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 drm_crtc *crtc = &compo->mixer[pipe]->drm_crtc;

	DRM_DEBUG_DRIVER("\n");

@@ -332,13 +335,12 @@ void sti_crtc_disable_vblank(struct drm_device *drm_dev, unsigned int pipe)

	/* free the resources of the pending requests */
	if (compo->mixer[pipe]->pending_event) {
		drm_vblank_put(drm_dev, pipe);
		drm_crtc_vblank_put(crtc);
		compo->mixer[pipe]->pending_event = NULL;
	}
}
EXPORT_SYMBOL(sti_crtc_disable_vblank);

static struct drm_crtc_funcs sti_crtc_funcs = {
static const struct drm_crtc_funcs sti_crtc_funcs = {
	.set_config = drm_atomic_helper_set_config,
	.page_flip = drm_atomic_helper_page_flip,
	.destroy = sti_crtc_destroy,
@@ -357,7 +359,6 @@ bool sti_crtc_is_main(struct drm_crtc *crtc)

	return false;
}
EXPORT_SYMBOL(sti_crtc_is_main);

int sti_crtc_init(struct drm_device *drm_dev, struct sti_mixer *mixer,
		  struct drm_plane *primary, struct drm_plane *cursor)
Loading