[Intel-gfx] [PATCH 1/3] drm/i915: add SNB and IVB video sprite support v6

Lan, Hai hai.lan at intel.com
Wed Feb 15 04:18:42 CET 2012


Hi Jesse,
I have tested the video sprite with intel-gpu-tools on SNB and found a bug.
When setting overlay position with x<0, it will divide 0 and make drm driver crash. 
I have fixed it. Please see my patch. Thanks.

Hai Lan

> -----Original Message-----
> From: intel-gfx-bounces+hai.lan=intel.com at lists.freedesktop.org
> [mailto:intel-gfx-bounces+hai.lan=intel.com at lists.freedesktop.org] On
> Behalf Of Jesse Barnes
> Sent: Wednesday, December 14, 2011 5:20 AM
> To: intel-gfx at lists.freedesktop.org
> Subject: [Intel-gfx] [PATCH 1/3] drm/i915: add SNB and IVB video sprite
> support v6
> 
> The video sprites support various video surface formats natively and can
> handle scaling as well.  So add support for them using the new DRM core
> sprite support functions.


> +static bool
> +sandybridge_compute_sprite_srwm(struct drm_device *dev, int plane,
> +				uint32_t sprite_width, int pixel_size,
> +				const struct intel_watermark_params *display,
> +				int latency_ns, int *sprite_wm)
> +{
> +	struct drm_crtc *crtc;
> +	unsigned long line_time_us;
> +	int clock;
> +	int line_count, line_size;
> +	int small, large;
> +	int entries;
> +
> +	if (!latency_ns) {
> +		*sprite_wm = 0;
> +		return false;
> +	}
> +
> +	crtc = intel_get_crtc_for_plane(dev, plane);
> +	clock = crtc->mode.clock;
> +
> +	line_time_us = (sprite_width * 1000) / clock;
> +	line_count = (latency_ns / line_time_us + 1000) / 1000;
> +	line_size = sprite_width * pixel_size;
> +

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-drm-i915-fix-a-bug-for-setting-overlay.patch
Type: application/octet-stream
Size: 1097 bytes
Desc: 0001-drm-i915-fix-a-bug-for-setting-overlay.patch
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20120215/d8d1e23c/attachment.obj>


More information about the Intel-gfx mailing list