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

Commit 5c3fe8b0 authored by Ben Widawsky's avatar Ben Widawsky Committed by Daniel Vetter
Browse files

drm/i915: Move fbc members out of line



Signed-off-by: default avatarBen Widawsky <ben@bwidawsk.net>
[danvet: Resolve conflict with Damien's FBC_CHIP_DEFAULT no fbc
reason.]
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent b2f21b4d
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1492,7 +1492,7 @@ static int i915_fbc_status(struct seq_file *m, void *unused)
		seq_puts(m, "FBC enabled\n");
		seq_puts(m, "FBC enabled\n");
	} else {
	} else {
		seq_puts(m, "FBC disabled: ");
		seq_puts(m, "FBC disabled: ");
		switch (dev_priv->no_fbc_reason) {
		switch (dev_priv->fbc.no_fbc_reason) {
		case FBC_NO_OUTPUT:
		case FBC_NO_OUTPUT:
			seq_puts(m, "no outputs");
			seq_puts(m, "no outputs");
			break;
			break;
+29 −21
Original line number Original line Diff line number Diff line
@@ -528,9 +528,25 @@ struct i915_hw_context {
	struct i915_ctx_hang_stats hang_stats;
	struct i915_ctx_hang_stats hang_stats;
};
};


enum no_fbc_reason {
struct i915_fbc {
	unsigned long size;
	unsigned int fb_id;
	enum plane plane;
	int y;

	struct drm_mm_node *compressed_fb;
	struct drm_mm_node *compressed_llb;

	struct intel_fbc_work {
		struct delayed_work work;
		struct drm_crtc *crtc;
		struct drm_framebuffer *fb;
		int interval;
	} *fbc_work;

	enum {
		FBC_NO_OUTPUT, /* no outputs enabled to compress */
		FBC_NO_OUTPUT, /* no outputs enabled to compress */
	FBC_STOLEN_TOO_SMALL, /* not enough space to hold compressed buffers */
		FBC_STOLEN_TOO_SMALL, /* not enough space for buffers */
		FBC_UNSUPPORTED_MODE, /* interlace or doublescanned mode */
		FBC_UNSUPPORTED_MODE, /* interlace or doublescanned mode */
		FBC_MODE_TOO_LARGE, /* mode too large for compression */
		FBC_MODE_TOO_LARGE, /* mode too large for compression */
		FBC_BAD_PLANE, /* fbc not supported on plane */
		FBC_BAD_PLANE, /* fbc not supported on plane */
@@ -538,8 +554,10 @@ enum no_fbc_reason {
		FBC_MULTIPLE_PIPES, /* more than one pipe active */
		FBC_MULTIPLE_PIPES, /* more than one pipe active */
		FBC_MODULE_PARAM,
		FBC_MODULE_PARAM,
		FBC_CHIP_DEFAULT, /* disabled by default on this chip */
		FBC_CHIP_DEFAULT, /* disabled by default on this chip */
	} no_fbc_reason;
};
};



enum intel_pch {
enum intel_pch {
	PCH_NONE = 0,	/* No PCH present */
	PCH_NONE = 0,	/* No PCH present */
	PCH_IBX,	/* Ibexpeak PCH */
	PCH_IBX,	/* Ibexpeak PCH */
@@ -1059,12 +1077,7 @@ typedef struct drm_i915_private {


	int num_plane;
	int num_plane;


	unsigned long cfb_size;
	struct i915_fbc fbc;
	unsigned int cfb_fb;
	enum plane cfb_plane;
	int cfb_y;
	struct intel_fbc_work *fbc_work;

	struct intel_opregion opregion;
	struct intel_opregion opregion;
	struct intel_vbt_data vbt;
	struct intel_vbt_data vbt;


@@ -1142,11 +1155,6 @@ typedef struct drm_i915_private {
	/* Haswell power well */
	/* Haswell power well */
	struct i915_power_well power_well;
	struct i915_power_well power_well;


	enum no_fbc_reason no_fbc_reason;

	struct drm_mm_node *compressed_fb;
	struct drm_mm_node *compressed_llb;

	struct i915_gpu_error gpu_error;
	struct i915_gpu_error gpu_error;


	struct drm_i915_gem_object *vlv_pctx;
	struct drm_i915_gem_object *vlv_pctx;
+10 −10
Original line number Original line Diff line number Diff line
@@ -120,7 +120,7 @@ static int i915_setup_compression(struct drm_device *dev, int size)
		if (!compressed_llb)
		if (!compressed_llb)
			goto err_fb;
			goto err_fb;


		dev_priv->compressed_llb = compressed_llb;
		dev_priv->fbc.compressed_llb = compressed_llb;


		I915_WRITE(FBC_CFB_BASE,
		I915_WRITE(FBC_CFB_BASE,
			   dev_priv->mm.stolen_base + compressed_fb->start);
			   dev_priv->mm.stolen_base + compressed_fb->start);
@@ -128,8 +128,8 @@ static int i915_setup_compression(struct drm_device *dev, int size)
			   dev_priv->mm.stolen_base + compressed_llb->start);
			   dev_priv->mm.stolen_base + compressed_llb->start);
	}
	}


	dev_priv->compressed_fb = compressed_fb;
	dev_priv->fbc.compressed_fb = compressed_fb;
	dev_priv->cfb_size = size;
	dev_priv->fbc.size = size;


	DRM_DEBUG_KMS("reserved %d bytes of contiguous stolen space for FBC\n",
	DRM_DEBUG_KMS("reserved %d bytes of contiguous stolen space for FBC\n",
		      size);
		      size);
@@ -150,7 +150,7 @@ int i915_gem_stolen_setup_compression(struct drm_device *dev, int size)
	if (dev_priv->mm.stolen_base == 0)
	if (dev_priv->mm.stolen_base == 0)
		return -ENODEV;
		return -ENODEV;


	if (size < dev_priv->cfb_size)
	if (size < dev_priv->fbc.size)
		return 0;
		return 0;


	/* Release any current block */
	/* Release any current block */
@@ -163,16 +163,16 @@ void i915_gem_stolen_cleanup_compression(struct drm_device *dev)
{
{
	struct drm_i915_private *dev_priv = dev->dev_private;
	struct drm_i915_private *dev_priv = dev->dev_private;


	if (dev_priv->cfb_size == 0)
	if (dev_priv->fbc.size == 0)
		return;
		return;


	if (dev_priv->compressed_fb)
	if (dev_priv->fbc.compressed_fb)
		drm_mm_put_block(dev_priv->compressed_fb);
		drm_mm_put_block(dev_priv->fbc.compressed_fb);


	if (dev_priv->compressed_llb)
	if (dev_priv->fbc.compressed_llb)
		drm_mm_put_block(dev_priv->compressed_llb);
		drm_mm_put_block(dev_priv->fbc.compressed_llb);


	dev_priv->cfb_size = 0;
	dev_priv->fbc.size = 0;
}
}


void i915_gem_cleanup_stolen(struct drm_device *dev)
void i915_gem_cleanup_stolen(struct drm_device *dev)
+3 −3
Original line number Original line Diff line number Diff line
@@ -3408,7 +3408,7 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc)
	intel_crtc_wait_for_pending_flips(crtc);
	intel_crtc_wait_for_pending_flips(crtc);
	drm_vblank_off(dev, pipe);
	drm_vblank_off(dev, pipe);


	if (dev_priv->cfb_plane == plane)
	if (dev_priv->fbc.plane == plane)
		intel_disable_fbc(dev);
		intel_disable_fbc(dev);


	intel_crtc_update_cursor(crtc, false);
	intel_crtc_update_cursor(crtc, false);
@@ -3481,7 +3481,7 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)
	drm_vblank_off(dev, pipe);
	drm_vblank_off(dev, pipe);


	/* FBC must be disabled before disabling the plane on HSW. */
	/* FBC must be disabled before disabling the plane on HSW. */
	if (dev_priv->cfb_plane == plane)
	if (dev_priv->fbc.plane == plane)
		intel_disable_fbc(dev);
		intel_disable_fbc(dev);


	hsw_disable_ips(intel_crtc);
	hsw_disable_ips(intel_crtc);
@@ -3720,7 +3720,7 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
	intel_crtc_wait_for_pending_flips(crtc);
	intel_crtc_wait_for_pending_flips(crtc);
	drm_vblank_off(dev, pipe);
	drm_vblank_off(dev, pipe);


	if (dev_priv->cfb_plane == plane)
	if (dev_priv->fbc.plane == plane)
		intel_disable_fbc(dev);
		intel_disable_fbc(dev);


	intel_crtc_dpms_overlay(intel_crtc, false);
	intel_crtc_dpms_overlay(intel_crtc, false);
+0 −7
Original line number Original line Diff line number Diff line
@@ -549,13 +549,6 @@ struct intel_unpin_work {
	bool enable_stall_check;
	bool enable_stall_check;
};
};


struct intel_fbc_work {
	struct delayed_work work;
	struct drm_crtc *crtc;
	struct drm_framebuffer *fb;
	int interval;
};

int intel_pch_rawclk(struct drm_device *dev);
int intel_pch_rawclk(struct drm_device *dev);


int intel_connector_update_modes(struct drm_connector *connector,
int intel_connector_update_modes(struct drm_connector *connector,
Loading