Skip to content

Commit

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

Final 4.11 feature pull request:
- sii8520 bridge update from Andrzej
- ->release callback, maybe somewhen in the future we'll even get
  drm_device lifetimes correct! (Chris Wilson)
- drm_mm search improvements, and good docs for different search
  strategies now (Chris)
- simplify fbdev emulation init parameters (Gabriel)
- bunch of misc things all over

... and the first few patches from our small driver in drm-misc
experiment:
- cleanups for qxl and bochs from a few different people
- dsi support for vc4 (not yet the panel driver, that's under discussion
  still) from Eric
- meson rename to meson-drm to distinguish from other platform drivers
  (Neil Amstrong)

* tag 'drm-misc-next-2017-02-03' of git://anongit.freedesktop.org/git/drm-misc: (47 commits)
  drm: kselftest for drm_mm and bottom-up allocation
  drm: Improve drm_mm search (and fix topdown allocation) with rbtrees
  drm: Fix build when FBDEV_EMULATION is disabled
  drm: Rely on mode_config data for fb_helper initialization
  drm: Provide a driver hook for drm_dev_release()
  drm: meson: rename driver name to meson-drm
  drm: meson: rename module name to meson-drm
  drm/bridge/sii8620: enable interlace modes
  drm/bridge/sii8620: enable MHL3 mode if possible
  drm/bridge/sii8620: add HSIC initialization code
  drm/bridge/sii8620: improve gen2 write burst IRQ routine
  drm/bridge/sii8620: send EMSC features on request
  drm/bridge/sii8620: rewrite hdmi start sequence
  drm/bridge/mhl: add MHL3 infoframe related definitions
  drm/bridge/sii8620: fix disconnect sequence
  drm/bridge/sii8620: split EDID read and write code
  drm/bridge/sii8620: add delay during cbus reset
  drm/bridge/sii8620: do not stop MHL output when TMDS input is stopped
  drm/bridge/sii8620: set gen2 write burst before sending MSC command
  drm/bridge/sii8620: abstract out sink detection code
  ...
  • Loading branch information
Dave Airlie committed Feb 7, 2017
2 parents 99743ae + bb18dfc commit 31f408c
Show file tree
Hide file tree
Showing 96 changed files with 3,546 additions and 818 deletions.
35 changes: 35 additions & 0 deletions Documentation/devicetree/bindings/display/brcm,bcm-vc4.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ Required properties for V3D:
- interrupts: The interrupt number
See bindings/interrupt-controller/brcm,bcm2835-armctrl-ic.txt

Required properties for DSI:
- compatible: Should be "brcm,bcm2835-dsi0" or "brcm,bcm2835-dsi1"
- reg: Physical base address and length of the DSI block's registers
- interrupts: The interrupt number
See bindings/interrupt-controller/brcm,bcm2835-armctrl-ic.txt
- clocks: a) phy: The DSI PLL clock feeding the DSI analog PHY
b) escape: The DSI ESC clock from CPRMAN
c) pixel: The DSI pixel clock from CPRMAN
- clock-output-names:
The 3 clocks output from the DSI analog PHY: dsi[01]_byte,
dsi[01]_ddr2, and dsi[01]_ddr

[1] Documentation/devicetree/bindings/media/video-interfaces.txt

Example:
Expand Down Expand Up @@ -99,6 +111,29 @@ dpi: dpi@7e208000 {
};
};

dsi1: dsi@7e700000 {
compatible = "brcm,bcm2835-dsi1";
reg = <0x7e700000 0x8c>;
interrupts = <2 12>;
#address-cells = <1>;
#size-cells = <0>;
#clock-cells = <1>;

clocks = <&clocks BCM2835_PLLD_DSI1>,
<&clocks BCM2835_CLOCK_DSI1E>,
<&clocks BCM2835_CLOCK_DSI1P>;
clock-names = "phy", "escape", "pixel";

clock-output-names = "dsi1_byte", "dsi1_ddr2", "dsi1_ddr";

pitouchscreen: panel@0 {
compatible = "raspberrypi,touchscreen";
reg = <0>;

<...>
};
};

vec: vec@7e806000 {
compatible = "brcm,bcm2835-vec";
reg = <0x7e806000 0x1000>;
Expand Down
15 changes: 11 additions & 4 deletions Documentation/gpu/drm-mm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,17 @@ To use :c:func:`drm_gem_mmap()`, drivers must fill the struct
:c:type:`struct drm_driver <drm_driver>` gem_vm_ops field
with a pointer to VM operations.

struct vm_operations_struct \*gem_vm_ops struct
vm_operations_struct { void (\*open)(struct vm_area_struct \* area);
void (\*close)(struct vm_area_struct \* area); int (\*fault)(struct
vm_area_struct \*vma, struct vm_fault \*vmf); };
The VM operations is a :c:type:`struct vm_operations_struct <vm_operations_struct>`
made up of several fields, the more interesting ones being:

.. code-block:: c
struct vm_operations_struct {
void (*open)(struct vm_area_struct * area);
void (*close)(struct vm_area_struct * area);
int (*fault)(struct vm_fault *vmf);
};
The open and close operations must update the GEM object reference
count. Drivers can use the :c:func:`drm_gem_vm_open()` and
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3970,6 +3970,7 @@ S: Maintained
L: linux-media@vger.kernel.org
L: dri-devel@lists.freedesktop.org
F: drivers/dma-buf/sync_*
F: drivers/dma-buf/dma-fence*
F: drivers/dma-buf/sw_sync.c
F: include/linux/sync_file.h
F: include/uapi/linux/sync_file.h
Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,6 @@ int amdgpu_fbdev_init(struct amdgpu_device *adev)
&amdgpu_fb_helper_funcs);

ret = drm_fb_helper_init(adev->ddev, &rfbdev->helper,
adev->mode_info.num_crtc,
AMDGPUFB_CONN_LIMIT);
if (ret) {
kfree(rfbdev);
Expand Down
16 changes: 7 additions & 9 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man,
{
struct amdgpu_gtt_mgr *mgr = man->priv;
struct drm_mm_node *node = mem->mm_node;
enum drm_mm_search_flags sflags = DRM_MM_SEARCH_BEST;
enum drm_mm_allocator_flags aflags = DRM_MM_CREATE_DEFAULT;
enum drm_mm_insert_mode mode;
unsigned long fpfn, lpfn;
int r;

Expand All @@ -115,15 +114,14 @@ int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man,
else
lpfn = man->size;

if (place && place->flags & TTM_PL_FLAG_TOPDOWN) {
sflags = DRM_MM_SEARCH_BELOW;
aflags = DRM_MM_CREATE_TOP;
}
mode = DRM_MM_INSERT_BEST;
if (place && place->flags & TTM_PL_FLAG_TOPDOWN)
mode = DRM_MM_INSERT_HIGH;

spin_lock(&mgr->lock);
r = drm_mm_insert_node_in_range_generic(&mgr->mm, node, mem->num_pages,
mem->page_alignment, 0,
fpfn, lpfn, sflags, aflags);
r = drm_mm_insert_node_in_range(&mgr->mm, node,
mem->num_pages, mem->page_alignment, 0,
fpfn, lpfn, mode);
spin_unlock(&mgr->lock);

if (!r) {
Expand Down
20 changes: 8 additions & 12 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ static int amdgpu_vram_mgr_new(struct ttm_mem_type_manager *man,
struct amdgpu_vram_mgr *mgr = man->priv;
struct drm_mm *mm = &mgr->mm;
struct drm_mm_node *nodes;
enum drm_mm_search_flags sflags = DRM_MM_SEARCH_DEFAULT;
enum drm_mm_allocator_flags aflags = DRM_MM_CREATE_DEFAULT;
enum drm_mm_insert_mode mode;
unsigned long lpfn, num_nodes, pages_per_node, pages_left;
unsigned i;
int r;
Expand All @@ -121,10 +120,9 @@ static int amdgpu_vram_mgr_new(struct ttm_mem_type_manager *man,
if (!nodes)
return -ENOMEM;

if (place->flags & TTM_PL_FLAG_TOPDOWN) {
sflags = DRM_MM_SEARCH_BELOW;
aflags = DRM_MM_CREATE_TOP;
}
mode = DRM_MM_INSERT_BEST;
if (place->flags & TTM_PL_FLAG_TOPDOWN)
mode = DRM_MM_INSERT_HIGH;

pages_left = mem->num_pages;

Expand All @@ -135,13 +133,11 @@ static int amdgpu_vram_mgr_new(struct ttm_mem_type_manager *man,

if (pages == pages_per_node)
alignment = pages_per_node;
else
sflags |= DRM_MM_SEARCH_BEST;

r = drm_mm_insert_node_in_range_generic(mm, &nodes[i], pages,
alignment, 0,
place->fpfn, lpfn,
sflags, aflags);
r = drm_mm_insert_node_in_range(mm, &nodes[i],
pages, alignment, 0,
place->fpfn, lpfn,
mode);
if (unlikely(r))
goto error;

Expand Down
3 changes: 1 addition & 2 deletions drivers/gpu/drm/arc/arcpgu_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ static int arcpgu_load(struct drm_device *drm)
drm_kms_helper_poll_init(drm);

arcpgu->fbdev = drm_fbdev_cma_init(drm, 16,
drm->mode_config.num_crtc,
drm->mode_config.num_connector);
drm->mode_config.num_connector);
if (IS_ERR(arcpgu->fbdev)) {
ret = PTR_ERR(arcpgu->fbdev);
arcpgu->fbdev = NULL;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/arm/hdlcd_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ static int hdlcd_drm_bind(struct device *dev)
drm_mode_config_reset(drm);
drm_kms_helper_poll_init(drm);

hdlcd->fbdev = drm_fbdev_cma_init(drm, 32, drm->mode_config.num_crtc,
hdlcd->fbdev = drm_fbdev_cma_init(drm, 32,
drm->mode_config.num_connector);

if (IS_ERR(hdlcd->fbdev)) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/arm/malidp_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ static int malidp_bind(struct device *dev)

drm_mode_config_reset(drm);

malidp->fbdev = drm_fbdev_cma_init(drm, 32, drm->mode_config.num_crtc,
malidp->fbdev = drm_fbdev_cma_init(drm, 32,
drm->mode_config.num_connector);

if (IS_ERR(malidp->fbdev)) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/armada/armada_fbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ int armada_fbdev_init(struct drm_device *dev)

drm_fb_helper_prepare(dev, fbh, &armada_fb_helper_funcs);

ret = drm_fb_helper_init(dev, fbh, 1, 1);
ret = drm_fb_helper_init(dev, fbh, 1);
if (ret) {
DRM_ERROR("failed to initialize drm fb helper\n");
goto err_fb_helper;
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/armada/armada_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ armada_gem_linear_back(struct drm_device *dev, struct armada_gem_object *obj)
return -ENOSPC;

mutex_lock(&priv->linear_lock);
ret = drm_mm_insert_node(&priv->linear, node, size, align,
DRM_MM_SEARCH_DEFAULT);
ret = drm_mm_insert_node_generic(&priv->linear, node,
size, align, 0, 0);
mutex_unlock(&priv->linear_lock);
if (ret) {
kfree(node);
Expand Down
3 changes: 1 addition & 2 deletions drivers/gpu/drm/ast/ast_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,7 @@ int ast_fbdev_init(struct drm_device *dev)

drm_fb_helper_prepare(dev, &afbdev->helper, &ast_fb_helper_funcs);

ret = drm_fb_helper_init(dev, &afbdev->helper,
1, 1);
ret = drm_fb_helper_init(dev, &afbdev->helper, 1);
if (ret)
goto free;

Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,6 @@ static int atmel_hlcdc_dc_load(struct drm_device *dev)
platform_set_drvdata(pdev, dev);

dc->fbdev = drm_fbdev_cma_init(dev, 24,
dev->mode_config.num_crtc,
dev->mode_config.num_connector);
if (IS_ERR(dc->fbdev))
dc->fbdev = NULL;
Expand Down
10 changes: 10 additions & 0 deletions drivers/gpu/drm/bochs/bochs_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

#include "bochs.h"

static int bochs_modeset = -1;
module_param_named(modeset, bochs_modeset, int, 0444);
MODULE_PARM_DESC(modeset, "enable/disable kernel modesetting");

static bool enable_fbdev = true;
module_param_named(fbdev, enable_fbdev, bool, 0444);
MODULE_PARM_DESC(fbdev, "register fbdev device");
Expand Down Expand Up @@ -214,6 +218,12 @@ static struct pci_driver bochs_pci_driver = {

static int __init bochs_init(void)
{
if (vgacon_text_force() && bochs_modeset == -1)
return -EINVAL;

if (bochs_modeset == 0)
return -EINVAL;

return drm_pci_init(&bochs_driver, &bochs_pci_driver);
}

Expand Down
3 changes: 1 addition & 2 deletions drivers/gpu/drm/bochs/bochs_fbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,7 @@ int bochs_fbdev_init(struct bochs_device *bochs)
drm_fb_helper_prepare(bochs->dev, &bochs->fb.helper,
&bochs_fb_helper_funcs);

ret = drm_fb_helper_init(bochs->dev, &bochs->fb.helper,
1, 1);
ret = drm_fb_helper_init(bochs->dev, &bochs->fb.helper, 1);
if (ret)
return ret;

Expand Down
Loading

0 comments on commit 31f408c

Please sign in to comment.