]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'drm/next/platform' of git://linuxtv.org/pinchartl/media into drm-misc...
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Sat, 11 Mar 2017 10:46:03 +0000 (11:46 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Sat, 11 Mar 2017 10:46:03 +0000 (11:46 +0100)
Merge Laurent's drm_platform removal code. Only conflict is with the
drm_pci.h extraction, which allows me to fix up the misplayed
drm_platform_init fumble that 0day and Stephen Rothwell reported.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
14 files changed:
1  2 
Documentation/gpu/drm-internals.rst
drivers/gpu/drm/Makefile
drivers/gpu/drm/armada/armada_drv.c
drivers/gpu/drm/exynos/exynos_drm_drv.c
drivers/gpu/drm/exynos/exynos_drm_fbdev.c
drivers/gpu/drm/exynos/exynos_hdmi.c
drivers/gpu/drm/msm/msm_drv.c
drivers/gpu/drm/nouveau/nouveau_drm.c
drivers/gpu/drm/shmobile/shmob_drm_crtc.c
drivers/gpu/drm/shmobile/shmob_drm_drv.c
drivers/gpu/drm/sti/sti_drv.c
drivers/gpu/drm/tilcdc/tilcdc_drv.c
include/drm/drmP.h
include/drm/drm_pci.h

Simple merge
index eb54ffabacc522a1afec66d50fdaa762e3938ea0,4601f697ccd65e13dacc31a54a32b84b80bd42ae..59aae43005eefefe9d6e80f9203e99102a8cc395
@@@ -4,10 -4,10 +4,10 @@@
  
  drm-y       :=        drm_auth.o drm_bufs.o drm_cache.o \
                drm_context.o drm_dma.o \
 -              drm_fops.o drm_gem.o drm_ioctl.o drm_irq.o \
 +              drm_file.o drm_gem.o drm_ioctl.o drm_irq.o \
                drm_lock.o drm_memory.o drm_drv.o \
                drm_scatter.o drm_pci.o \
-               drm_platform.o drm_sysfs.o drm_hashtab.o drm_mm.o \
+               drm_sysfs.o drm_hashtab.o drm_mm.o \
                drm_crtc.o drm_fourcc.o drm_modes.o drm_edid.o \
                drm_info.o drm_encoder_slave.o \
                drm_trace_points.o drm_global.o drm_prime.o \
Simple merge
Simple merge
Simple merge
index f0bb7606eb8b77949b97e3b7989ecd0cdf53e0fd,e4ddd43c2c796d33ae148d9addb4f3ad8dd979a8..2b6ac24ce6901013fd1dc99b4b4e8b27de6125db
@@@ -108,56 -106,38 +108,56 @@@ nouveau_name(struct drm_device *dev
        if (dev->pdev)
                return nouveau_pci_name(dev->pdev);
        else
-               return nouveau_platform_name(dev->platformdev);
+               return nouveau_platform_name(to_platform_device(dev->dev));
  }
  
 +static void
 +nouveau_cli_fini(struct nouveau_cli *cli)
 +{
 +      nvkm_vm_ref(NULL, &nvxx_client(&cli->base)->vm, NULL);
 +      usif_client_fini(cli);
 +      nvif_device_fini(&cli->device);
 +      nvif_client_fini(&cli->base);
 +}
 +
  static int
 -nouveau_cli_create(struct drm_device *dev, const char *sname,
 -                 int size, void **pcli)
 +nouveau_cli_init(struct nouveau_drm *drm, const char *sname,
 +               struct nouveau_cli *cli)
  {
 -      struct nouveau_cli *cli = *pcli = kzalloc(size, GFP_KERNEL);
 +      u64 device = nouveau_name(drm->dev);
        int ret;
 -      if (cli) {
 -              snprintf(cli->name, sizeof(cli->name), "%s", sname);
 -              cli->dev = dev;
  
 -              ret = nvif_client_init(NULL, cli->name, nouveau_name(dev),
 -                                     nouveau_config, nouveau_debug,
 +      snprintf(cli->name, sizeof(cli->name), "%s", sname);
 +      cli->dev = drm->dev;
 +      mutex_init(&cli->mutex);
 +      usif_client_init(cli);
 +
 +      if (cli == &drm->client) {
 +              ret = nvif_driver_init(NULL, nouveau_config, nouveau_debug,
 +                                     cli->name, device, &cli->base);
 +      } else {
 +              ret = nvif_client_init(&drm->client.base, cli->name, device,
                                       &cli->base);
 -              if (ret == 0) {
 -                      mutex_init(&cli->mutex);
 -                      usif_client_init(cli);
 -              }
 -              return ret;
        }
 -      return -ENOMEM;
 -}
 +      if (ret) {
 +              NV_ERROR(drm, "Client allocation failed: %d\n", ret);
 +              goto done;
 +      }
  
 -static void
 -nouveau_cli_destroy(struct nouveau_cli *cli)
 -{
 -      nvkm_vm_ref(NULL, &nvxx_client(&cli->base)->vm, NULL);
 -      nvif_client_fini(&cli->base);
 -      usif_client_fini(cli);
 -      kfree(cli);
 +      ret = nvif_device_init(&cli->base.object, 0, NV_DEVICE,
 +                             &(struct nv_device_v0) {
 +                                      .device = ~0,
 +                             }, sizeof(struct nv_device_v0),
 +                             &cli->device);
 +      if (ret) {
 +              NV_ERROR(drm, "Device allocation failed: %d\n", ret);
 +              goto done;
 +      }
 +
 +done:
 +      if (ret)
 +              nouveau_cli_fini(cli);
 +      return ret;
  }
  
  static void
index 34fefa0ba0f092cd40ce9850cf26441f588144c4,ec7a5eb809a2a2e3c419155d4550501a1edbe905..1c7b318b89980b713bb9e2174346e360e17f5c8a
@@@ -236,9 -159,10 +142,7 @@@ static const struct file_operations shm
  static struct drm_driver shmob_drm_driver = {
        .driver_features        = DRIVER_HAVE_IRQ | DRIVER_GEM | DRIVER_MODESET
                                | DRIVER_PRIME,
-       .load                   = shmob_drm_load,
-       .unload                 = shmob_drm_unload,
        .irq_handler            = shmob_drm_irq,
 -      .get_vblank_counter     = drm_vblank_no_hw_counter,
 -      .enable_vblank          = shmob_drm_enable_vblank,
 -      .disable_vblank         = shmob_drm_disable_vblank,
        .gem_free_object_unlocked = drm_gem_cma_free_object,
        .gem_vm_ops             = &drm_gem_cma_vm_ops,
        .prime_handle_to_fd     = drm_gem_prime_handle_to_fd,
Simple merge
Simple merge
Simple merge
index 5081b3eba3098f54e12acb4d3ffd7c0d6c5d3efb,0000000000000000000000000000000000000000..f5ebfcaf69e01ea752155598054bc82ccff7a902
mode 100644,000000..100644
--- /dev/null
@@@ -1,78 -1,0 +1,75 @@@
- /* platform section */
- extern int drm_platform_init(struct drm_driver *driver, struct platform_device *platform_device);
 +/*
 + * Internal Header for the Direct Rendering Manager
 + *
 + * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
 + * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
 + * Copyright (c) 2009-2010, Code Aurora Forum.
 + * All rights reserved.
 + *
 + * Author: Rickard E. (Rik) Faith <faith@valinux.com>
 + * Author: Gareth Hughes <gareth@valinux.com>
 + *
 + * Permission is hereby granted, free of charge, to any person obtaining a
 + * copy of this software and associated documentation files (the "Software"),
 + * to deal in the Software without restriction, including without limitation
 + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 + * 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 _DRM_PCI_H_
 +#define _DRM_PCI_H_
 +
 +#include <linux/pci.h>
 +
 +struct drm_dma_handle;
 +struct drm_device;
 +struct drm_driver;
 +struct drm_master;
 +
 +extern struct drm_dma_handle *drm_pci_alloc(struct drm_device *dev, size_t size,
 +                                          size_t align);
 +extern void drm_pci_free(struct drm_device *dev, struct drm_dma_handle * dmah);
 +
 +extern int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver);
 +extern void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver);
 +#ifdef CONFIG_PCI
 +extern int drm_get_pci_dev(struct pci_dev *pdev,
 +                         const struct pci_device_id *ent,
 +                         struct drm_driver *driver);
 +extern int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master);
 +#else
 +static inline int drm_get_pci_dev(struct pci_dev *pdev,
 +                                const struct pci_device_id *ent,
 +                                struct drm_driver *driver)
 +{
 +      return -ENOSYS;
 +}
 +
 +static inline int drm_pci_set_busid(struct drm_device *dev,
 +                                  struct drm_master *master)
 +{
 +      return -ENOSYS;
 +}
 +#endif
 +
 +#define DRM_PCIE_SPEED_25 1
 +#define DRM_PCIE_SPEED_50 2
 +#define DRM_PCIE_SPEED_80 4
 +
 +extern int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *speed_mask);
 +extern int drm_pcie_get_max_link_width(struct drm_device *dev, u32 *mlw);
 +
 +#endif /* _DRM_PCI_H_ */