Commit 9dd55dfe authored by Patrik Jakobsson's avatar Patrik Jakobsson
Browse files

drm/gma500: Never wait for blits



Blits cannot happen anymore since we removed the 2d accel code. Stop
checking for a busy blitter and remove the remaining blitter code.

Signed-off-by: default avatarPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
Reviewed-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20210201132617.1233-6-patrik.r.jakobsson@gmail.com
parent 5c209d80
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@

gma500_gfx-y += \
	  backlight.o \
	  blitter.o \
	  cdv_device.o \
	  cdv_intel_crt.o \
	  cdv_intel_display.o \

drivers/gpu/drm/gma500/blitter.c

deleted100644 → 0
+0 −43
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2014, Patrik Jakobsson
 * All Rights Reserved.
 *
 * Authors: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
 */

#include "psb_drv.h"

#include "blitter.h"
#include "psb_reg.h"

/* Wait for the blitter to be completely idle */
int gma_blt_wait_idle(struct drm_psb_private *dev_priv)
{
	unsigned long stop = jiffies + HZ;
	int busy = 1;

	/* NOP for Cedarview */
	if (IS_CDV(dev_priv->dev))
		return 0;

	/* First do a quick check */
	if ((PSB_RSGX32(PSB_CR_2D_SOCIF) == _PSB_C2_SOCIF_EMPTY) &&
	    ((PSB_RSGX32(PSB_CR_2D_BLIT_STATUS) & _PSB_C2B_STATUS_BUSY) == 0))
		return 0;

	do {
		busy = (PSB_RSGX32(PSB_CR_2D_SOCIF) != _PSB_C2_SOCIF_EMPTY);
	} while (busy && !time_after_eq(jiffies, stop));

	if (busy)
		return -EBUSY;

	do {
		busy = ((PSB_RSGX32(PSB_CR_2D_BLIT_STATUS) &
			_PSB_C2B_STATUS_BUSY) != 0);
	} while (busy && !time_after_eq(jiffies, stop));

	/* If still busy, we probably have a hang */
	return (busy) ? -EBUSY : 0;
}

drivers/gpu/drm/gma500/blitter.h

deleted100644 → 0
+0 −16
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2014, Patrik Jakobsson
 * All Rights Reserved.
 *
 * Authors: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
 */

#ifndef __BLITTER_H
#define __BLITTER_H

struct drm_psb_private;

extern int gma_blt_wait_idle(struct drm_psb_private *dev_priv);

#endif
+0 −11
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@

#include <asm/set_memory.h>

#include "blitter.h"
#include "psb_drv.h"


@@ -229,18 +228,9 @@ void psb_gtt_unpin(struct gtt_range *gt)
	struct drm_device *dev = gt->gem.dev;
	struct drm_psb_private *dev_priv = dev->dev_private;
	u32 gpu_base = dev_priv->gtt.gatt_start;
	int ret;

	/* While holding the gtt_mutex no new blits can be initiated */
	mutex_lock(&dev_priv->gtt_mutex);

	/* Wait for any possible usage of the memory to be finished */
	ret = gma_blt_wait_idle(dev_priv);
	if (ret) {
		DRM_ERROR("Failed to idle the blitter, unpin failed!");
		goto out;
	}

	WARN_ON(!gt->in_gart);

	gt->in_gart--;
@@ -251,7 +241,6 @@ void psb_gtt_unpin(struct gtt_range *gt)
		psb_gtt_detach_pages(gt);
	}

out:
	mutex_unlock(&dev_priv->gtt_mutex);
}