From 9dd55dfe2e1b727eb4756f893814a03e67cb8327 Mon Sep 17 00:00:00 2001 From: Patrik Jakobsson Date: Mon, 1 Feb 2021 14:26:17 +0100 Subject: 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: Patrik Jakobsson Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20210201132617.1233-6-patrik.r.jakobsson@gmail.com --- drivers/gpu/drm/gma500/Makefile | 1 - drivers/gpu/drm/gma500/blitter.c | 43 ---------------------------------------- drivers/gpu/drm/gma500/blitter.h | 16 --------------- drivers/gpu/drm/gma500/gtt.c | 11 ---------- 4 files changed, 71 deletions(-) delete mode 100644 drivers/gpu/drm/gma500/blitter.c delete mode 100644 drivers/gpu/drm/gma500/blitter.h (limited to 'drivers/gpu/drm/gma500') diff --git a/drivers/gpu/drm/gma500/Makefile b/drivers/gpu/drm/gma500/Makefile index 160b75e28b0e..63012bf2485a 100644 --- a/drivers/gpu/drm/gma500/Makefile +++ b/drivers/gpu/drm/gma500/Makefile @@ -5,7 +5,6 @@ gma500_gfx-y += \ backlight.o \ - blitter.o \ cdv_device.o \ cdv_intel_crt.o \ cdv_intel_display.o \ diff --git a/drivers/gpu/drm/gma500/blitter.c b/drivers/gpu/drm/gma500/blitter.c deleted file mode 100644 index cb2504a4a15f..000000000000 --- a/drivers/gpu/drm/gma500/blitter.c +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * Copyright (c) 2014, Patrik Jakobsson - * All Rights Reserved. - * - * Authors: Patrik Jakobsson - */ - -#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; -} diff --git a/drivers/gpu/drm/gma500/blitter.h b/drivers/gpu/drm/gma500/blitter.h deleted file mode 100644 index 8d67dabd9ba3..000000000000 --- a/drivers/gpu/drm/gma500/blitter.h +++ /dev/null @@ -1,16 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * Copyright (c) 2014, Patrik Jakobsson - * All Rights Reserved. - * - * Authors: Patrik Jakobsson - */ - -#ifndef __BLITTER_H -#define __BLITTER_H - -struct drm_psb_private; - -extern int gma_blt_wait_idle(struct drm_psb_private *dev_priv); - -#endif diff --git a/drivers/gpu/drm/gma500/gtt.c b/drivers/gpu/drm/gma500/gtt.c index e884750bc123..df9b611b856a 100644 --- a/drivers/gpu/drm/gma500/gtt.c +++ b/drivers/gpu/drm/gma500/gtt.c @@ -11,7 +11,6 @@ #include -#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); } -- cgit v1.2.3