Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
[GitHub/exynos8895/android_kernel_samsung_universal8895.git] / drivers / gpu / drm / nouveau / nvc0_fbcon.c
index ade005fa9de198acc358dad9edf8a7bc6f467a08..9dcd30f3e1e02dbbf3411aa872b911a13eb6085d 100644 (file)
  * Authors: Ben Skeggs
  */
 
-#include <drm/drmP.h>
-#include "nouveau_drv.h"
+#include "nouveau_drm.h"
 #include "nouveau_dma.h"
-#include "nouveau_ramht.h"
 #include "nouveau_fbcon.h"
-#include "nouveau_mm.h"
 
 int
 nvc0_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
 {
        struct nouveau_fbdev *nfbdev = info->par;
-       struct drm_device *dev = nfbdev->dev;
-       struct drm_nouveau_private *dev_priv = dev->dev_private;
-       struct nouveau_channel *chan = dev_priv->channel;
+       struct nouveau_drm *drm = nouveau_drm(nfbdev->dev);
+       struct nouveau_channel *chan = drm->channel;
        int ret;
 
        ret = RING_SPACE(chan, rect->rop == ROP_COPY ? 7 : 11);
@@ -69,9 +65,8 @@ int
 nvc0_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region)
 {
        struct nouveau_fbdev *nfbdev = info->par;
-       struct drm_device *dev = nfbdev->dev;
-       struct drm_nouveau_private *dev_priv = dev->dev_private;
-       struct nouveau_channel *chan = dev_priv->channel;
+       struct nouveau_drm *drm = nouveau_drm(nfbdev->dev);
+       struct nouveau_channel *chan = drm->channel;
        int ret;
 
        ret = RING_SPACE(chan, 12);
@@ -98,9 +93,8 @@ int
 nvc0_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)
 {
        struct nouveau_fbdev *nfbdev = info->par;
-       struct drm_device *dev = nfbdev->dev;
-       struct drm_nouveau_private *dev_priv = dev->dev_private;
-       struct nouveau_channel *chan = dev_priv->channel;
+       struct nouveau_drm *drm = nouveau_drm(nfbdev->dev);
+       struct nouveau_channel *chan = drm->channel;
        uint32_t width, dwords, *data = (uint32_t *)image->data;
        uint32_t mask = ~(~0 >> (32 - info->var.bits_per_pixel));
        uint32_t *palette = info->pseudo_palette;
@@ -157,12 +151,14 @@ nvc0_fbcon_accel_init(struct fb_info *info)
 {
        struct nouveau_fbdev *nfbdev = info->par;
        struct drm_device *dev = nfbdev->dev;
-       struct drm_nouveau_private *dev_priv = dev->dev_private;
-       struct nouveau_channel *chan = dev_priv->channel;
        struct nouveau_framebuffer *fb = &nfbdev->nouveau_fb;
+       struct nouveau_drm *drm = nouveau_drm(dev);
+       struct nouveau_channel *chan = drm->channel;
+       struct nouveau_object *object;
        int ret, format;
 
-       ret = nouveau_gpuobj_gr_new(chan, 0x902d, 0x902d);
+       ret = nouveau_object_new(nv_object(chan->cli), NVDRM_CHAN, Nv2D,
+                                0x902d, NULL, 0, &object);
        if (ret)
                return ret;
 
@@ -202,9 +198,6 @@ nvc0_fbcon_accel_init(struct fb_info *info)
 
        BEGIN_NVC0(chan, NvSub2D, 0x0000, 1);
        OUT_RING  (chan, 0x0000902d);
-       BEGIN_NVC0(chan, NvSub2D, 0x0104, 2);
-       OUT_RING  (chan, upper_32_bits(chan->notifier_vma.offset));
-       OUT_RING  (chan, lower_32_bits(chan->notifier_vma.offset));
        BEGIN_NVC0(chan, NvSub2D, 0x0290, 1);
        OUT_RING  (chan, 0);
        BEGIN_NVC0(chan, NvSub2D, 0x0888, 1);