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

Commit f3215be9 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge branch 'exynos-drm-fixes' of...

Merge branch 'exynos-drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next

Summary:
- change exynos file license
  . Most of exynos files had been copied from some randome
    file and not updated correctly(wrong company name used).
    This was our mistakes so chagnes it correctly. For this,
    I'm not sure that this patch should go to -fix or -next.
    So please give me any comment if there is any problem.
- consider buffer allocation without iommu
  . Without iommu, dma_alloc_attrs function allocates some
    memory region and returns cpu address so this patch makes
    the cpu address to be set to buf->kvaddr correctly
- cleanups to ipp relevant codes.
- use common finish page flip function
  . to avoid the duplication of same code, use
    exynos_drm_crtc_finish_pageflip function commonly instead
    of each one.
- fix fimd resume issue.
  . when fimd was turned off by suspend, there was one issue that
    the fimd wasn't turned on by resume so fix it chaing resume
    condition.

* 'exynos-drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos: (25 commits)
  drm/exynos: move finish page flip to a common place
  drm/exynos: fimd: modify condition in fimd resume
  drm/exynos: Use devm_clk_get in exynos_drm_gsc.c
  drm/exynos: Remove redundant NULL check in exynos_drm_gsc.c
  drm/exynos: Remove explicit freeing using devm_* APIs in exynos_drm_gsc.c
  drm/exynos: Use devm_clk_get in exynos_drm_rotator.c
  drm/exynos: Remove redundant NULL check in exynos_drm_rotator.c
  drm/exynos: Remove unnecessary devm_* freeing APIs in exynos_drm_rotator.c
  drm/exynos: Use devm_clk_get in exynos_drm_fimc.c
  drm/exynos: Remove redundant NULL check
  drm/exynos: Remove explicit freeing using devm_* APIs in exynos_drm_fimc.c
  drm/exynos: Use devm_kzalloc in exynos_drm_ipp.c
  drm/exynos: fix gem buffer allocation type checking
  drm/exynos: remove needless parenthesis.
  drm/exynos: fix incorrect interrupt induced by m2m operation.
  drm/exynos: remove color bar pattern operation.
  drm/exynos: correct some comments to abbreviation.
  drm/exynos: fix build warning.
  drm/exynos: consider both case of vflip and hflip.
  drm/exynos: remove needless error handling to property.
  ...
parents eda85d6a 663d8766
Loading
Loading
Loading
Loading
+53 −26
Original line number Original line Diff line number Diff line
@@ -3,24 +3,10 @@
 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
 * Author: Inki Dae <inki.dae@samsung.com>
 * Author: Inki Dae <inki.dae@samsung.com>
 *
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * This program is free software; you can redistribute  it and/or modify it
 * copy of this software and associated documentation files (the "Software"),
 * under  the terms of  the GNU General  Public License as published by the
 * to deal in the Software without restriction, including without limitation
 * Free Software Foundation;  either version 2 of the  License, or (at your
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * option) any later version.
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 */
 */


#include <drm/drmP.h>
#include <drm/drmP.h>
@@ -29,6 +15,7 @@
#include "exynos_drm_drv.h"
#include "exynos_drm_drv.h"
#include "exynos_drm_gem.h"
#include "exynos_drm_gem.h"
#include "exynos_drm_buf.h"
#include "exynos_drm_buf.h"
#include "exynos_drm_iommu.h"


static int lowlevel_buffer_allocate(struct drm_device *dev,
static int lowlevel_buffer_allocate(struct drm_device *dev,
		unsigned int flags, struct exynos_drm_gem_buf *buf)
		unsigned int flags, struct exynos_drm_gem_buf *buf)
@@ -51,7 +38,7 @@ static int lowlevel_buffer_allocate(struct drm_device *dev,
	 * region will be allocated else physically contiguous
	 * region will be allocated else physically contiguous
	 * as possible.
	 * as possible.
	 */
	 */
	if (flags & EXYNOS_BO_CONTIG)
	if (!(flags & EXYNOS_BO_NONCONTIG))
		dma_set_attr(DMA_ATTR_FORCE_CONTIGUOUS, &buf->dma_attrs);
		dma_set_attr(DMA_ATTR_FORCE_CONTIGUOUS, &buf->dma_attrs);


	/*
	/*
@@ -66,14 +53,45 @@ static int lowlevel_buffer_allocate(struct drm_device *dev,
	dma_set_attr(attr, &buf->dma_attrs);
	dma_set_attr(attr, &buf->dma_attrs);
	dma_set_attr(DMA_ATTR_NO_KERNEL_MAPPING, &buf->dma_attrs);
	dma_set_attr(DMA_ATTR_NO_KERNEL_MAPPING, &buf->dma_attrs);


	nr_pages = buf->size >> PAGE_SHIFT;

	if (!is_drm_iommu_supported(dev)) {
		dma_addr_t start_addr;
		unsigned int i = 0;

		buf->pages = kzalloc(sizeof(struct page) * nr_pages,
					GFP_KERNEL);
		if (!buf->pages) {
			DRM_ERROR("failed to allocate pages.\n");
			return -ENOMEM;
		}

		buf->kvaddr = dma_alloc_attrs(dev->dev, buf->size,
					&buf->dma_addr, GFP_KERNEL,
					&buf->dma_attrs);
		if (!buf->kvaddr) {
			DRM_ERROR("failed to allocate buffer.\n");
			kfree(buf->pages);
			return -ENOMEM;
		}

		start_addr = buf->dma_addr;
		while (i < nr_pages) {
			buf->pages[i] = phys_to_page(start_addr);
			start_addr += PAGE_SIZE;
			i++;
		}
	} else {

		buf->pages = dma_alloc_attrs(dev->dev, buf->size,
		buf->pages = dma_alloc_attrs(dev->dev, buf->size,
			&buf->dma_addr, GFP_KERNEL, &buf->dma_attrs);
					&buf->dma_addr, GFP_KERNEL,
					&buf->dma_attrs);
		if (!buf->pages) {
		if (!buf->pages) {
			DRM_ERROR("failed to allocate buffer.\n");
			DRM_ERROR("failed to allocate buffer.\n");
			return -ENOMEM;
			return -ENOMEM;
		}
		}
	}


	nr_pages = buf->size >> PAGE_SHIFT;
	buf->sgt = drm_prime_pages_to_sg(buf->pages, nr_pages);
	buf->sgt = drm_prime_pages_to_sg(buf->pages, nr_pages);
	if (!buf->sgt) {
	if (!buf->sgt) {
		DRM_ERROR("failed to get sg table.\n");
		DRM_ERROR("failed to get sg table.\n");
@@ -92,6 +110,9 @@ static int lowlevel_buffer_allocate(struct drm_device *dev,
			(dma_addr_t)buf->dma_addr, &buf->dma_attrs);
			(dma_addr_t)buf->dma_addr, &buf->dma_attrs);
	buf->dma_addr = (dma_addr_t)NULL;
	buf->dma_addr = (dma_addr_t)NULL;


	if (!is_drm_iommu_supported(dev))
		kfree(buf->pages);

	return ret;
	return ret;
}
}


@@ -114,8 +135,14 @@ static void lowlevel_buffer_deallocate(struct drm_device *dev,
	kfree(buf->sgt);
	kfree(buf->sgt);
	buf->sgt = NULL;
	buf->sgt = NULL;


	if (!is_drm_iommu_supported(dev)) {
		dma_free_attrs(dev->dev, buf->size, buf->kvaddr,
				(dma_addr_t)buf->dma_addr, &buf->dma_attrs);
		kfree(buf->pages);
	} else
		dma_free_attrs(dev->dev, buf->size, buf->pages,
		dma_free_attrs(dev->dev, buf->size, buf->pages,
				(dma_addr_t)buf->dma_addr, &buf->dma_attrs);
				(dma_addr_t)buf->dma_addr, &buf->dma_attrs);

	buf->dma_addr = (dma_addr_t)NULL;
	buf->dma_addr = (dma_addr_t)NULL;
}
}


+4 −18
Original line number Original line Diff line number Diff line
@@ -3,24 +3,10 @@
 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
 * Author: Inki Dae <inki.dae@samsung.com>
 * Author: Inki Dae <inki.dae@samsung.com>
 *
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * This program is free software; you can redistribute  it and/or modify it
 * copy of this software and associated documentation files (the "Software"),
 * under  the terms of  the GNU General  Public License as published by the
 * to deal in the Software without restriction, including without limitation
 * Free Software Foundation;  either version 2 of the  License, or (at your
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * option) any later version.
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 */
 */


#ifndef _EXYNOS_DRM_BUF_H_
#ifndef _EXYNOS_DRM_BUF_H_
+4 −18
Original line number Original line Diff line number Diff line
@@ -5,24 +5,10 @@
 *	Joonyoung Shim <jy0922.shim@samsung.com>
 *	Joonyoung Shim <jy0922.shim@samsung.com>
 *	Seung-Woo Kim <sw0312.kim@samsung.com>
 *	Seung-Woo Kim <sw0312.kim@samsung.com>
 *
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * This program is free software; you can redistribute  it and/or modify it
 * copy of this software and associated documentation files (the "Software"),
 * under  the terms of  the GNU General  Public License as published by the
 * to deal in the Software without restriction, including without limitation
 * Free Software Foundation;  either version 2 of the  License, or (at your
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * option) any later version.
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 */
 */


#include <drm/drmP.h>
#include <drm/drmP.h>
+4 −18
Original line number Original line Diff line number Diff line
@@ -5,24 +5,10 @@
 *	Joonyoung Shim <jy0922.shim@samsung.com>
 *	Joonyoung Shim <jy0922.shim@samsung.com>
 *	Seung-Woo Kim <sw0312.kim@samsung.com>
 *	Seung-Woo Kim <sw0312.kim@samsung.com>
 *
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * This program is free software; you can redistribute  it and/or modify it
 * copy of this software and associated documentation files (the "Software"),
 * under  the terms of  the GNU General  Public License as published by the
 * to deal in the Software without restriction, including without limitation
 * Free Software Foundation;  either version 2 of the  License, or (at your
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * option) any later version.
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 */
 */


#ifndef _EXYNOS_DRM_CONNECTOR_H_
#ifndef _EXYNOS_DRM_CONNECTOR_H_
+4 −18
Original line number Original line Diff line number Diff line
@@ -6,24 +6,10 @@
 *	Joonyoung Shim <jy0922.shim@samsung.com>
 *	Joonyoung Shim <jy0922.shim@samsung.com>
 *	Seung-Woo Kim <sw0312.kim@samsung.com>
 *	Seung-Woo Kim <sw0312.kim@samsung.com>
 *
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * This program is free software; you can redistribute  it and/or modify it
 * copy of this software and associated documentation files (the "Software"),
 * under  the terms of  the GNU General  Public License as published by the
 * to deal in the Software without restriction, including without limitation
 * Free Software Foundation;  either version 2 of the  License, or (at your
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * option) any later version.
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 */
 */


#include <drm/drmP.h>
#include <drm/drmP.h>
Loading