Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'linux-4.3' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-fixes

Nothing too crazy here, a couple of regression fixes + runpm/fbcon
race fix.

* 'linux-4.3' of git://anongit.freedesktop.org/git/nouveau/linux-2.6:
drm/nouveau/bios: fix OF loading
drm/nouveau/fbcon: take runpm reference when userspace has an open fd
drm/nouveau/nouveau: Disable AGP for SiS 761
drm/nouveau/display: allow up to 16k width/height for fermi+
drm/nouveau/bios: translate devinit pri/sec i2c bus to internal identifiers

+77 -14
+5 -1
drivers/gpu/drm/nouveau/nouveau_display.c
··· 469 469 if (drm->device.info.family < NV_DEVICE_INFO_V0_TESLA) { 470 470 dev->mode_config.max_width = 4096; 471 471 dev->mode_config.max_height = 4096; 472 - } else { 472 + } else 473 + if (drm->device.info.family < NV_DEVICE_INFO_V0_FERMI) { 473 474 dev->mode_config.max_width = 8192; 474 475 dev->mode_config.max_height = 8192; 476 + } else { 477 + dev->mode_config.max_width = 16384; 478 + dev->mode_config.max_height = 16384; 475 479 } 476 480 477 481 dev->mode_config.preferred_depth = 24;
+24
drivers/gpu/drm/nouveau/nouveau_fbcon.c
··· 178 178 return 0; 179 179 } 180 180 181 + static int 182 + nouveau_fbcon_open(struct fb_info *info, int user) 183 + { 184 + struct nouveau_fbdev *fbcon = info->par; 185 + struct nouveau_drm *drm = nouveau_drm(fbcon->dev); 186 + int ret = pm_runtime_get_sync(drm->dev->dev); 187 + if (ret < 0 && ret != -EACCES) 188 + return ret; 189 + return 0; 190 + } 191 + 192 + static int 193 + nouveau_fbcon_release(struct fb_info *info, int user) 194 + { 195 + struct nouveau_fbdev *fbcon = info->par; 196 + struct nouveau_drm *drm = nouveau_drm(fbcon->dev); 197 + pm_runtime_put(drm->dev->dev); 198 + return 0; 199 + } 200 + 181 201 static struct fb_ops nouveau_fbcon_ops = { 182 202 .owner = THIS_MODULE, 203 + .fb_open = nouveau_fbcon_open, 204 + .fb_release = nouveau_fbcon_release, 183 205 .fb_check_var = drm_fb_helper_check_var, 184 206 .fb_set_par = drm_fb_helper_set_par, 185 207 .fb_fillrect = nouveau_fbcon_fillrect, ··· 217 195 218 196 static struct fb_ops nouveau_fbcon_sw_ops = { 219 197 .owner = THIS_MODULE, 198 + .fb_open = nouveau_fbcon_open, 199 + .fb_release = nouveau_fbcon_release, 220 200 .fb_check_var = drm_fb_helper_check_var, 221 201 .fb_set_par = drm_fb_helper_set_par, 222 202 .fb_fillrect = drm_fb_helper_cfb_fillrect,
+6
drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c
··· 267 267 index = NVKM_I2C_BUS_PRI; 268 268 if (init->outp && init->outp->i2c_upper_default) 269 269 index = NVKM_I2C_BUS_SEC; 270 + } else 271 + if (index == 0x80) { 272 + index = NVKM_I2C_BUS_PRI; 273 + } else 274 + if (index == 0x81) { 275 + index = NVKM_I2C_BUS_SEC; 270 276 } 271 277 272 278 bus = nvkm_i2c_bus_find(i2c, index);
+3
drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
··· 8 8 void *(*init)(struct nvkm_bios *, const char *); 9 9 void (*fini)(void *); 10 10 u32 (*read)(void *, u32 offset, u32 length, struct nvkm_bios *); 11 + u32 (*size)(void *); 11 12 bool rw; 13 + bool ignore_checksum; 14 + bool no_pcir; 12 15 }; 13 16 14 17 int nvbios_extend(struct nvkm_bios *, u32 length);
+18 -9
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
··· 45 45 u32 read = mthd->func->read(data, start, limit - start, bios); 46 46 bios->size = start + read; 47 47 } 48 - return bios->size >= limit; 48 + return bios->size >= upto; 49 49 } 50 50 51 51 static int ··· 55 55 struct nvbios_image image; 56 56 int score = 1; 57 57 58 - if (!shadow_fetch(bios, mthd, offset + 0x1000)) { 59 - nvkm_debug(subdev, "%08x: header fetch failed\n", offset); 60 - return 0; 61 - } 58 + if (mthd->func->no_pcir) { 59 + image.base = 0; 60 + image.type = 0; 61 + image.size = mthd->func->size(mthd->data); 62 + image.last = 1; 63 + } else { 64 + if (!shadow_fetch(bios, mthd, offset + 0x1000)) { 65 + nvkm_debug(subdev, "%08x: header fetch failed\n", 66 + offset); 67 + return 0; 68 + } 62 69 63 - if (!nvbios_image(bios, idx, &image)) { 64 - nvkm_debug(subdev, "image %d invalid\n", idx); 65 - return 0; 70 + if (!nvbios_image(bios, idx, &image)) { 71 + nvkm_debug(subdev, "image %d invalid\n", idx); 72 + return 0; 73 + } 66 74 } 67 75 nvkm_debug(subdev, "%08x: type %02x, %d bytes\n", 68 76 image.base, image.type, image.size); ··· 82 74 83 75 switch (image.type) { 84 76 case 0x00: 85 - if (nvbios_checksum(&bios->data[image.base], image.size)) { 77 + if (!mthd->func->ignore_checksum && 78 + nvbios_checksum(&bios->data[image.base], image.size)) { 86 79 nvkm_debug(subdev, "%08x: checksum failed\n", 87 80 image.base); 88 81 if (mthd->func->rw)
+15 -2
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c
··· 21 21 * 22 22 */ 23 23 #include "priv.h" 24 + 24 25 #include <core/pci.h> 25 26 26 27 #if defined(__powerpc__) ··· 34 33 of_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios) 35 34 { 36 35 struct priv *priv = data; 37 - if (offset + length <= priv->size) { 36 + if (offset < priv->size) { 37 + length = min_t(u32, length, priv->size - offset); 38 38 memcpy_fromio(bios->data + offset, priv->data + offset, length); 39 39 return length; 40 40 } 41 41 return 0; 42 42 } 43 43 44 + static u32 45 + of_size(void *data) 46 + { 47 + struct priv *priv = data; 48 + return priv->size; 49 + } 50 + 44 51 static void * 45 52 of_init(struct nvkm_bios *bios, const char *name) 46 53 { 47 - struct pci_dev *pdev = bios->subdev.device->func->pci(bios->subdev.device)->pdev; 54 + struct nvkm_device *device = bios->subdev.device; 55 + struct pci_dev *pdev = device->func->pci(device)->pdev; 48 56 struct device_node *dn; 49 57 struct priv *priv; 50 58 if (!(dn = pci_device_to_OF_node(pdev))) ··· 72 62 .init = of_init, 73 63 .fini = (void(*)(void *))kfree, 74 64 .read = of_read, 65 + .size = of_size, 75 66 .rw = false, 67 + .ignore_checksum = true, 68 + .no_pcir = true, 76 69 }; 77 70 #else 78 71 const struct nvbios_source
+6 -2
drivers/gpu/drm/nouveau/nvkm/subdev/pci/agp.c
··· 35 35 nvkm_device_agp_quirks[] = { 36 36 /* VIA Apollo PRO133x / GeForce FX 5600 Ultra - fdo#20341 */ 37 37 { PCI_VENDOR_ID_VIA, 0x0691, PCI_VENDOR_ID_NVIDIA, 0x0311, 2 }, 38 + /* SiS 761 does not support AGP cards, use PCI mode */ 39 + { PCI_VENDOR_ID_SI, 0x0761, PCI_ANY_ID, PCI_ANY_ID, 0 }, 38 40 {}, 39 41 }; 40 42 ··· 139 137 while (quirk->hostbridge_vendor) { 140 138 if (info.device->vendor == quirk->hostbridge_vendor && 141 139 info.device->device == quirk->hostbridge_device && 142 - pci->pdev->vendor == quirk->chip_vendor && 143 - pci->pdev->device == quirk->chip_device) { 140 + (quirk->chip_vendor == (u16)PCI_ANY_ID || 141 + pci->pdev->vendor == quirk->chip_vendor) && 142 + (quirk->chip_device == (u16)PCI_ANY_ID || 143 + pci->pdev->device == quirk->chip_device)) { 144 144 nvkm_info(subdev, "forcing default agp mode to %dX, " 145 145 "use NvAGP=<mode> to override\n", 146 146 quirk->mode);