Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit affa0e03 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'topic/drm-misc-2015-10-19' of git://anongit.freedesktop.org/drm-intel into drm-next

More drm-misc for 4.4.
- fb refcount fix in atomic fbdev
- various locking reworks to reduce drm_global_mutex and dev->struct_mutex
- rename docbook to gpu.tmpl and include vga_switcheroo stuff, plus more
  vga_switcheroo (Lukas Wunner)
- viewport check fixes for atomic drivers from Ville
- DRM_DEBUG_VBL from Ville
- non-contentious header fixes from Mikko Rapeli
- small things all over

* tag 'topic/drm-misc-2015-10-19' of git://anongit.freedesktop.org/drm-intel: (31 commits)
  drm/fb-helper: Fix fb refcounting in pan_display_atomic
  drm/fb-helper: Set plane rotation directly
  drm: fix mutex leak in drm_dp_get_mst_branch_device
  drm: Check plane src coordinates correctly during page flip for atomic drivers
  drm: Check crtc viewport correctly with rotated primary plane on atomic drivers
  drm: Refactor plane src coordinate checks
  drm: Swap w/h when converting the mode to src coordidates for a rotated primary plane
  drm: Don't leak fb when plane crtc coodinates are bad
  ALSA: hda - Spell vga_switcheroo consistently
  drm/gem: Use kref_get_unless_zero for the weak mmap references
  drm/vgem: Drop vgem_drm_gem_mmap
  drm: Fix return value of drm_framebuffer_init()
  drm/gem: Use container_of in drm_gem_object_free
  drm/gem: Check locking in drm_gem_object_unreference
  drm/gem: Drop struct_mutex requirement from drm_gem_mmap_obj
  drm/i810_drm.h: include drm/drm.h
  r128_drm.h: include drm/drm.h
  savage_drm.h: include <drm/drm.h>
  gpu/doc: Convert to markdown harder
  gpu/doc: Add vga_switcheroo documentation
  ...
parents 2dd3a88a a0fb6ad7
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -14,7 +14,7 @@ DOCBOOKS := z8530book.xml device-drivers.xml \
	    genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \
	    genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \
	    80211.xml debugobjects.xml sh.xml regulator.xml \
	    80211.xml debugobjects.xml sh.xml regulator.xml \
	    alsa-driver-api.xml writing-an-alsa-driver.xml \
	    alsa-driver-api.xml writing-an-alsa-driver.xml \
	    tracepoint.xml drm.xml media_api.xml w1.xml \
	    tracepoint.xml gpu.xml media_api.xml w1.xml \
	    writing_musb_glue_layer.xml crypto-API.xml iio.xml
	    writing_musb_glue_layer.xml crypto-API.xml iio.xml


include Documentation/DocBook/media/Makefile
include Documentation/DocBook/media/Makefile
+82 −12
Original line number Original line Diff line number Diff line
@@ -2,9 +2,9 @@
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
	"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
	"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>


<book id="drmDevelopersGuide">
<book id="gpuDevelopersGuide">
  <bookinfo>
  <bookinfo>
    <title>Linux DRM Developer's Guide</title>
    <title>Linux GPU Driver Developer's Guide</title>


    <authorgroup>
    <authorgroup>
      <author>
      <author>
@@ -40,6 +40,16 @@
	  </address>
	  </address>
	</affiliation>
	</affiliation>
      </author>
      </author>
      <author>
	<firstname>Lukas</firstname>
	<surname>Wunner</surname>
	<contrib>vga_switcheroo documentation</contrib>
	<affiliation>
	  <address>
	    <email>lukas@wunner.de</email>
	  </address>
	</affiliation>
      </author>
    </authorgroup>
    </authorgroup>


    <copyright>
    <copyright>
@@ -51,6 +61,10 @@
      <year>2012</year>
      <year>2012</year>
      <holder>Laurent Pinchart</holder>
      <holder>Laurent Pinchart</holder>
    </copyright>
    </copyright>
    <copyright>
      <year>2015</year>
      <holder>Lukas Wunner</holder>
    </copyright>


    <legalnotice>
    <legalnotice>
      <para>
      <para>
@@ -69,6 +83,13 @@
	<revremark>Added extensive documentation about driver internals.
	<revremark>Added extensive documentation about driver internals.
	</revremark>
	</revremark>
      </revision>
      </revision>
      <revision>
	<revnumber>1.1</revnumber>
	<date>2015-10-11</date>
	<authorinitials>LW</authorinitials>
	<revremark>Added vga_switcheroo documentation.
	</revremark>
      </revision>
    </revhistory>
    </revhistory>
  </bookinfo>
  </bookinfo>


@@ -78,9 +99,9 @@
  <title>DRM Core</title>
  <title>DRM Core</title>
  <partintro>
  <partintro>
    <para>
    <para>
      This first part of the DRM Developer's Guide documents core DRM code,
      This first part of the GPU Driver Developer's Guide documents core DRM
      helper libraries for writing drivers and generic userspace interfaces
      code, helper libraries for writing drivers and generic userspace
      exposed by DRM drivers.
      interfaces exposed by DRM drivers.
    </para>
    </para>
  </partintro>
  </partintro>


@@ -3583,10 +3604,11 @@ void (*postclose) (struct drm_device *, struct drm_file *);</synopsis>
	plane properties to default value, so that a subsequent open of the
	plane properties to default value, so that a subsequent open of the
	device will not inherit state from the previous user. It can also be
	device will not inherit state from the previous user. It can also be
	used to execute delayed power switching state changes, e.g. in
	used to execute delayed power switching state changes, e.g. in
	conjunction with the vga_switcheroo infrastructure. Beyond that KMS
	conjunction with the vga_switcheroo infrastructure (see
	drivers should not do any further cleanup. Only legacy UMS drivers might
	<xref linkend="vga_switcheroo"/>). Beyond that KMS drivers should not
	need to clean up device state so that the vga console or an independent
	do any further cleanup. Only legacy UMS drivers might need to clean up
	fbdev driver could take over.
	device state so that the vga console or an independent fbdev driver
	could take over.
      </para>
      </para>
    </sect2>
    </sect2>
    <sect2>
    <sect2>
@@ -3684,7 +3706,9 @@ int num_ioctls;</synopsis>
	    </para></listitem>
	    </para></listitem>
            <listitem><para>
            <listitem><para>
	      DRM_UNLOCKED - The ioctl handler will be called without locking
	      DRM_UNLOCKED - The ioctl handler will be called without locking
	      the DRM global mutex
	      the DRM global mutex. This is the enforced default for kms drivers
	      (i.e. using the DRIVER_MODESET flag) and hence shouldn't be used
	      any more for new drivers.
	    </para></listitem>
	    </para></listitem>
	  </itemizedlist>
	  </itemizedlist>
	</para>
	</para>
@@ -3887,8 +3911,8 @@ int num_ioctls;</synopsis>


  <partintro>
  <partintro>
    <para>
    <para>
      This second part of the DRM Developer's Guide documents driver code,
      This second part of the GPU Driver Developer's Guide documents driver
      implementation details and also all the driver-specific userspace
      code, implementation details and also all the driver-specific userspace
      interfaces. Especially since all hardware-acceleration interfaces to
      interfaces. Especially since all hardware-acceleration interfaces to
      userspace are driver specific for efficiency and other reasons these
      userspace are driver specific for efficiency and other reasons these
      interfaces can be rather substantial. Hence every driver has its own
      interfaces can be rather substantial. Hence every driver has its own
@@ -4213,4 +4237,50 @@ int num_ioctls;</synopsis>
  </chapter>
  </chapter>
!Cdrivers/gpu/drm/i915/i915_irq.c
!Cdrivers/gpu/drm/i915/i915_irq.c
</part>
</part>

<part id="vga_switcheroo">
  <title>vga_switcheroo</title>
  <partintro>
!Pdrivers/gpu/vga/vga_switcheroo.c Overview
  </partintro>

  <chapter id="modes_of_use">
    <title>Modes of Use</title>
  <sect1>
    <title>Manual switching and manual power control</title>
!Pdrivers/gpu/vga/vga_switcheroo.c Manual switching and manual power control
  </sect1>
  <sect1>
    <title>Driver power control</title>
!Pdrivers/gpu/vga/vga_switcheroo.c Driver power control
  </sect1>
  </chapter>

  <chapter id="pubfunctions">
    <title>Public functions</title>
!Edrivers/gpu/vga/vga_switcheroo.c
  </chapter>

  <chapter id="pubstructures">
    <title>Public structures</title>
!Finclude/linux/vga_switcheroo.h vga_switcheroo_handler
!Finclude/linux/vga_switcheroo.h vga_switcheroo_client_ops
  </chapter>

  <chapter id="pubconstants">
    <title>Public constants</title>
!Finclude/linux/vga_switcheroo.h vga_switcheroo_client_id
!Finclude/linux/vga_switcheroo.h vga_switcheroo_state
  </chapter>

  <chapter id="privstructures">
    <title>Private structures</title>
!Fdrivers/gpu/vga/vga_switcheroo.c vgasr_priv
!Fdrivers/gpu/vga/vga_switcheroo.c vga_switcheroo_client
  </chapter>

!Cdrivers/gpu/vga/vga_switcheroo.c
!Cinclude/linux/vga_switcheroo.h
</part>

</book>
</book>
+12 −12
Original line number Original line Diff line number Diff line
@@ -689,18 +689,18 @@ int amdgpu_get_vblank_timestamp_kms(struct drm_device *dev, unsigned int pipe,
}
}


const struct drm_ioctl_desc amdgpu_ioctls_kms[] = {
const struct drm_ioctl_desc amdgpu_ioctls_kms[] = {
	DRM_IOCTL_DEF_DRV(AMDGPU_GEM_CREATE, amdgpu_gem_create_ioctl, DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(AMDGPU_GEM_CREATE, amdgpu_gem_create_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(AMDGPU_CTX, amdgpu_ctx_ioctl, DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(AMDGPU_CTX, amdgpu_ctx_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(AMDGPU_BO_LIST, amdgpu_bo_list_ioctl, DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(AMDGPU_BO_LIST, amdgpu_bo_list_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
	/* KMS */
	/* KMS */
	DRM_IOCTL_DEF_DRV(AMDGPU_GEM_MMAP, amdgpu_gem_mmap_ioctl, DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(AMDGPU_GEM_MMAP, amdgpu_gem_mmap_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(AMDGPU_GEM_WAIT_IDLE, amdgpu_gem_wait_idle_ioctl, DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(AMDGPU_GEM_WAIT_IDLE, amdgpu_gem_wait_idle_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(AMDGPU_CS, amdgpu_cs_ioctl, DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(AMDGPU_CS, amdgpu_cs_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(AMDGPU_INFO, amdgpu_info_ioctl, DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(AMDGPU_INFO, amdgpu_info_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(AMDGPU_WAIT_CS, amdgpu_cs_wait_ioctl, DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(AMDGPU_WAIT_CS, amdgpu_cs_wait_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(AMDGPU_GEM_METADATA, amdgpu_gem_metadata_ioctl, DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(AMDGPU_GEM_METADATA, amdgpu_gem_metadata_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(AMDGPU_GEM_VA, amdgpu_gem_va_ioctl, DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(AMDGPU_GEM_VA, amdgpu_gem_va_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(AMDGPU_GEM_OP, amdgpu_gem_op_ioctl, DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(AMDGPU_GEM_OP, amdgpu_gem_op_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(AMDGPU_GEM_USERPTR, amdgpu_gem_userptr_ioctl, DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),
	DRM_IOCTL_DEF_DRV(AMDGPU_GEM_USERPTR, amdgpu_gem_userptr_ioctl, DRM_AUTH|DRM_RENDER_ALLOW),
};
};
int amdgpu_max_kms_ioctl = ARRAY_SIZE(amdgpu_ioctls_kms);
int amdgpu_max_kms_ioctl = ARRAY_SIZE(amdgpu_ioctls_kms);
+3 −6
Original line number Original line Diff line number Diff line
@@ -163,12 +163,9 @@ static void armada_drm_disable_vblank(struct drm_device *dev, unsigned int pipe)
}
}


static struct drm_ioctl_desc armada_ioctls[] = {
static struct drm_ioctl_desc armada_ioctls[] = {
	DRM_IOCTL_DEF_DRV(ARMADA_GEM_CREATE, armada_gem_create_ioctl,
	DRM_IOCTL_DEF_DRV(ARMADA_GEM_CREATE, armada_gem_create_ioctl,0),
		DRM_UNLOCKED),
	DRM_IOCTL_DEF_DRV(ARMADA_GEM_MMAP, armada_gem_mmap_ioctl, 0),
	DRM_IOCTL_DEF_DRV(ARMADA_GEM_MMAP, armada_gem_mmap_ioctl,
	DRM_IOCTL_DEF_DRV(ARMADA_GEM_PWRITE, armada_gem_pwrite_ioctl, 0),
		DRM_UNLOCKED),
	DRM_IOCTL_DEF_DRV(ARMADA_GEM_PWRITE, armada_gem_pwrite_ioctl,
		DRM_UNLOCKED),
};
};


static void armada_drm_lastclose(struct drm_device *dev)
static void armada_drm_lastclose(struct drm_device *dev)
+7 −2
Original line number Original line Diff line number Diff line
@@ -1790,8 +1790,13 @@ int __drm_atomic_helper_set_config(struct drm_mode_set *set,
	primary_state->crtc_w = set->mode->hdisplay;
	primary_state->crtc_w = set->mode->hdisplay;
	primary_state->src_x = set->x << 16;
	primary_state->src_x = set->x << 16;
	primary_state->src_y = set->y << 16;
	primary_state->src_y = set->y << 16;
	if (primary_state->rotation & (BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_270))) {
		primary_state->src_h = set->mode->hdisplay << 16;
		primary_state->src_w = set->mode->vdisplay << 16;
	} else {
		primary_state->src_h = set->mode->vdisplay << 16;
		primary_state->src_h = set->mode->vdisplay << 16;
		primary_state->src_w = set->mode->hdisplay << 16;
		primary_state->src_w = set->mode->hdisplay << 16;
	}


commit:
commit:
	ret = update_output_state(state, set);
	ret = update_output_state(state, set);
Loading