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

Commit 425a9a3a authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'topic/core-stuff-2014-05-05' of git://anongit.freedesktop.org/drm-intel into drm-next

Update pull request with drm core patches. Mostly some polish for the
primary plane stuff and a pile of patches all over from Thierry. Has
survived a few days in drm-intel-nightly without causing ill.

I've frobbed my scripts a bit to also tag my topic branches so that you
have something stable to pull - I've accidentally pushed a bunch more
patches onto this branch before you've taken the old pull request.

* tag 'topic/core-stuff-2014-05-05' of git://anongit.freedesktop.org/drm-intel:
  drm: Make drm_crtc_helper_disable() return void
  drm: Fix indentation of closing brace
  drm/dp: Fix typo in comment
  drm: Fixup flip-work kerneldoc
  drm/fb: Fix typos
  drm/edid: Cleanup kerneldoc
  drm/edid: Drop revision argument for drm_mode_std()
  drm: Try to acquire modeset lock on panic or sysrq
  drm: remove unused argument from drm_open_helper
  drm: Handle ->disable_plane failures correctly
  drm: Simplify fb refcounting rules around ->update_plane
  drm/crtc-helper: gc usless connector loop in disable_unused_functions
  drm/plane_helper: don't disable plane in destroy function
  drm/plane-helper: Fix primary plane scaling check
  drm: make mode_valid callback optional
  drm/edid: Fill PAR in AVI infoframe based on CEA mode list
parents ad222799 a74591d7
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1895,7 +1895,7 @@ void intel_crt_init(struct drm_device *dev)
          <para>
            The function filters out modes larger than
            <parameter>max_width</parameter> and <parameter>max_height</parameter>
            if specified. It then calls the connector
            if specified. It then calls the optional connector
            <methodname>mode_valid</methodname> helper operation for each mode in
            the probed list to check whether the mode is valid for the connector.
          </para>
@@ -2257,7 +2257,7 @@ void intel_crt_init(struct drm_device *dev)
          <para>
            Verify whether a mode is valid for the connector. Return MODE_OK for
            supported modes and one of the enum drm_mode_status values (MODE_*)
            for unsupported modes. This operation is mandatory.
            for unsupported modes. This operation is optional.
          </para>
          <para>
            As the mode rejection reason is currently not used beside for
+0 −7
Original line number Diff line number Diff line
@@ -743,12 +743,6 @@ static int ast_get_modes(struct drm_connector *connector)
	return 0;
}

static int ast_mode_valid(struct drm_connector *connector,
			  struct drm_display_mode *mode)
{
	return MODE_OK;
}

static void ast_connector_destroy(struct drm_connector *connector)
{
	struct ast_connector *ast_connector = to_ast_connector(connector);
@@ -765,7 +759,6 @@ ast_connector_detect(struct drm_connector *connector, bool force)
}

static const struct drm_connector_helper_funcs ast_connector_helper_funcs = {
	.mode_valid = ast_mode_valid,
	.get_modes = ast_get_modes,
	.best_encoder = ast_best_single_encoder,
};
+0 −7
Original line number Diff line number Diff line
@@ -225,12 +225,6 @@ int ptn3460_get_modes(struct drm_connector *connector)
	return num_modes;
}

static int ptn3460_mode_valid(struct drm_connector *connector,
		struct drm_display_mode *mode)
{
	return MODE_OK;
}

struct drm_encoder *ptn3460_best_encoder(struct drm_connector *connector)
{
	struct ptn3460_bridge *ptn_bridge;
@@ -242,7 +236,6 @@ struct drm_encoder *ptn3460_best_encoder(struct drm_connector *connector)

struct drm_connector_helper_funcs ptn3460_connector_helper_funcs = {
	.get_modes = ptn3460_get_modes,
	.mode_valid = ptn3460_mode_valid,
	.best_encoder = ptn3460_best_encoder,
};

+0 −8
Original line number Diff line number Diff line
@@ -505,13 +505,6 @@ static int cirrus_vga_get_modes(struct drm_connector *connector)
	return count;
}

static int cirrus_vga_mode_valid(struct drm_connector *connector,
				 struct drm_display_mode *mode)
{
	/* Any mode we've added is valid */
	return MODE_OK;
}

static struct drm_encoder *cirrus_connector_best_encoder(struct drm_connector
						  *connector)
{
@@ -546,7 +539,6 @@ static void cirrus_connector_destroy(struct drm_connector *connector)

struct drm_connector_helper_funcs cirrus_vga_connector_helper_funcs = {
	.get_modes = cirrus_vga_get_modes,
	.mode_valid = cirrus_vga_mode_valid,
	.best_encoder = cirrus_connector_best_encoder,
};

+17 −10
Original line number Diff line number Diff line
@@ -1145,16 +1145,19 @@ EXPORT_SYMBOL(drm_plane_cleanup);
 */
void drm_plane_force_disable(struct drm_plane *plane)
{
	struct drm_framebuffer *old_fb = plane->fb;
	int ret;

	if (!plane->fb)
	if (!old_fb)
		return;

	ret = plane->funcs->disable_plane(plane);
	if (ret)
	if (ret) {
		DRM_ERROR("failed to disable plane with busy fb\n");
		return;
	}
	/* disconnect the plane from the fb and crtc: */
	__drm_framebuffer_unreference(plane->fb);
	__drm_framebuffer_unreference(old_fb);
	plane->fb = NULL;
	plane->crtc = NULL;
}
@@ -2122,9 +2125,13 @@ int drm_mode_setplane(struct drm_device *dev, void *data,
	if (!plane_req->fb_id) {
		drm_modeset_lock_all(dev);
		old_fb = plane->fb;
		plane->funcs->disable_plane(plane);
		ret = plane->funcs->disable_plane(plane);
		if (!ret) {
			plane->crtc = NULL;
			plane->fb = NULL;
		} else {
			old_fb = NULL;
		}
		drm_modeset_unlock_all(dev);
		goto out;
	}
@@ -2193,16 +2200,18 @@ int drm_mode_setplane(struct drm_device *dev, void *data,
	}

	drm_modeset_lock_all(dev);
	old_fb = plane->fb;
	ret = plane->funcs->update_plane(plane, crtc, fb,
					 plane_req->crtc_x, plane_req->crtc_y,
					 plane_req->crtc_w, plane_req->crtc_h,
					 plane_req->src_x, plane_req->src_y,
					 plane_req->src_w, plane_req->src_h);
	if (!ret) {
		old_fb = plane->fb;
		plane->crtc = crtc;
		plane->fb = fb;
		fb = NULL;
	} else {
		old_fb = NULL;
	}
	drm_modeset_unlock_all(dev);

@@ -2245,9 +2254,7 @@ int drm_mode_set_config_internal(struct drm_mode_set *set)
	ret = crtc->funcs->set_config(set);
	if (ret == 0) {
		crtc->primary->crtc = crtc;

		/* crtc->fb must be updated by ->set_config, enforces this. */
		WARN_ON(fb != crtc->primary->fb);
		crtc->primary->fb = fb;
	}

	list_for_each_entry(tmp, &crtc->dev->mode_config.crtc_list, head) {
Loading