]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge tag 'drm-intel-fixes-2017-07-27' of git://anongit.freedesktop.org/git/drm-intel...
authorDave Airlie <airlied@redhat.com>
Fri, 28 Jul 2017 00:19:08 +0000 (10:19 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 28 Jul 2017 00:19:08 +0000 (10:19 +1000)
i915 fixes for -rc3

Bit more than usual since we missed -rc2. 4x cc: stable, 2 gvt
patches, but all fairly minor stuff. Last minute rebase was to add a
few missing cc: stable, I did prep the pull this morning already and
made sure CI approves.

* tag 'drm-intel-fixes-2017-07-27' of git://anongit.freedesktop.org/git/drm-intel:
  drm/i915: Fix bad comparison in skl_compute_plane_wm.
  drm/i915: Force CPU synchronisation even if userspace requests ASYNC
  drm/i915: Only skip updating execobject.offset after error
  drm/i915: Only mark the execobject as pinned on success
  drm/i915: Remove assertion from raw __i915_vma_unpin()
  drm/i915/cnl: Fix loadgen select programming on ddi vswing sequence
  drm/i915: Fix scaler init during CRTC HW state readout
  drm/i915/selftests: Fix an error handling path in 'mock_gem_device()'
  drm/i915: Unbreak gpu reset vs. modeset locking
  drm/i915: Fix cursor updates on some platforms
  drm/i915: Fix user ptr check size in eb_relocate_vma()
  drm/i915/gvt: Extend KBL platform support in GVT-g
  drm/i915/gvt: Fix the vblank timer close issue after shutdown VMs in reverse

35 files changed:
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
drivers/gpu/drm/drm_dp_helper.c
drivers/gpu/drm/nouveau/nouveau_connector.c
drivers/gpu/drm/nouveau/nouveau_display.c
drivers/gpu/drm/nouveau/nv50_display.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h
drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h
drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c
drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/Kbuild
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.h
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgf119.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/padgf119.c
drivers/gpu/drm/rockchip/Kconfig
drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c
drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c
drivers/gpu/drm/vmwgfx/vmwgfx_context.c
drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
drivers/gpu/drm/vmwgfx/vmwgfx_mob.c
drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c
drivers/gpu/host1x/dev.c

index f621ee115c98d4e5d5a4faa0d845864dc65a0b8c..5e771bc11b0054aa667bb75291da4cb9911521df 100644 (file)
@@ -198,12 +198,16 @@ amdgpu_bo_list_get(struct amdgpu_fpriv *fpriv, int id)
        result = idr_find(&fpriv->bo_list_handles, id);
 
        if (result) {
-               if (kref_get_unless_zero(&result->refcount))
+               if (kref_get_unless_zero(&result->refcount)) {
+                       rcu_read_unlock();
                        mutex_lock(&result->lock);
-               else
+               } else {
+                       rcu_read_unlock();
                        result = NULL;
+               }
+       } else {
+               rcu_read_unlock();
        }
-       rcu_read_unlock();
 
        return result;
 }
index 3a0b69b09ed62ed9dd18a8b4dbfad595b7d30030..c9b9c88231aa5070b709e97ce558a78fcfb43097 100644 (file)
@@ -1475,21 +1475,23 @@ static void gfx_v9_0_tiling_mode_table_init(struct amdgpu_device *adev)
 
 static void gfx_v9_0_select_se_sh(struct amdgpu_device *adev, u32 se_num, u32 sh_num, u32 instance)
 {
-       u32 data = REG_SET_FIELD(0, GRBM_GFX_INDEX, INSTANCE_BROADCAST_WRITES, 1);
+       u32 data;
 
-       if ((se_num == 0xffffffff) && (sh_num == 0xffffffff)) {
-               data = REG_SET_FIELD(data, GRBM_GFX_INDEX, SH_BROADCAST_WRITES, 1);
-               data = REG_SET_FIELD(data, GRBM_GFX_INDEX, SE_BROADCAST_WRITES, 1);
-       } else if (se_num == 0xffffffff) {
-               data = REG_SET_FIELD(data, GRBM_GFX_INDEX, SH_INDEX, sh_num);
+       if (instance == 0xffffffff)
+               data = REG_SET_FIELD(0, GRBM_GFX_INDEX, INSTANCE_BROADCAST_WRITES, 1);
+       else
+               data = REG_SET_FIELD(0, GRBM_GFX_INDEX, INSTANCE_INDEX, instance);
+
+       if (se_num == 0xffffffff)
                data = REG_SET_FIELD(data, GRBM_GFX_INDEX, SE_BROADCAST_WRITES, 1);
-       } else if (sh_num == 0xffffffff) {
-               data = REG_SET_FIELD(data, GRBM_GFX_INDEX, SH_BROADCAST_WRITES, 1);
+       else
                data = REG_SET_FIELD(data, GRBM_GFX_INDEX, SE_INDEX, se_num);
-       } else {
+
+       if (sh_num == 0xffffffff)
+               data = REG_SET_FIELD(data, GRBM_GFX_INDEX, SH_BROADCAST_WRITES, 1);
+       else
                data = REG_SET_FIELD(data, GRBM_GFX_INDEX, SH_INDEX, sh_num);
-               data = REG_SET_FIELD(data, GRBM_GFX_INDEX, SE_INDEX, se_num);
-       }
+
        WREG32_SOC15(GC, 0, mmGRBM_GFX_INDEX, data);
 }
 
index d6f097f44b6cfe8587b64c16cfa6af4663c729e7..197174e562d208e773492f9da2280fd03414c540 100644 (file)
@@ -2128,15 +2128,9 @@ static int vega10_populate_avfs_parameters(struct pp_hwmgr *hwmgr)
                        pp_table->AvfsGbCksOff.m2_shift = 12;
                        pp_table->AvfsGbCksOff.b_shift = 0;
 
-                       for (i = 0; i < dep_table->count; i++) {
-                               if (dep_table->entries[i].sclk_offset == 0)
-                                       pp_table->StaticVoltageOffsetVid[i] = 248;
-                               else
-                                       pp_table->StaticVoltageOffsetVid[i] =
-                                               (uint8_t)(dep_table->entries[i].sclk_offset *
-                                                               VOLTAGE_VID_OFFSET_SCALE2 /
-                                                               VOLTAGE_VID_OFFSET_SCALE1);
-                       }
+                       for (i = 0; i < dep_table->count; i++)
+                               pp_table->StaticVoltageOffsetVid[i] =
+                                               convert_to_vid((uint8_t)(dep_table->entries[i].sclk_offset));
 
                        if ((PPREGKEY_VEGA10QUADRATICEQUATION_DFLT !=
                                        data->disp_clk_quad_eqn_a) &&
index 213fb837e1c40fe79bf536d54b083d99dee1c192..08af8d6b844b67e0653f93c5dc012706d9a13b19 100644 (file)
@@ -544,7 +544,7 @@ void drm_dp_downstream_debug(struct seq_file *m,
                                 DP_DETAILED_CAP_INFO_AVAILABLE;
        int clk;
        int bpc;
-       char id[6];
+       char id[7];
        int len;
        uint8_t rev[2];
        int type = port_cap[0] & DP_DS_PORT_TYPE_MASK;
@@ -583,6 +583,7 @@ void drm_dp_downstream_debug(struct seq_file *m,
                seq_puts(m, "\t\tType: N/A\n");
        }
 
+       memset(id, 0, sizeof(id));
        drm_dp_downstream_id(aux, id);
        seq_printf(m, "\t\tID: %s\n", id);
 
@@ -591,7 +592,7 @@ void drm_dp_downstream_debug(struct seq_file *m,
                seq_printf(m, "\t\tHW: %d.%d\n",
                           (rev[0] & 0xf0) >> 4, rev[0] & 0xf);
 
-       len = drm_dp_dpcd_read(aux, DP_BRANCH_SW_REV, &rev, 2);
+       len = drm_dp_dpcd_read(aux, DP_BRANCH_SW_REV, rev, 2);
        if (len > 0)
                seq_printf(m, "\t\tSW: %d.%d\n", rev[0], rev[1]);
 
index 147b22163f9f6839419ebe3051f492f20fd9e0eb..dab78c660dd63d2c938d6b33524c3aa5de048633 100644 (file)
@@ -1158,8 +1158,6 @@ nouveau_connector_aux_xfer(struct drm_dp_aux *obj, struct drm_dp_aux_msg *msg)
                return -ENODEV;
        if (WARN_ON(msg->size > 16))
                return -E2BIG;
-       if (msg->size == 0)
-               return msg->size;
 
        ret = nvkm_i2c_aux_acquire(aux);
        if (ret)
index 8d1df5678eaaa7291eaf64ce71d39d79cccd60ca..f362c9fa8b3bb42a10dd2ea63c378f1b5d8255fb 100644 (file)
@@ -409,7 +409,6 @@ nouveau_display_fini(struct drm_device *dev, bool suspend)
        struct nouveau_display *disp = nouveau_display(dev);
        struct nouveau_drm *drm = nouveau_drm(dev);
        struct drm_connector *connector;
-       struct drm_crtc *crtc;
 
        if (!suspend) {
                if (drm_drv_uses_atomic_modeset(dev))
@@ -418,10 +417,6 @@ nouveau_display_fini(struct drm_device *dev, bool suspend)
                        drm_crtc_force_disable_all(dev);
        }
 
-       /* Make sure that drm and hw vblank irqs get properly disabled. */
-       drm_for_each_crtc(crtc, dev)
-               drm_crtc_vblank_off(crtc);
-
        /* disable flip completion events */
        nvif_notify_put(&drm->flip);
 
index e3132a2ce34d60acb9eb75cdf83ec1506e8f874b..2bc0dc9852144cfe0825b5da075333d9e85c5b9c 100644 (file)
@@ -3674,15 +3674,24 @@ nv50_sor_create(struct drm_connector *connector, struct dcb_output *dcbe)
        drm_mode_connector_attach_encoder(connector, encoder);
 
        if (dcbe->type == DCB_OUTPUT_DP) {
+               struct nv50_disp *disp = nv50_disp(encoder->dev);
                struct nvkm_i2c_aux *aux =
                        nvkm_i2c_aux_find(i2c, dcbe->i2c_index);
                if (aux) {
-                       nv_encoder->i2c = &nv_connector->aux.ddc;
+                       if (disp->disp->oclass < GF110_DISP) {
+                               /* HW has no support for address-only
+                                * transactions, so we're required to
+                                * use custom I2C-over-AUX code.
+                                */
+                               nv_encoder->i2c = &aux->i2c;
+                       } else {
+                               nv_encoder->i2c = &nv_connector->aux.ddc;
+                       }
                        nv_encoder->aux = aux;
                }
 
                /*TODO: Use DP Info Table to check for support. */
-               if (nv50_disp(encoder->dev)->disp->oclass >= GF110_DISP) {
+               if (disp->disp->oclass >= GF110_DISP) {
                        ret = nv50_mstm_new(nv_encoder, &nv_connector->aux, 16,
                                            nv_connector->base.base.id,
                                            &nv_encoder->dp.mstm);
@@ -3931,6 +3940,8 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state)
 
                NV_ATOMIC(drm, "%s: clr %04x (set %04x)\n", crtc->name,
                          asyh->clr.mask, asyh->set.mask);
+               if (crtc_state->active && !asyh->state.active)
+                       drm_crtc_vblank_off(crtc);
 
                if (asyh->clr.mask) {
                        nv50_head_flush_clr(head, asyh, atom->flush_disable);
@@ -4016,11 +4027,13 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state)
                        nv50_head_flush_set(head, asyh);
                        interlock_core = 1;
                }
-       }
 
-       for_each_crtc_in_state(state, crtc, crtc_state, i) {
-               if (crtc->state->event)
-                       drm_crtc_vblank_get(crtc);
+               if (asyh->state.active) {
+                       if (!crtc_state->active)
+                               drm_crtc_vblank_on(crtc);
+                       if (asyh->state.event)
+                               drm_crtc_vblank_get(crtc);
+               }
        }
 
        /* Update plane(s). */
@@ -4067,12 +4080,14 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state)
                if (crtc->state->event) {
                        unsigned long flags;
                        /* Get correct count/ts if racing with vblank irq */
-                       drm_accurate_vblank_count(crtc);
+                       if (crtc->state->active)
+                               drm_accurate_vblank_count(crtc);
                        spin_lock_irqsave(&crtc->dev->event_lock, flags);
                        drm_crtc_send_vblank_event(crtc, crtc->state->event);
                        spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
                        crtc->state->event = NULL;
-                       drm_crtc_vblank_put(crtc);
+                       if (crtc->state->active)
+                               drm_crtc_vblank_put(crtc);
                }
        }
 
index a24312fb0228ff1f1053bca27f33c5702d2dc2ac..a1e8bf48b778430d45d46fb9e9de453fb897cd2a 100644 (file)
@@ -22,6 +22,7 @@ struct nvkm_ior {
                unsigned proto_evo:4;
                enum nvkm_ior_proto {
                        CRT,
+                       TV,
                        TMDS,
                        LVDS,
                        DP,
index 19c635663399a2442b670479df18621119595043..6ea19466f43622565052d8600424c948c9705343 100644 (file)
@@ -22,7 +22,7 @@ struct nv50_disp {
                u8 type[3];
        } pior;
 
-       struct nv50_disp_chan *chan[17];
+       struct nv50_disp_chan *chan[21];
 };
 
 void nv50_disp_super_1(struct nv50_disp *);
index 85aff85394ac29893b25180d62a6994af266c429..be9e7f8c3b2392fa96643f91391e606196ad7a67 100644 (file)
@@ -62,6 +62,7 @@ nvkm_outp_xlat(struct nvkm_outp *outp, enum nvkm_ior_type *type)
        case 0:
                switch (outp->info.type) {
                case DCB_OUTPUT_ANALOG: *type = DAC; return  CRT;
+               case DCB_OUTPUT_TV    : *type = DAC; return   TV;
                case DCB_OUTPUT_TMDS  : *type = SOR; return TMDS;
                case DCB_OUTPUT_LVDS  : *type = SOR; return LVDS;
                case DCB_OUTPUT_DP    : *type = SOR; return   DP;
index c794b2c2d21e710faa3ac64f70ac970ae69826c9..6d8f21290aa20342c1d50f73aa836feab1266d8c 100644 (file)
@@ -129,7 +129,7 @@ gf100_bar_init(struct nvkm_bar *base)
 
        if (bar->bar[0].mem) {
                addr = nvkm_memory_addr(bar->bar[0].mem) >> 12;
-               nvkm_wr32(device, 0x001714, 0xc0000000 | addr);
+               nvkm_wr32(device, 0x001714, 0x80000000 | addr);
        }
 
        return 0;
index 48f01e40b8fcc948126cbc1601b0217c034e7b90..b768e66a472beef8da6f871b6da6bdb471dc2a05 100644 (file)
@@ -25,6 +25,7 @@ nvkm-y += nvkm/subdev/i2c/bit.o
 
 nvkm-y += nvkm/subdev/i2c/aux.o
 nvkm-y += nvkm/subdev/i2c/auxg94.o
+nvkm-y += nvkm/subdev/i2c/auxgf119.o
 nvkm-y += nvkm/subdev/i2c/auxgm200.o
 
 nvkm-y += nvkm/subdev/i2c/anx9805.o
index d172e42dd2280682d58c3907ed882bae03fa0a2f..4c1f547da463afff3dee772446f92f13b2f4043e 100644 (file)
@@ -117,6 +117,10 @@ int
 nvkm_i2c_aux_xfer(struct nvkm_i2c_aux *aux, bool retry, u8 type,
                  u32 addr, u8 *data, u8 *size)
 {
+       if (!*size && !aux->func->address_only) {
+               AUX_ERR(aux, "address-only transaction dropped");
+               return -ENOSYS;
+       }
        return aux->func->xfer(aux, retry, type, addr, data, size);
 }
 
index 27a4a39c87f0044577a6b72bd4e95c6e4fc1437b..9587ab456d9eaa882eb3e9e9749993dc8fe62e17 100644 (file)
@@ -3,6 +3,7 @@
 #include "pad.h"
 
 struct nvkm_i2c_aux_func {
+       bool address_only;
        int  (*xfer)(struct nvkm_i2c_aux *, bool retry, u8 type,
                     u32 addr, u8 *data, u8 *size);
        int  (*lnk_ctl)(struct nvkm_i2c_aux *, int link_nr, int link_bw,
@@ -17,7 +18,12 @@ void nvkm_i2c_aux_del(struct nvkm_i2c_aux **);
 int nvkm_i2c_aux_xfer(struct nvkm_i2c_aux *, bool retry, u8 type,
                      u32 addr, u8 *data, u8 *size);
 
+int g94_i2c_aux_new_(const struct nvkm_i2c_aux_func *, struct nvkm_i2c_pad *,
+                    int, u8, struct nvkm_i2c_aux **);
+
 int g94_i2c_aux_new(struct nvkm_i2c_pad *, int, u8, struct nvkm_i2c_aux **);
+int g94_i2c_aux_xfer(struct nvkm_i2c_aux *, bool, u8, u32, u8 *, u8 *);
+int gf119_i2c_aux_new(struct nvkm_i2c_pad *, int, u8, struct nvkm_i2c_aux **);
 int gm200_i2c_aux_new(struct nvkm_i2c_pad *, int, u8, struct nvkm_i2c_aux **);
 
 #define AUX_MSG(b,l,f,a...) do {                                               \
index ab8cb196c34e73202c288c7dc24a14a88a18b78f..c8ab1b5741a3e3c0e93a9943c0b3811b8c646ea6 100644 (file)
@@ -72,7 +72,7 @@ g94_i2c_aux_init(struct g94_i2c_aux *aux)
        return 0;
 }
 
-static int
+int
 g94_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry,
                 u8 type, u32 addr, u8 *data, u8 *size)
 {
@@ -105,9 +105,9 @@ g94_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry,
        }
 
        ctrl  = nvkm_rd32(device, 0x00e4e4 + base);
-       ctrl &= ~0x0001f0ff;
+       ctrl &= ~0x0001f1ff;
        ctrl |= type << 12;
-       ctrl |= *size - 1;
+       ctrl |= (*size ? (*size - 1) : 0x00000100);
        nvkm_wr32(device, 0x00e4e0 + base, addr);
 
        /* (maybe) retry transaction a number of times on failure... */
@@ -160,14 +160,10 @@ out:
        return ret < 0 ? ret : (stat & 0x000f0000) >> 16;
 }
 
-static const struct nvkm_i2c_aux_func
-g94_i2c_aux_func = {
-       .xfer = g94_i2c_aux_xfer,
-};
-
 int
-g94_i2c_aux_new(struct nvkm_i2c_pad *pad, int index, u8 drive,
-               struct nvkm_i2c_aux **paux)
+g94_i2c_aux_new_(const struct nvkm_i2c_aux_func *func,
+                struct nvkm_i2c_pad *pad, int index, u8 drive,
+                struct nvkm_i2c_aux **paux)
 {
        struct g94_i2c_aux *aux;
 
@@ -175,8 +171,20 @@ g94_i2c_aux_new(struct nvkm_i2c_pad *pad, int index, u8 drive,
                return -ENOMEM;
        *paux = &aux->base;
 
-       nvkm_i2c_aux_ctor(&g94_i2c_aux_func, pad, index, &aux->base);
+       nvkm_i2c_aux_ctor(func, pad, index, &aux->base);
        aux->ch = drive;
        aux->base.intr = 1 << aux->ch;
        return 0;
 }
+
+static const struct nvkm_i2c_aux_func
+g94_i2c_aux = {
+       .xfer = g94_i2c_aux_xfer,
+};
+
+int
+g94_i2c_aux_new(struct nvkm_i2c_pad *pad, int index, u8 drive,
+               struct nvkm_i2c_aux **paux)
+{
+       return g94_i2c_aux_new_(&g94_i2c_aux, pad, index, drive, paux);
+}
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgf119.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgf119.c
new file mode 100644 (file)
index 0000000..dab40cd
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2017 Red Hat Inc.
+ *
+ * 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 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
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 "aux.h"
+
+static const struct nvkm_i2c_aux_func
+gf119_i2c_aux = {
+       .address_only = true,
+       .xfer = g94_i2c_aux_xfer,
+};
+
+int
+gf119_i2c_aux_new(struct nvkm_i2c_pad *pad, int index, u8 drive,
+                 struct nvkm_i2c_aux **paux)
+{
+       return g94_i2c_aux_new_(&gf119_i2c_aux, pad, index, drive, paux);
+}
index ee091fa79628e1da1864d230731d4dd8e94e5cfa..7ef60895f43a7808229a8d72e27b2b54d67f3d48 100644 (file)
@@ -105,9 +105,9 @@ gm200_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry,
        }
 
        ctrl  = nvkm_rd32(device, 0x00d954 + base);
-       ctrl &= ~0x0001f0ff;
+       ctrl &= ~0x0001f1ff;
        ctrl |= type << 12;
-       ctrl |= *size - 1;
+       ctrl |= (*size ? (*size - 1) : 0x00000100);
        nvkm_wr32(device, 0x00d950 + base, addr);
 
        /* (maybe) retry transaction a number of times on failure... */
@@ -162,6 +162,7 @@ out:
 
 static const struct nvkm_i2c_aux_func
 gm200_i2c_aux_func = {
+       .address_only = true,
        .xfer = gm200_i2c_aux_xfer,
 };
 
index d53212f1aa52731dc7929d2b89637d6a5d1c51b9..3bc4d03100767da585ad9d6dbd95483be3174403 100644 (file)
@@ -28,7 +28,7 @@
 static const struct nvkm_i2c_pad_func
 gf119_i2c_pad_s_func = {
        .bus_new_4 = gf119_i2c_bus_new,
-       .aux_new_6 = g94_i2c_aux_new,
+       .aux_new_6 = gf119_i2c_aux_new,
        .mode = g94_i2c_pad_mode,
 };
 
@@ -41,7 +41,7 @@ gf119_i2c_pad_s_new(struct nvkm_i2c *i2c, int id, struct nvkm_i2c_pad **ppad)
 static const struct nvkm_i2c_pad_func
 gf119_i2c_pad_x_func = {
        .bus_new_4 = gf119_i2c_bus_new,
-       .aux_new_6 = g94_i2c_aux_new,
+       .aux_new_6 = gf119_i2c_aux_new,
 };
 
 int
index 50c41c0a50ef3f989553bc091193b57288a28914..dcc539ba85d65da734d9a94a77bfc6b09d62b05e 100644 (file)
@@ -5,6 +5,10 @@ config DRM_ROCKCHIP
        select DRM_KMS_HELPER
        select DRM_PANEL
        select VIDEOMODE_HELPERS
+       select DRM_ANALOGIX_DP if ROCKCHIP_ANALOGIX_DP
+       select DRM_DW_HDMI if ROCKCHIP_DW_HDMI
+       select DRM_MIPI_DSI if ROCKCHIP_DW_MIPI_DSI
+       select SND_SOC_HDMI_CODEC if ROCKCHIP_CDN_DP && SND_SOC
        help
          Choose this option if you have a Rockchip soc chipset.
          This driver provides kernel mode setting and buffer
@@ -12,10 +16,10 @@ config DRM_ROCKCHIP
          2D or 3D acceleration; acceleration is performed by other
          IP found on the SoC.
 
+if DRM_ROCKCHIP
+
 config ROCKCHIP_ANALOGIX_DP
        bool "Rockchip specific extensions for Analogix DP driver"
-       depends on DRM_ROCKCHIP
-       select DRM_ANALOGIX_DP
        help
          This selects support for Rockchip SoC specific extensions
          for the Analogix Core DP driver. If you want to enable DP
@@ -23,9 +27,7 @@ config ROCKCHIP_ANALOGIX_DP
 
 config ROCKCHIP_CDN_DP
         bool "Rockchip cdn DP"
-        depends on DRM_ROCKCHIP
-       depends on EXTCON
-       select SND_SOC_HDMI_CODEC if SND_SOC
+       depends on EXTCON=y || (EXTCON=m && DRM_ROCKCHIP=m)
         help
          This selects support for Rockchip SoC specific extensions
          for the cdn DP driver. If you want to enable Dp on
@@ -34,8 +36,6 @@ config ROCKCHIP_CDN_DP
 
 config ROCKCHIP_DW_HDMI
         bool "Rockchip specific extensions for Synopsys DW HDMI"
-        depends on DRM_ROCKCHIP
-        select DRM_DW_HDMI
         help
          This selects support for Rockchip SoC specific extensions
          for the Synopsys DesignWare HDMI driver. If you want to
@@ -44,8 +44,6 @@ config ROCKCHIP_DW_HDMI
 
 config ROCKCHIP_DW_MIPI_DSI
        bool "Rockchip specific extensions for Synopsys DW MIPI DSI"
-       depends on DRM_ROCKCHIP
-       select DRM_MIPI_DSI
        help
         This selects support for Rockchip SoC specific extensions
         for the Synopsys DesignWare HDMI driver. If you want to
@@ -54,8 +52,9 @@ config ROCKCHIP_DW_MIPI_DSI
 
 config ROCKCHIP_INNO_HDMI
        bool "Rockchip specific extensions for Innosilicon HDMI"
-       depends on DRM_ROCKCHIP
        help
          This selects support for Rockchip SoC specific extensions
          for the Innosilicon HDMI driver. If you want to enable
          HDMI on RK3036 based SoC, you should select this option.
+
+endif
index 35bf781e418e339eae86760c04697b9a1b128d25..c7056322211cc80fa5b42742ffcd496973d19ed6 100644 (file)
 #include <drm/ttm/ttm_placement.h>
 #include <drm/ttm/ttm_page_alloc.h>
 
-static struct ttm_place vram_placement_flags = {
+static const struct ttm_place vram_placement_flags = {
        .fpfn = 0,
        .lpfn = 0,
        .flags = TTM_PL_FLAG_VRAM | TTM_PL_FLAG_CACHED
 };
 
-static struct ttm_place vram_ne_placement_flags = {
+static const struct ttm_place vram_ne_placement_flags = {
        .fpfn = 0,
        .lpfn = 0,
        .flags = TTM_PL_FLAG_VRAM | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT
 };
 
-static struct ttm_place sys_placement_flags = {
+static const struct ttm_place sys_placement_flags = {
        .fpfn = 0,
        .lpfn = 0,
        .flags = TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED
 };
 
-static struct ttm_place sys_ne_placement_flags = {
+static const struct ttm_place sys_ne_placement_flags = {
        .fpfn = 0,
        .lpfn = 0,
        .flags = TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT
 };
 
-static struct ttm_place gmr_placement_flags = {
+static const struct ttm_place gmr_placement_flags = {
        .fpfn = 0,
        .lpfn = 0,
        .flags = VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED
 };
 
-static struct ttm_place gmr_ne_placement_flags = {
+static const struct ttm_place gmr_ne_placement_flags = {
        .fpfn = 0,
        .lpfn = 0,
        .flags = VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT
 };
 
-static struct ttm_place mob_placement_flags = {
+static const struct ttm_place mob_placement_flags = {
        .fpfn = 0,
        .lpfn = 0,
        .flags = VMW_PL_FLAG_MOB | TTM_PL_FLAG_CACHED
 };
 
-static struct ttm_place mob_ne_placement_flags = {
+static const struct ttm_place mob_ne_placement_flags = {
        .fpfn = 0,
        .lpfn = 0,
        .flags = VMW_PL_FLAG_MOB | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT
@@ -85,7 +85,7 @@ struct ttm_placement vmw_vram_placement = {
        .busy_placement = &vram_placement_flags
 };
 
-static struct ttm_place vram_gmr_placement_flags[] = {
+static const struct ttm_place vram_gmr_placement_flags[] = {
        {
                .fpfn = 0,
                .lpfn = 0,
@@ -97,7 +97,7 @@ static struct ttm_place vram_gmr_placement_flags[] = {
        }
 };
 
-static struct ttm_place gmr_vram_placement_flags[] = {
+static const struct ttm_place gmr_vram_placement_flags[] = {
        {
                .fpfn = 0,
                .lpfn = 0,
@@ -116,7 +116,7 @@ struct ttm_placement vmw_vram_gmr_placement = {
        .busy_placement = &gmr_placement_flags
 };
 
-static struct ttm_place vram_gmr_ne_placement_flags[] = {
+static const struct ttm_place vram_gmr_ne_placement_flags[] = {
        {
                .fpfn = 0,
                .lpfn = 0,
@@ -165,7 +165,7 @@ struct ttm_placement vmw_sys_ne_placement = {
        .busy_placement = &sys_ne_placement_flags
 };
 
-static struct ttm_place evictable_placement_flags[] = {
+static const struct ttm_place evictable_placement_flags[] = {
        {
                .fpfn = 0,
                .lpfn = 0,
index 99a7f4ab7d97edf1652aae7a04ec0f8cf51c9e6f..86178796de6c354a32cf1ef35637aa459d8cb7b5 100644 (file)
@@ -779,8 +779,8 @@ static int vmw_cmdbuf_space_pool(struct vmw_cmdbuf_man *man,
        if (ret)
                return ret;
 
-       header->cb_header = dma_pool_alloc(man->headers, GFP_KERNEL,
-                                          &header->handle);
+       header->cb_header = dma_pool_zalloc(man->headers, GFP_KERNEL,
+                                           &header->handle);
        if (!header->cb_header) {
                ret = -ENOMEM;
                goto out_no_cb_header;
@@ -790,7 +790,6 @@ static int vmw_cmdbuf_space_pool(struct vmw_cmdbuf_man *man,
        cb_hdr = header->cb_header;
        offset = header->node.start << PAGE_SHIFT;
        header->cmd = man->map + offset;
-       memset(cb_hdr, 0, sizeof(*cb_hdr));
        if (man->using_mob) {
                cb_hdr->flags = SVGA_CB_FLAG_MOB;
                cb_hdr->ptr.mob.mobid = man->cmd_space->mem.start;
@@ -827,8 +826,8 @@ static int vmw_cmdbuf_space_inline(struct vmw_cmdbuf_man *man,
        if (WARN_ON_ONCE(size > VMW_CMDBUF_INLINE_SIZE))
                return -ENOMEM;
 
-       dheader = dma_pool_alloc(man->dheaders, GFP_KERNEL,
-                                &header->handle);
+       dheader = dma_pool_zalloc(man->dheaders, GFP_KERNEL,
+                                 &header->handle);
        if (!dheader)
                return -ENOMEM;
 
@@ -837,7 +836,6 @@ static int vmw_cmdbuf_space_inline(struct vmw_cmdbuf_man *man,
        cb_hdr = &dheader->cb_header;
        header->cb_header = cb_hdr;
        header->cmd = dheader->cmd;
-       memset(dheader, 0, sizeof(*dheader));
        cb_hdr->status = SVGA_CB_STATUS_NONE;
        cb_hdr->flags = SVGA_CB_FLAG_NONE;
        cb_hdr->ptr.pa = (u64)header->handle +
index 1f013d45c9e9a3959dfa19300ba76fc37820592a..36c7b6c839c0dd230752cba96c348b40e2c65c65 100644 (file)
@@ -205,7 +205,7 @@ int vmw_cmdbuf_res_add(struct vmw_cmdbuf_res_manager *man,
        int ret;
 
        cres = kzalloc(sizeof(*cres), GFP_KERNEL);
-       if (unlikely(cres == NULL))
+       if (unlikely(!cres))
                return -ENOMEM;
 
        cres->hash.key = user_key | (res_type << 24);
@@ -291,7 +291,7 @@ vmw_cmdbuf_res_man_create(struct vmw_private *dev_priv)
        int ret;
 
        man = kzalloc(sizeof(*man), GFP_KERNEL);
-       if (man == NULL)
+       if (!man)
                return ERR_PTR(-ENOMEM);
 
        man->dev_priv = dev_priv;
index bcc6d4136c878ef159e0aeefcf00f294fc565ef2..4212b3e673bce2df55c5c6b71894a97fbe9b7c5f 100644 (file)
@@ -210,8 +210,8 @@ static int vmw_gb_context_init(struct vmw_private *dev_priv,
                for (i = 0; i < SVGA_COTABLE_DX10_MAX; ++i) {
                        uctx->cotables[i] = vmw_cotable_alloc(dev_priv,
                                                              &uctx->res, i);
-                       if (unlikely(uctx->cotables[i] == NULL)) {
-                               ret = -ENOMEM;
+                       if (unlikely(IS_ERR(uctx->cotables[i]))) {
+                               ret = PTR_ERR(uctx->cotables[i]);
                                goto out_cotables;
                        }
                }
@@ -777,7 +777,7 @@ static int vmw_context_define(struct drm_device *dev, void *data,
        }
 
        ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
-       if (unlikely(ctx == NULL)) {
+       if (unlikely(!ctx)) {
                ttm_mem_global_free(vmw_mem_glob(dev_priv),
                                    vmw_user_context_size);
                ret = -ENOMEM;
index 6c026d75c18043a9e8f6926e21f3bef917038f8a..d87861bbe971b1d474e1ab2b43cd2097bd2c32de 100644 (file)
@@ -584,7 +584,7 @@ struct vmw_resource *vmw_cotable_alloc(struct vmw_private *dev_priv,
                return ERR_PTR(ret);
 
        vcotbl = kzalloc(sizeof(*vcotbl), GFP_KERNEL);
-       if (unlikely(vcotbl == NULL)) {
+       if (unlikely(!vcotbl)) {
                ret = -ENOMEM;
                goto out_no_alloc;
        }
index 4a641555b960b8fc654c6ab89c428e783a61aad4..4436d53ae16c7da1e15769e446015c69f6495995 100644 (file)
@@ -227,7 +227,7 @@ static const struct drm_ioctl_desc vmw_ioctls[] = {
                      DRM_AUTH | DRM_RENDER_ALLOW),
 };
 
-static struct pci_device_id vmw_pci_id_list[] = {
+static const struct pci_device_id vmw_pci_id_list[] = {
        {0x15ad, 0x0405, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VMWGFX_CHIP_SVGAII},
        {0, 0, 0}
 };
@@ -630,7 +630,7 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)
        char host_log[100] = {0};
 
        dev_priv = kzalloc(sizeof(*dev_priv), GFP_KERNEL);
-       if (unlikely(dev_priv == NULL)) {
+       if (unlikely(!dev_priv)) {
                DRM_ERROR("Failed allocating a device private struct.\n");
                return -ENOMEM;
        }
@@ -1035,7 +1035,7 @@ static int vmw_driver_open(struct drm_device *dev, struct drm_file *file_priv)
        int ret = -ENOMEM;
 
        vmw_fp = kzalloc(sizeof(*vmw_fp), GFP_KERNEL);
-       if (unlikely(vmw_fp == NULL))
+       if (unlikely(!vmw_fp))
                return ret;
 
        vmw_fp->tfile = ttm_object_file_init(dev_priv->tdev, 10);
@@ -1196,7 +1196,7 @@ static int vmw_master_create(struct drm_device *dev,
        struct vmw_master *vmaster;
 
        vmaster = kzalloc(sizeof(*vmaster), GFP_KERNEL);
-       if (unlikely(vmaster == NULL))
+       if (unlikely(!vmaster))
                return -ENOMEM;
 
        vmw_master_init(vmaster);
index c7b53d987f06c923c53eaafb0fccdd9631ba72a7..2cfb3c93f42ab430be0b36ae78c40897ef75cc4c 100644 (file)
@@ -264,7 +264,7 @@ static int vmw_resource_val_add(struct vmw_sw_context *sw_context,
        }
 
        node = kzalloc(sizeof(*node), GFP_KERNEL);
-       if (unlikely(node == NULL)) {
+       if (unlikely(!node)) {
                DRM_ERROR("Failed to allocate a resource validation "
                          "entry.\n");
                return -ENOMEM;
@@ -452,7 +452,7 @@ static int vmw_resource_relocation_add(struct list_head *list,
        struct vmw_resource_relocation *rel;
 
        rel = kmalloc(sizeof(*rel), GFP_KERNEL);
-       if (unlikely(rel == NULL)) {
+       if (unlikely(!rel)) {
                DRM_ERROR("Failed to allocate a resource relocation.\n");
                return -ENOMEM;
        }
@@ -519,7 +519,7 @@ static int vmw_cmd_invalid(struct vmw_private *dev_priv,
                           struct vmw_sw_context *sw_context,
                           SVGA3dCmdHeader *header)
 {
-       return capable(CAP_SYS_ADMIN) ? : -EINVAL;
+       return -EINVAL;
 }
 
 static int vmw_cmd_ok(struct vmw_private *dev_priv,
@@ -2584,7 +2584,7 @@ static int vmw_cmd_dx_set_vertex_buffers(struct vmw_private *dev_priv,
 
 /**
  * vmw_cmd_dx_ia_set_vertex_buffers - Validate an
- * SVGA_3D_CMD_DX_IA_SET_VERTEX_BUFFERS command.
+ * SVGA_3D_CMD_DX_IA_SET_INDEX_BUFFER command.
  *
  * @dev_priv: Pointer to a device private struct.
  * @sw_context: The software context being used for this batch.
index 6b2708b4eafe84c832d41a10f75c2be9e65fc0b9..b8bc5bc7de7e0d4616cbbfe6fbee1d309aa55360 100644 (file)
@@ -284,7 +284,7 @@ struct vmw_fence_manager *vmw_fence_manager_init(struct vmw_private *dev_priv)
 {
        struct vmw_fence_manager *fman = kzalloc(sizeof(*fman), GFP_KERNEL);
 
-       if (unlikely(fman == NULL))
+       if (unlikely(!fman))
                return NULL;
 
        fman->dev_priv = dev_priv;
@@ -541,7 +541,7 @@ int vmw_fence_create(struct vmw_fence_manager *fman,
        int ret;
 
        fence = kzalloc(sizeof(*fence), GFP_KERNEL);
-       if (unlikely(fence == NULL))
+       if (unlikely(!fence))
                return -ENOMEM;
 
        ret = vmw_fence_obj_init(fman, fence, seqno,
@@ -606,7 +606,7 @@ int vmw_user_fence_create(struct drm_file *file_priv,
                return ret;
 
        ufence = kzalloc(sizeof(*ufence), GFP_KERNEL);
-       if (unlikely(ufence == NULL)) {
+       if (unlikely(!ufence)) {
                ret = -ENOMEM;
                goto out_no_object;
        }
@@ -966,7 +966,7 @@ int vmw_event_fence_action_queue(struct drm_file *file_priv,
        struct vmw_fence_manager *fman = fman_from_fence(fence);
 
        eaction = kzalloc(sizeof(*eaction), GFP_KERNEL);
-       if (unlikely(eaction == NULL))
+       if (unlikely(!eaction))
                return -ENOMEM;
 
        eaction->event = event;
@@ -1002,7 +1002,7 @@ static int vmw_event_fence_action_create(struct drm_file *file_priv,
        int ret;
 
        event = kzalloc(sizeof(*event), GFP_KERNEL);
-       if (unlikely(event == NULL)) {
+       if (unlikely(!event)) {
                DRM_ERROR("Failed to allocate an event.\n");
                ret = -ENOMEM;
                goto out_no_space;
index c1900f4390a41efbf5a613fb6f451d391e336fed..d2b03d4a3c867d11a0167f3ff7ba85b246289b88 100644 (file)
@@ -121,7 +121,7 @@ static int vmw_gmrid_man_init(struct ttm_mem_type_manager *man,
        struct vmwgfx_gmrid_man *gman =
                kzalloc(sizeof(*gman), GFP_KERNEL);
 
-       if (unlikely(gman == NULL))
+       if (unlikely(!gman))
                return -ENOMEM;
 
        spin_lock_init(&gman->lock);
index 3d94ea67a825e1cf37d9075035283236ebff69fa..61e06f0e8cd3b43890e807a2ab2bb9037ac95e99 100644 (file)
@@ -384,6 +384,12 @@ vmw_du_cursor_plane_atomic_update(struct drm_plane *plane,
 
        hotspot_x = du->hotspot_x;
        hotspot_y = du->hotspot_y;
+
+       if (plane->fb) {
+               hotspot_x += plane->fb->hot_x;
+               hotspot_y += plane->fb->hot_y;
+       }
+
        du->cursor_surface = vps->surf;
        du->cursor_dmabuf = vps->dmabuf;
 
@@ -411,6 +417,9 @@ vmw_du_cursor_plane_atomic_update(struct drm_plane *plane,
                vmw_cursor_update_position(dev_priv, true,
                                           du->cursor_x + hotspot_x,
                                           du->cursor_y + hotspot_y);
+
+               du->core_hotspot_x = hotspot_x - du->hotspot_x;
+               du->core_hotspot_y = hotspot_y - du->hotspot_y;
        } else {
                DRM_ERROR("Failed to update cursor image\n");
        }
index 941bcfd131ff7a169472b0b92c62cf7a40e01bd9..b17f08fc50d3fa2306505bedf33d6eea1ec7e323 100644 (file)
@@ -320,14 +320,14 @@ int vmw_otables_setup(struct vmw_private *dev_priv)
 
        if (dev_priv->has_dx) {
                *otables = kmemdup(dx_tables, sizeof(dx_tables), GFP_KERNEL);
-               if (*otables == NULL)
+               if (!(*otables))
                        return -ENOMEM;
 
                dev_priv->otable_batch.num_otables = ARRAY_SIZE(dx_tables);
        } else {
                *otables = kmemdup(pre_dx_tables, sizeof(pre_dx_tables),
                                   GFP_KERNEL);
-               if (*otables == NULL)
+               if (!(*otables))
                        return -ENOMEM;
 
                dev_priv->otable_batch.num_otables = ARRAY_SIZE(pre_dx_tables);
@@ -407,7 +407,7 @@ struct vmw_mob *vmw_mob_create(unsigned long data_pages)
 {
        struct vmw_mob *mob = kzalloc(sizeof(*mob), GFP_KERNEL);
 
-       if (unlikely(mob == NULL))
+       if (unlikely(!mob))
                return NULL;
 
        mob->num_pages = vmw_mob_calculate_pt_pages(data_pages);
index 6063c9636d4a08f0b908eb54531b8f2efb818bd8..97000996b8dc5122ba5d8109af5b14930b6f4e60 100644 (file)
@@ -244,7 +244,7 @@ static int vmw_recv_msg(struct rpc_channel *channel, void **msg,
 
                reply_len = ebx;
                reply     = kzalloc(reply_len + 1, GFP_KERNEL);
-               if (reply == NULL) {
+               if (!reply) {
                        DRM_ERROR("Cannot allocate memory for reply\n");
                        return -ENOMEM;
                }
@@ -340,7 +340,7 @@ int vmw_host_get_guestinfo(const char *guest_info_param,
 
        msg_len = strlen(guest_info_param) + strlen("info-get ") + 1;
        msg = kzalloc(msg_len, GFP_KERNEL);
-       if (msg == NULL) {
+       if (!msg) {
                DRM_ERROR("Cannot allocate memory to get %s", guest_info_param);
                return -ENOMEM;
        }
@@ -400,7 +400,7 @@ int vmw_host_log(const char *log)
 
        msg_len = strlen(log) + strlen("log ") + 1;
        msg = kzalloc(msg_len, GFP_KERNEL);
-       if (msg == NULL) {
+       if (!msg) {
                DRM_ERROR("Cannot allocate memory for log message\n");
                return -ENOMEM;
        }
index 7d591f653dfa323e5f51f0bfeca58dac44bf5fa4..a96f90f017d16072423a95302779e54444339cd4 100644 (file)
@@ -446,7 +446,7 @@ int vmw_user_dmabuf_alloc(struct vmw_private *dev_priv,
        int ret;
 
        user_bo = kzalloc(sizeof(*user_bo), GFP_KERNEL);
-       if (unlikely(user_bo == NULL)) {
+       if (unlikely(!user_bo)) {
                DRM_ERROR("Failed to allocate a buffer.\n");
                return -ENOMEM;
        }
@@ -836,7 +836,7 @@ static int vmw_resource_buf_alloc(struct vmw_resource *res,
        }
 
        backup = kzalloc(sizeof(*backup), GFP_KERNEL);
-       if (unlikely(backup == NULL))
+       if (unlikely(!backup))
                return -ENOMEM;
 
        ret = vmw_dmabuf_init(res->dev_priv, backup, res->backup_size,
index 68f135c5b0d8e0b81dff7dd039ea1a032683f89b..9b832f13681370e38cf3345f1eb6f5415f715c71 100644 (file)
@@ -751,7 +751,7 @@ static int vmw_user_shader_alloc(struct vmw_private *dev_priv,
        }
 
        ushader = kzalloc(sizeof(*ushader), GFP_KERNEL);
-       if (unlikely(ushader == NULL)) {
+       if (unlikely(!ushader)) {
                ttm_mem_global_free(vmw_mem_glob(dev_priv),
                                    vmw_user_shader_size);
                ret = -ENOMEM;
@@ -821,7 +821,7 @@ static struct vmw_resource *vmw_shader_alloc(struct vmw_private *dev_priv,
        }
 
        shader = kzalloc(sizeof(*shader), GFP_KERNEL);
-       if (unlikely(shader == NULL)) {
+       if (unlikely(!shader)) {
                ttm_mem_global_free(vmw_mem_glob(dev_priv),
                                    vmw_shader_size);
                ret = -ENOMEM;
@@ -981,7 +981,7 @@ int vmw_compat_shader_add(struct vmw_private *dev_priv,
 
        /* Allocate and pin a DMA buffer */
        buf = kzalloc(sizeof(*buf), GFP_KERNEL);
-       if (unlikely(buf == NULL))
+       if (unlikely(!buf))
                return -ENOMEM;
 
        ret = vmw_dmabuf_init(dev_priv, buf, size, &vmw_sys_ne_placement,
index 50be1f034f9efa701f2c6feda57fe28d8cf6d596..5284e8d2f7ba4b0f3c45972c3446800a8debceeb 100644 (file)
@@ -1640,8 +1640,8 @@ int vmw_kms_stdu_init_display(struct vmw_private *dev_priv)
                 * something arbitrarily large and we will reject any layout
                 * that doesn't fit prim_bb_mem later
                 */
-               dev->mode_config.max_width = 16384;
-               dev->mode_config.max_height = 16384;
+               dev->mode_config.max_width = 8192;
+               dev->mode_config.max_height = 8192;
        }
 
        vmw_kms_create_implicit_placement_property(dev_priv, false);
index 2c58a390123a1a7c3f8a4e6fd6f11a34f3340fbe..7782725141648360cedd89f3363155da5f7c8d9c 100644 (file)
@@ -186,8 +186,13 @@ static int host1x_probe(struct platform_device *pdev)
                        return -ENOMEM;
 
                err = iommu_attach_device(host->domain, &pdev->dev);
-               if (err)
+               if (err == -ENODEV) {
+                       iommu_domain_free(host->domain);
+                       host->domain = NULL;
+                       goto skip_iommu;
+               } else if (err) {
                        goto fail_free_domain;
+               }
 
                geometry = &host->domain->geometry;
 
@@ -198,6 +203,7 @@ static int host1x_probe(struct platform_device *pdev)
                host->iova_end = geometry->aperture_end;
        }
 
+skip_iommu:
        err = host1x_channel_list_init(&host->channel_list,
                                       host->info->nb_channels);
        if (err) {