Skip to content

Commit

Permalink
Merge tag 'drm-misc-next-2017-10-20' of git://anongit.freedesktop.org…
Browse files Browse the repository at this point in the history
…/drm/drm-misc into drm-next

Final drm-misc feature pull for 4.15:

UAPI Changes:
- new madvise ioctl for vc4 (Boris)

Core Changes:
- plane commit tracking fixes (Maarten)
- vgaarb improvements for fancy new platforms (aka ppc64 and arm64) by
  Bjorn Helgaas

Driver Changes:
- pile of new panel drivers: Toshiba LT089AC19000, Innolux AT043TN24
- more sun4i work to support A10/A20 Tcon and hdmi outputs
- vc4: fix sleep in irq handler by making it threaded (Eric)
- udl probe/edid read fixes (Robert Tarasov)

And a bunch of misc small cleanups/refactors and doc fixes all over.

* tag 'drm-misc-next-2017-10-20' of git://anongit.freedesktop.org/drm/drm-misc: (32 commits)
  drm/vc4: Fix sleeps during the IRQ handler for DSI transactions.
  drm/vc4: Add the DRM_IOCTL_VC4_GEM_MADVISE ioctl
  drm/panel: simple: add Toshiba LT089AC19000
  dma-fence: remove duplicate word in comment
  drm/panel: simple: add delays for Innolux AT043TN24
  drm/panel: simple: add bus flags for Innolux AT043TN24
  drm/panel: simple: fix vertical timings for Innolux AT043TN24
  drm/atomic-helper: check that drivers call drm_crtc_vblank_off
  drm: some KMS todo ideas
  vgaarb: Factor out EFI and fallback default device selection
  vgaarb: Select a default VGA device even if there's no legacy VGA
  drm/bridge: adv7511: Fix a use after free
  drm/sun4i: Add support for A20 display pipeline components
  drm/sun4i: Add support for A10 display pipeline components
  drm/sun4i: hdmi: Support HDMI controller on A10
  drm/sun4i: tcon: Add support for A10 TCON
  drm/sun4i: backend: Support output muxing
  drm/sun4i: tcon: Move out the tcon0 common setup
  drm/sun4i: tcon: Don't rely on encoders to set the TCON mode
  drm/sun4i: tcon: Don't rely on encoders to enable the TCON
  ...
  • Loading branch information
Dave Airlie committed Oct 24, 2017
2 parents 3b677e4 + af0c8c1 commit fef1aa4
Show file tree
Hide file tree
Showing 39 changed files with 1,154 additions and 356 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Toshiba 8.9" WXGA (1280x768) TFT LCD panel

Required properties:
- compatible: should be "toshiba,lt089ac29000.txt"
- power-supply: as specified in the base binding

This binding is compatible with the simple-panel binding, which is specified
in simple-panel.txt in this directory.
9 changes: 9 additions & 0 deletions Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ CEC. It is one end of the pipeline.

Required properties:
- compatible: value must be one of:
* allwinner,sun4i-a10-hdmi
* allwinner,sun5i-a10s-hdmi
* allwinner,sun6i-a31-hdmi
- reg: base address and size of memory-mapped region
Expand Down Expand Up @@ -86,9 +87,11 @@ The TCON acts as a timing controller for RGB, LVDS and TV interfaces.

Required properties:
- compatible: value must be either:
* allwinner,sun4i-a10-tcon
* allwinner,sun5i-a13-tcon
* allwinner,sun6i-a31-tcon
* allwinner,sun6i-a31s-tcon
* allwinner,sun7i-a20-tcon
* allwinner,sun8i-a33-tcon
* allwinner,sun8i-v3s-tcon
- reg: base address and size of memory-mapped region
Expand Down Expand Up @@ -153,8 +156,10 @@ system.

Required properties:
- compatible: value must be one of:
* allwinner,sun4i-a10-display-backend
* allwinner,sun5i-a13-display-backend
* allwinner,sun6i-a31-display-backend
* allwinner,sun7i-a20-display-backend
* allwinner,sun8i-a33-display-backend
- reg: base address and size of the memory-mapped region.
- interrupts: interrupt associated to this IP
Expand Down Expand Up @@ -185,8 +190,10 @@ deinterlacing and color space conversion.

Required properties:
- compatible: value must be one of:
* allwinner,sun4i-a10-display-frontend
* allwinner,sun5i-a13-display-frontend
* allwinner,sun6i-a31-display-frontend
* allwinner,sun7i-a20-display-frontend
* allwinner,sun8i-a33-display-frontend
- reg: base address and size of the memory-mapped region.
- interrupts: interrupt associated to this IP
Expand Down Expand Up @@ -231,10 +238,12 @@ extra node.

Required properties:
- compatible: value must be one of:
* allwinner,sun4i-a10-display-engine
* allwinner,sun5i-a10s-display-engine
* allwinner,sun5i-a13-display-engine
* allwinner,sun6i-a31-display-engine
* allwinner,sun6i-a31s-display-engine
* allwinner,sun7i-a20-display-engine
* allwinner,sun8i-a33-display-engine
* allwinner,sun8i-v3s-display-engine

Expand Down
12 changes: 12 additions & 0 deletions Documentation/gpu/todo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,18 @@ There's a bunch of issues with it:

Contact: Daniel Vetter

KMS cleanups
------------

Some of these date from the very introduction of KMS in 2008 ...

- drm_mode_config.crtc_idr is misnamed, since it contains all KMS object. Should
be renamed to drm_mode_config.object_idr.

- drm_display_mode doesn't need to be derived from drm_mode_object. That's
leftovers from older (never merged into upstream) KMS designs where modes
where set using their ID, including support to add/remove modes.

Better Testing
==============

Expand Down
12 changes: 0 additions & 12 deletions arch/powerpc/kernel/pci-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1740,15 +1740,3 @@ static void fixup_hide_host_resource_fsl(struct pci_dev *dev)
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MOTOROLA, PCI_ANY_ID, fixup_hide_host_resource_fsl);
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_FREESCALE, PCI_ANY_ID, fixup_hide_host_resource_fsl);

static void fixup_vga(struct pci_dev *pdev)
{
u16 cmd;

pci_read_config_word(pdev, PCI_COMMAND, &cmd);
if ((cmd & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) || !vga_default_device())
vga_set_default_device(pdev);

}
DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID,
PCI_CLASS_DISPLAY_VGA, 8, fixup_vga);
22 changes: 11 additions & 11 deletions drivers/gpu/drm/armada/armada_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ static void armada_drm_crtc_finish_fb(struct armada_crtc *dcrtc,

if (force) {
/* Display is disabled, so just drop the old fb */
drm_framebuffer_unreference(fb);
drm_framebuffer_put(fb);
return;
}

Expand All @@ -321,7 +321,7 @@ static void armada_drm_crtc_finish_fb(struct armada_crtc *dcrtc,
* the best. The worst that will happen is the buffer gets
* reused before it has finished being displayed.
*/
drm_framebuffer_unreference(fb);
drm_framebuffer_put(fb);
}

static void armada_drm_vblank_off(struct armada_crtc *dcrtc)
Expand Down Expand Up @@ -577,7 +577,7 @@ static int armada_drm_crtc_mode_set(struct drm_crtc *crtc,
unsigned i;
bool interlaced;

drm_framebuffer_reference(crtc->primary->fb);
drm_framebuffer_get(crtc->primary->fb);

interlaced = !!(adj->flags & DRM_MODE_FLAG_INTERLACE);

Expand Down Expand Up @@ -718,7 +718,7 @@ static int armada_drm_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
MAX_SCHEDULE_TIMEOUT);

/* Take a reference to the new fb as we're using it */
drm_framebuffer_reference(crtc->primary->fb);
drm_framebuffer_get(crtc->primary->fb);

/* Update the base in the CRTC */
armada_drm_crtc_update_regs(dcrtc, regs);
Expand All @@ -742,7 +742,7 @@ void armada_drm_crtc_plane_disable(struct armada_crtc *dcrtc,
* primary plane.
*/
if (plane->fb)
drm_framebuffer_unreference(plane->fb);
drm_framebuffer_put(plane->fb);

/* Power down the Y/U/V FIFOs */
sram_para1 = CFG_PDWN16x66 | CFG_PDWN32x66;
Expand Down Expand Up @@ -947,21 +947,21 @@ static int armada_drm_crtc_cursor_set(struct drm_crtc *crtc,

/* Must be a kernel-mapped object */
if (!obj->addr) {
drm_gem_object_unreference_unlocked(&obj->obj);
drm_gem_object_put_unlocked(&obj->obj);
return -EINVAL;
}

if (obj->obj.size < w * h * 4) {
DRM_ERROR("buffer is too small\n");
drm_gem_object_unreference_unlocked(&obj->obj);
drm_gem_object_put_unlocked(&obj->obj);
return -ENOMEM;
}
}

if (dcrtc->cursor_obj) {
dcrtc->cursor_obj->update = NULL;
dcrtc->cursor_obj->update_data = NULL;
drm_gem_object_unreference_unlocked(&dcrtc->cursor_obj->obj);
drm_gem_object_put_unlocked(&dcrtc->cursor_obj->obj);
}
dcrtc->cursor_obj = obj;
dcrtc->cursor_w = w;
Expand Down Expand Up @@ -997,7 +997,7 @@ static void armada_drm_crtc_destroy(struct drm_crtc *crtc)
struct armada_private *priv = crtc->dev->dev_private;

if (dcrtc->cursor_obj)
drm_gem_object_unreference_unlocked(&dcrtc->cursor_obj->obj);
drm_gem_object_put_unlocked(&dcrtc->cursor_obj->obj);

priv->dcrtc[dcrtc->num] = NULL;
drm_crtc_cleanup(&dcrtc->crtc);
Expand Down Expand Up @@ -1045,12 +1045,12 @@ static int armada_drm_crtc_page_flip(struct drm_crtc *crtc,
* Ensure that we hold a reference on the new framebuffer.
* This has to match the behaviour in mode_set.
*/
drm_framebuffer_reference(fb);
drm_framebuffer_get(fb);

ret = armada_drm_crtc_queue_frame_work(dcrtc, work);
if (ret) {
/* Undo our reference above */
drm_framebuffer_unreference(fb);
drm_framebuffer_put(fb);
kfree(work);
return ret;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/armada/armada_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static void armada_drm_unref_work(struct work_struct *work)
struct drm_framebuffer *fb;

while (kfifo_get(&priv->fb_unref, &fb))
drm_framebuffer_unreference(fb);
drm_framebuffer_put(fb);
}

/* Must be called with dev->event_lock held */
Expand Down
8 changes: 4 additions & 4 deletions drivers/gpu/drm/armada/armada_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static void armada_fb_destroy(struct drm_framebuffer *fb)
struct armada_framebuffer *dfb = drm_fb_to_armada_fb(fb);

drm_framebuffer_cleanup(&dfb->fb);
drm_gem_object_unreference_unlocked(&dfb->obj->obj);
drm_gem_object_put_unlocked(&dfb->obj->obj);
kfree(dfb);
}

Expand Down Expand Up @@ -94,7 +94,7 @@ struct armada_framebuffer *armada_framebuffer_create(struct drm_device *dev,
* the above call, but the caller will drop their reference
* to it. Hence we need to take our own reference.
*/
drm_gem_object_reference(&obj->obj);
drm_gem_object_get(&obj->obj);

return dfb;
}
Expand Down Expand Up @@ -143,12 +143,12 @@ static struct drm_framebuffer *armada_fb_create(struct drm_device *dev,
goto err;
}

drm_gem_object_unreference_unlocked(&obj->obj);
drm_gem_object_put_unlocked(&obj->obj);

return &dfb->fb;

err_unref:
drm_gem_object_unreference_unlocked(&obj->obj);
drm_gem_object_put_unlocked(&obj->obj);
err:
DRM_ERROR("failed to initialize framebuffer: %d\n", ret);
return ERR_PTR(ret);
Expand Down
6 changes: 3 additions & 3 deletions drivers/gpu/drm/armada/armada_fbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ static int armada_fb_create(struct drm_fb_helper *fbh,

ret = armada_gem_linear_back(dev, obj);
if (ret) {
drm_gem_object_unreference_unlocked(&obj->obj);
drm_gem_object_put_unlocked(&obj->obj);
return ret;
}

ptr = armada_gem_map_object(dev, obj);
if (!ptr) {
drm_gem_object_unreference_unlocked(&obj->obj);
drm_gem_object_put_unlocked(&obj->obj);
return -ENOMEM;
}

Expand All @@ -67,7 +67,7 @@ static int armada_fb_create(struct drm_fb_helper *fbh,
* A reference is now held by the framebuffer object if
* successful, otherwise this drops the ref for the error path.
*/
drm_gem_object_unreference_unlocked(&obj->obj);
drm_gem_object_put_unlocked(&obj->obj);

if (IS_ERR(dfb))
return PTR_ERR(dfb);
Expand Down
12 changes: 6 additions & 6 deletions drivers/gpu/drm/armada/armada_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ int armada_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
/* drop reference from allocate - handle holds it now */
DRM_DEBUG_DRIVER("obj %p size %zu handle %#x\n", dobj, size, handle);
err:
drm_gem_object_unreference_unlocked(&dobj->obj);
drm_gem_object_put_unlocked(&dobj->obj);
return ret;
}

Expand Down Expand Up @@ -297,7 +297,7 @@ int armada_gem_create_ioctl(struct drm_device *dev, void *data,
/* drop reference from allocate - handle holds it now */
DRM_DEBUG_DRIVER("obj %p size %zu handle %#x\n", dobj, size, handle);
err:
drm_gem_object_unreference_unlocked(&dobj->obj);
drm_gem_object_put_unlocked(&dobj->obj);
return ret;
}

Expand All @@ -314,13 +314,13 @@ int armada_gem_mmap_ioctl(struct drm_device *dev, void *data,
return -ENOENT;

if (!dobj->obj.filp) {
drm_gem_object_unreference_unlocked(&dobj->obj);
drm_gem_object_put_unlocked(&dobj->obj);
return -EINVAL;
}

addr = vm_mmap(dobj->obj.filp, 0, args->size, PROT_READ | PROT_WRITE,
MAP_SHARED, args->offset);
drm_gem_object_unreference_unlocked(&dobj->obj);
drm_gem_object_put_unlocked(&dobj->obj);
if (IS_ERR_VALUE(addr))
return addr;

Expand Down Expand Up @@ -375,7 +375,7 @@ int armada_gem_pwrite_ioctl(struct drm_device *dev, void *data,
}

unref:
drm_gem_object_unreference_unlocked(&dobj->obj);
drm_gem_object_put_unlocked(&dobj->obj);
return ret;
}

Expand Down Expand Up @@ -524,7 +524,7 @@ armada_gem_prime_import(struct drm_device *dev, struct dma_buf *buf)
* Importing our own dmabuf(s) increases the
* refcount on the gem object itself.
*/
drm_gem_object_reference(obj);
drm_gem_object_get(obj);
return obj;
}
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/armada/armada_overlay.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc,
* Take a reference on the new framebuffer - we want to
* hold on to it while the hardware is displaying it.
*/
drm_framebuffer_reference(fb);
drm_framebuffer_get(fb);

if (plane->fb)
armada_ovl_retire_fb(dplane, plane->fb);
Expand Down Expand Up @@ -278,7 +278,7 @@ static int armada_ovl_plane_disable(struct drm_plane *plane,

fb = xchg(&dplane->old_fb, NULL);
if (fb)
drm_framebuffer_unreference(fb);
drm_framebuffer_put(fb);

return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -607,10 +607,10 @@ static int adv7511_get_modes(struct adv7511 *adv7511,
adv7511_set_config_csc(adv7511, connector, adv7511->rgb,
drm_detect_hdmi_monitor(edid));

kfree(edid);

cec_s_phys_addr_from_edid(adv7511->cec_adap, edid);

kfree(edid);

return count;
}

Expand Down
Loading

0 comments on commit fef1aa4

Please sign in to comment.