[PATCH 5/6] drm/gma500: psb_spank() doesn't need it's own file
Thomas Zimmermann
tzimmermann at suse.de
Mon Feb 1 14:43:29 UTC 2021
Am 01.02.21 um 14:26 schrieb Patrik Jakobsson:
> Since everything else in accel_2d.c got removed we can move psb_spank()
> into psb_drv.c where it is used.
Nit: I think one says 'it is being used'.
>
> Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson at gmail.com>
Reviewed-by: Thomas Zimmermann <tzimmermann at suse.de>
> ---
> drivers/gpu/drm/gma500/Makefile | 1 -
> drivers/gpu/drm/gma500/accel_2d.c | 60 -------------------------------
> drivers/gpu/drm/gma500/psb_drv.c | 31 ++++++++++++++++
> 3 files changed, 31 insertions(+), 61 deletions(-)
> delete mode 100644 drivers/gpu/drm/gma500/accel_2d.c
>
> diff --git a/drivers/gpu/drm/gma500/Makefile b/drivers/gpu/drm/gma500/Makefile
> index 884ab1f9063e..6ee1ef389979 100644
> --- a/drivers/gpu/drm/gma500/Makefile
> +++ b/drivers/gpu/drm/gma500/Makefile
> @@ -4,7 +4,6 @@
> #
>
> gma500_gfx-y += \
> - accel_2d.o \
> backlight.o \
> blitter.o \
> cdv_device.o \
> diff --git a/drivers/gpu/drm/gma500/accel_2d.c b/drivers/gpu/drm/gma500/accel_2d.c
> deleted file mode 100644
> index 437bbb6af9e6..000000000000
> --- a/drivers/gpu/drm/gma500/accel_2d.c
> +++ /dev/null
> @@ -1,60 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/**************************************************************************
> - * Copyright (c) 2007-2011, Intel Corporation.
> - * All Rights Reserved.
> - *
> - * Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to
> - * develop this driver.
> - *
> - **************************************************************************/
> -
> -#include <linux/console.h>
> -#include <linux/delay.h>
> -#include <linux/errno.h>
> -#include <linux/init.h>
> -#include <linux/kernel.h>
> -#include <linux/mm.h>
> -#include <linux/module.h>
> -#include <linux/slab.h>
> -#include <linux/string.h>
> -#include <linux/tty.h>
> -
> -#include <drm/drm.h>
> -#include <drm/drm_crtc.h>
> -#include <drm/drm_fb_helper.h>
> -#include <drm/drm_fourcc.h>
> -
> -#include "psb_drv.h"
> -#include "psb_reg.h"
> -
> -/**
> - * psb_spank - reset the 2D engine
> - * @dev_priv: our PSB DRM device
> - *
> - * Soft reset the graphics engine and then reload the necessary registers.
> - * We use this at initialisation time but it will become relevant for
> - * accelerated X later
> - */
> -void psb_spank(struct drm_psb_private *dev_priv)
> -{
> - PSB_WSGX32(_PSB_CS_RESET_BIF_RESET | _PSB_CS_RESET_DPM_RESET |
> - _PSB_CS_RESET_TA_RESET | _PSB_CS_RESET_USE_RESET |
> - _PSB_CS_RESET_ISP_RESET | _PSB_CS_RESET_TSP_RESET |
> - _PSB_CS_RESET_TWOD_RESET, PSB_CR_SOFT_RESET);
> - PSB_RSGX32(PSB_CR_SOFT_RESET);
> -
> - msleep(1);
> -
> - PSB_WSGX32(0, PSB_CR_SOFT_RESET);
> - wmb();
> - PSB_WSGX32(PSB_RSGX32(PSB_CR_BIF_CTRL) | _PSB_CB_CTRL_CLEAR_FAULT,
> - PSB_CR_BIF_CTRL);
> - wmb();
> - (void) PSB_RSGX32(PSB_CR_BIF_CTRL);
> -
> - msleep(1);
> - PSB_WSGX32(PSB_RSGX32(PSB_CR_BIF_CTRL) & ~_PSB_CB_CTRL_CLEAR_FAULT,
> - PSB_CR_BIF_CTRL);
> - (void) PSB_RSGX32(PSB_CR_BIF_CTRL);
> - PSB_WSGX32(dev_priv->gtt.gatt_start, PSB_CR_BIF_TWOD_REQ_BASE);
> -}
> diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
> index 0bcab065242c..bd55b0c4f4b3 100644
> --- a/drivers/gpu/drm/gma500/psb_drv.c
> +++ b/drivers/gpu/drm/gma500/psb_drv.c
> @@ -12,6 +12,7 @@
> #include <linux/notifier.h>
> #include <linux/pm_runtime.h>
> #include <linux/spinlock.h>
> +#include <linux/delay.h>
>
> #include <asm/set_memory.h>
>
> @@ -92,6 +93,36 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
> static const struct drm_ioctl_desc psb_ioctls[] = {
> };
>
> +/**
> + * psb_spank - reset the 2D engine
> + * @dev_priv: our PSB DRM device
> + *
> + * Soft reset the graphics engine and then reload the necessary registers.
> + */
> +void psb_spank(struct drm_psb_private *dev_priv)
> +{
> + PSB_WSGX32(_PSB_CS_RESET_BIF_RESET | _PSB_CS_RESET_DPM_RESET |
> + _PSB_CS_RESET_TA_RESET | _PSB_CS_RESET_USE_RESET |
> + _PSB_CS_RESET_ISP_RESET | _PSB_CS_RESET_TSP_RESET |
> + _PSB_CS_RESET_TWOD_RESET, PSB_CR_SOFT_RESET);
> + PSB_RSGX32(PSB_CR_SOFT_RESET);
> +
> + msleep(1);
> +
> + PSB_WSGX32(0, PSB_CR_SOFT_RESET);
> + wmb();
> + PSB_WSGX32(PSB_RSGX32(PSB_CR_BIF_CTRL) | _PSB_CB_CTRL_CLEAR_FAULT,
> + PSB_CR_BIF_CTRL);
> + wmb();
> + (void) PSB_RSGX32(PSB_CR_BIF_CTRL);
> +
> + msleep(1);
> + PSB_WSGX32(PSB_RSGX32(PSB_CR_BIF_CTRL) & ~_PSB_CB_CTRL_CLEAR_FAULT,
> + PSB_CR_BIF_CTRL);
> + (void) PSB_RSGX32(PSB_CR_BIF_CTRL);
> + PSB_WSGX32(dev_priv->gtt.gatt_start, PSB_CR_BIF_TWOD_REQ_BASE);
> +}
> +
> static int psb_do_init(struct drm_device *dev)
> {
> struct drm_psb_private *dev_priv = dev->dev_private;
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20210201/84938f99/attachment.sig>
More information about the dri-devel
mailing list