[PATCH 2/4] drm: Create a format/modifier blob

2017-07-23 Thread Ben Widawsky
Updated blob layout (Rob, Daniel, Kristian, xerpi)

v2:
* Removed __packed, and alignment (.+)
* Fix indent in drm_format_modifier fields (Liviu)
* Remove duplicated modifier > 64 check (Liviu)
* Change comment about modifier (Liviu)
* Remove arguments to blob creation, use plane instead (Liviu)
* Fix data types (Ben)
* Make the blob part of uapi (Daniel)

v3:
Remove unused ret field.
Change i, and j to unsigned int (Emil)

v4:
Use plane->modifier_count instead of recounting (Daniel)

v5:
Rename modifiers to modifiers_property (Ville)
Use sizeof(__u32) instead to reflect UAPI nature (Ville)
Make BUILD_BUG_ON for blob header size

Cc: Rob Clark 
Cc: Kristian H. Kristensen 
Signed-off-by: Ben Widawsky 
Reviewed-by: Daniel Stone  (v2)
Reviewed-by: Liviu Dudau  (v2)
Reviewed-by: Emil Velikov  (v3)
---
 drivers/gpu/drm/drm_mode_config.c |  7 
 drivers/gpu/drm/drm_plane.c   | 84 +++
 include/drm/drm_mode_config.h |  6 +++
 include/uapi/drm/drm_mode.h   | 50 +++
 4 files changed, 147 insertions(+)

diff --git a/drivers/gpu/drm/drm_mode_config.c 
b/drivers/gpu/drm/drm_mode_config.c
index d9862259a2a7..74f6ff5df656 100644
--- a/drivers/gpu/drm/drm_mode_config.c
+++ b/drivers/gpu/drm/drm_mode_config.c
@@ -337,6 +337,13 @@ static int drm_mode_create_standard_properties(struct 
drm_device *dev)
return -ENOMEM;
dev->mode_config.gamma_lut_size_property = prop;
 
+   prop = drm_property_create(dev,
+  DRM_MODE_PROP_IMMUTABLE | DRM_MODE_PROP_BLOB,
+  "IN_FORMATS", 0);
+   if (!prop)
+   return -ENOMEM;
+   dev->mode_config.modifiers_property = prop;
+
return 0;
 }
 
diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
index d3fc561d7b48..5c14beee52ff 100644
--- a/drivers/gpu/drm/drm_plane.c
+++ b/drivers/gpu/drm/drm_plane.c
@@ -62,6 +62,87 @@ static unsigned int drm_num_planes(struct drm_device *dev)
return num;
 }
 
+static inline u32 *
+formats_ptr(struct drm_format_modifier_blob *blob)
+{
+   return (u32 *)(((char *)blob) + blob->formats_offset);
+}
+
+static inline struct drm_format_modifier *
+modifiers_ptr(struct drm_format_modifier_blob *blob)
+{
+   return (struct drm_format_modifier *)(((char *)blob) + 
blob->modifiers_offset);
+}
+
+static int create_in_format_blob(struct drm_device *dev, struct drm_plane 
*plane)
+{
+   const struct drm_mode_config *config = >mode_config;
+   struct drm_property_blob *blob;
+   struct drm_format_modifier *mod;
+   size_t blob_size, formats_size, modifiers_size;
+   struct drm_format_modifier_blob *blob_data;
+   unsigned int i, j;
+
+   formats_size = sizeof(__u32) * plane->format_count;
+   if (WARN_ON(!formats_size)) {
+   /* 0 formats are never expected */
+   return 0;
+   }
+
+   modifiers_size =
+   sizeof(struct drm_format_modifier) * plane->modifier_count;
+
+   blob_size = sizeof(struct drm_format_modifier_blob);
+   /* Modifiers offset is a pointer to a struct with a 64 bit field so it
+* should be naturally aligned to 8B.
+*/
+   BUILD_BUG_ON(sizeof(struct drm_format_modifier_blob) % 8);
+   blob_size += ALIGN(formats_size, 8);
+   blob_size += modifiers_size;
+
+   blob = drm_property_create_blob(dev, blob_size, NULL);
+   if (IS_ERR(blob))
+   return -1;
+
+   blob_data = (struct drm_format_modifier_blob *)blob->data;
+   blob_data->version = FORMAT_BLOB_CURRENT;
+   blob_data->count_formats = plane->format_count;
+   blob_data->formats_offset = sizeof(struct drm_format_modifier_blob);
+   blob_data->count_modifiers = plane->modifier_count;
+
+   blob_data->modifiers_offset =
+   ALIGN(blob_data->formats_offset + formats_size, 8);
+
+   memcpy(formats_ptr(blob_data), plane->format_types, formats_size);
+
+   /* If we can't determine support, just bail */
+   if (!plane->funcs->format_mod_supported)
+   goto done;
+
+   mod = modifiers_ptr(blob_data);
+   for (i = 0; i < plane->modifier_count; i++) {
+   for (j = 0; j < plane->format_count; j++) {
+   if (plane->funcs->format_mod_supported(plane,
+  
plane->format_types[j],
+  
plane->modifiers[i])) {
+
+   mod->formats |= 1 << j;
+   }
+   }
+
+   mod->modifier = plane->modifiers[i];
+   mod->offset = 0;
+   mod->pad = 0;
+   mod++;
+   }
+
+done:
+   drm_object_attach_property(>base, 

[PATCH 3/4] drm/i915: Add format modifiers for Intel

2017-07-23 Thread Ben Widawsky
This was based on a patch originally by Kristian. It has been modified
pretty heavily to use the new callbacks from the previous patch.

v2:
  - Add LINEAR and Yf modifiers to list (Ville)
  - Combine i8xx and i965 into one list of formats (Ville)
  - Allow 1010102 formats for Y/Yf tiled (Ville)

v3:
  - Handle cursor formats (Ville)
  - Put handling for LINEAR in the mod_support functions (Ville)

v4:
  - List each modifier explicitly in supported modifiers (Ville)
  - Handle the CURSOR plane (Ville)

v5:
  - Split out cursor and sprite handling (Ville)

v6:
  - Actually use the sprite funcs (Emil)
  - Use unreachable (Emil)

v7:
  - Only allow Intel modifiers and LINEAR (Ben)

v8
  - Fix spite assert introduced in v6 (Daniel)

v9
  - Change vendor check logic to avoid magic 56 (Emil)
  - Reorder skl_mod_support (Ville)
  - make intel_plane_funcs static, could be done as of v5 (Ville)
  - rename local variable intel_format_modifiers to modifiers (Ville)
- actually use sprite modifiers
  - split out modifier/formats by platform (Ville)

Cc: Ville Syrjälä 
Cc: Kristian H. Kristensen 
Reviewed-by: Emil Velikov  (v8)
Signed-off-by: Ben Widawsky 
---
 drivers/gpu/drm/i915/intel_display.c | 127 +--
 drivers/gpu/drm/i915/intel_drv.h |   1 -
 drivers/gpu/drm/i915/intel_sprite.c  | 141 ++-
 3 files changed, 259 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index 28e5f350db02..34c37f82acb2 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -67,6 +67,12 @@ static const uint32_t i965_primary_formats[] = {
DRM_FORMAT_XBGR2101010,
 };
 
+static const uint64_t i9xx_format_modifiers[] = {
+   I915_FORMAT_MOD_X_TILED,
+   DRM_FORMAT_MOD_LINEAR,
+   DRM_FORMAT_MOD_INVALID
+};
+
 static const uint32_t skl_primary_formats[] = {
DRM_FORMAT_C8,
DRM_FORMAT_RGB565,
@@ -82,11 +88,24 @@ static const uint32_t skl_primary_formats[] = {
DRM_FORMAT_VYUY,
 };
 
+static const uint64_t skl_format_modifiers[] = {
+   I915_FORMAT_MOD_Yf_TILED,
+   I915_FORMAT_MOD_Y_TILED,
+   I915_FORMAT_MOD_X_TILED,
+   DRM_FORMAT_MOD_LINEAR,
+   DRM_FORMAT_MOD_INVALID
+};
+
 /* Cursor formats */
 static const uint32_t intel_cursor_formats[] = {
DRM_FORMAT_ARGB,
 };
 
+static const uint64_t cursor_format_modifiers[] = {
+   DRM_FORMAT_MOD_LINEAR,
+   DRM_FORMAT_MOD_INVALID
+};
+
 static void i9xx_crtc_clock_get(struct intel_crtc *crtc,
struct intel_crtc_state *pipe_config);
 static void ironlake_pch_clock_get(struct intel_crtc *crtc,
@@ -12806,7 +12825,98 @@ void intel_plane_destroy(struct drm_plane *plane)
kfree(to_intel_plane(plane));
 }
 
-const struct drm_plane_funcs intel_plane_funcs = {
+static bool i8xx_mod_supported(uint32_t format, uint64_t modifier)
+{
+   switch (format) {
+   case DRM_FORMAT_C8:
+   case DRM_FORMAT_RGB565:
+   case DRM_FORMAT_XRGB1555:
+   case DRM_FORMAT_XRGB:
+   return modifier == DRM_FORMAT_MOD_LINEAR ||
+   modifier == I915_FORMAT_MOD_X_TILED;
+   default:
+   return false;
+   }
+}
+
+static bool i965_mod_supported(uint32_t format, uint64_t modifier)
+{
+   switch (format) {
+   case DRM_FORMAT_C8:
+   case DRM_FORMAT_RGB565:
+   case DRM_FORMAT_XRGB:
+   case DRM_FORMAT_XBGR:
+   case DRM_FORMAT_XRGB2101010:
+   case DRM_FORMAT_XBGR2101010:
+   return modifier == DRM_FORMAT_MOD_LINEAR ||
+   modifier == I915_FORMAT_MOD_X_TILED;
+   default:
+   return false;
+   }
+}
+
+static bool skl_mod_supported(uint32_t format, uint64_t modifier)
+{
+   switch (format) {
+   case DRM_FORMAT_XRGB:
+   case DRM_FORMAT_XBGR:
+   case DRM_FORMAT_ARGB:
+   case DRM_FORMAT_ABGR:
+   case DRM_FORMAT_RGB565:
+   case DRM_FORMAT_XRGB2101010:
+   case DRM_FORMAT_XBGR2101010:
+   case DRM_FORMAT_YUYV:
+   case DRM_FORMAT_YVYU:
+   case DRM_FORMAT_UYVY:
+   case DRM_FORMAT_VYUY:
+   if (modifier == I915_FORMAT_MOD_Yf_TILED)
+   return true;
+   /* fall through */
+   case DRM_FORMAT_C8:
+   if (modifier == DRM_FORMAT_MOD_LINEAR ||
+   modifier == I915_FORMAT_MOD_X_TILED ||
+   modifier == I915_FORMAT_MOD_Y_TILED)
+   return true;
+   /* fall through */
+   default:
+   return false;
+   }
+}
+
+static bool intel_primary_plane_format_mod_supported(struct drm_plane *plane,
+uint32_t format,
+

[PATCH 1/4] drm: Plumb modifiers through plane init

2017-07-23 Thread Ben Widawsky
This is the plumbing for supporting fb modifiers on planes. Modifiers
have already been introduced to some extent, but this series will extend
this to allow querying modifiers per plane. Based on this, the client to
enable optimal modifications for framebuffers.

This patch simply allows the DRM drivers to initialize their list of
supported modifiers upon initializing the plane.

v2: A minor addition from Daniel

v3:
* Updated commit message
* s/INVALID/DRM_FORMAT_MOD_INVALID (Liviu)
* Remove some excess newlines (Liviu)
* Update comment for > 64 modifiers (Liviu)

v4: Minor comment adjustments (Liviu)

v5: Some new platforms added due to rebase

v6: Add some missed plane inits (or maybe they're new - who knows at
this point) (Daniel)

Signed-off-by: Ben Widawsky 
Reviewed-by: Daniel Stone  (v2)
Reviewed-by: Liviu Dudau 
---
 drivers/gpu/drm/arc/arcpgu_crtc.c   |  1 +
 drivers/gpu/drm/arm/hdlcd_crtc.c|  1 +
 drivers/gpu/drm/arm/malidp_planes.c |  2 +-
 drivers/gpu/drm/armada/armada_crtc.c|  1 +
 drivers/gpu/drm/armada/armada_overlay.c |  1 +
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c |  3 ++-
 drivers/gpu/drm/drm_modeset_helper.c|  1 +
 drivers/gpu/drm/drm_plane.c | 36 -
 drivers/gpu/drm/drm_simple_kms_helper.c |  3 +++
 drivers/gpu/drm/exynos/exynos_drm_plane.c   |  2 +-
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c |  2 +-
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c  |  1 +
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c |  2 +-
 drivers/gpu/drm/i915/intel_display.c|  5 +++-
 drivers/gpu/drm/i915/intel_sprite.c |  4 +--
 drivers/gpu/drm/imx/ipuv3-plane.c   |  4 +--
 drivers/gpu/drm/mediatek/mtk_drm_plane.c|  2 +-
 drivers/gpu/drm/meson/meson_plane.c |  1 +
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c   |  2 +-
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c   |  4 +--
 drivers/gpu/drm/mxsfb/mxsfb_drv.c   |  2 +-
 drivers/gpu/drm/nouveau/nv50_display.c  |  5 ++--
 drivers/gpu/drm/omapdrm/omap_plane.c|  2 +-
 drivers/gpu/drm/pl111/pl111_display.c   |  2 +-
 drivers/gpu/drm/qxl/qxl_display.c   |  2 +-
 drivers/gpu/drm/rcar-du/rcar_du_plane.c |  4 +--
 drivers/gpu/drm/rcar-du/rcar_du_vsp.c   |  4 +--
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c |  4 +--
 drivers/gpu/drm/sti/sti_cursor.c|  2 +-
 drivers/gpu/drm/sti/sti_gdp.c   |  2 +-
 drivers/gpu/drm/sti/sti_hqvdp.c |  2 +-
 drivers/gpu/drm/stm/ltdc.c  |  2 +-
 drivers/gpu/drm/sun4i/sun4i_layer.c |  2 +-
 drivers/gpu/drm/tegra/dc.c  | 12 -
 drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c |  2 +-
 drivers/gpu/drm/vc4/vc4_plane.c |  2 +-
 drivers/gpu/drm/virtio/virtgpu_plane.c  |  2 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c |  4 +--
 drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c|  4 +--
 drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c|  4 +--
 drivers/gpu/drm/zte/zx_plane.c  |  2 +-
 include/drm/drm_plane.h | 22 ++-
 include/drm/drm_simple_kms_helper.h |  1 +
 include/uapi/drm/drm_fourcc.h   | 11 
 44 files changed, 130 insertions(+), 49 deletions(-)

diff --git a/drivers/gpu/drm/arc/arcpgu_crtc.c 
b/drivers/gpu/drm/arc/arcpgu_crtc.c
index 1859dd3ad622..799416651f2f 100644
--- a/drivers/gpu/drm/arc/arcpgu_crtc.c
+++ b/drivers/gpu/drm/arc/arcpgu_crtc.c
@@ -217,6 +217,7 @@ static struct drm_plane *arc_pgu_plane_init(struct 
drm_device *drm)
 
ret = drm_universal_plane_init(drm, plane, 0xff, _pgu_plane_funcs,
   formats, ARRAY_SIZE(formats),
+  NULL,
   DRM_PLANE_TYPE_PRIMARY, NULL);
if (ret)
return ERR_PTR(ret);
diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c
index 16e1e20cf04c..72b22b805412 100644
--- a/drivers/gpu/drm/arm/hdlcd_crtc.c
+++ b/drivers/gpu/drm/arm/hdlcd_crtc.c
@@ -315,6 +315,7 @@ static struct drm_plane *hdlcd_plane_init(struct drm_device 
*drm)
 
ret = drm_universal_plane_init(drm, plane, 0xff, _plane_funcs,
   formats, ARRAY_SIZE(formats),
+  NULL,
   DRM_PLANE_TYPE_PRIMARY, NULL);
if (ret) {
return ERR_PTR(ret);
diff --git a/drivers/gpu/drm/arm/malidp_planes.c 
b/drivers/gpu/drm/arm/malidp_planes.c
index 600fa7bd7f52..60402e27882f 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -398,7 +398,7 @@ int malidp_de_planes_init(struct 

[PATCH 4/4] drm/i915: Add support for CCS modifiers

2017-07-23 Thread Ben Widawsky
v2:
Support sprite plane.
Support pipe C/D limitation on GEN9.

v3:
Rename structure (Ville)
Handle GLK (Ville)

This requires rebase on the correct Ville patches

Cc: Daniel Stone 
Cc: Kristian Høgsberg 
Signed-off-by: Ben Widawsky 
---
 drivers/gpu/drm/i915/intel_display.c | 30 +++---
 drivers/gpu/drm/i915/intel_sprite.c  | 25 -
 2 files changed, 51 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index 34c37f82acb2..44747ed9ee38 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -88,7 +88,17 @@ static const uint32_t skl_primary_formats[] = {
DRM_FORMAT_VYUY,
 };
 
-static const uint64_t skl_format_modifiers[] = {
+static const uint64_t skl_format_modifiers_noccs[] = {
+   I915_FORMAT_MOD_Yf_TILED,
+   I915_FORMAT_MOD_Y_TILED,
+   I915_FORMAT_MOD_X_TILED,
+   DRM_FORMAT_MOD_LINEAR,
+   DRM_FORMAT_MOD_INVALID
+};
+
+static const uint64_t skl_format_modifiers_ccs[] = {
+   I915_FORMAT_MOD_Yf_TILED_CCS,
+   I915_FORMAT_MOD_Y_TILED_CCS,
I915_FORMAT_MOD_Yf_TILED,
I915_FORMAT_MOD_Y_TILED,
I915_FORMAT_MOD_X_TILED,
@@ -12862,6 +12872,10 @@ static bool skl_mod_supported(uint32_t format, 
uint64_t modifier)
case DRM_FORMAT_XBGR:
case DRM_FORMAT_ARGB:
case DRM_FORMAT_ABGR:
+   if (modifier == I915_FORMAT_MOD_Yf_TILED_CCS ||
+   modifier == I915_FORMAT_MOD_Y_TILED_CCS)
+   return true;
+   /* fall through */
case DRM_FORMAT_RGB565:
case DRM_FORMAT_XRGB2101010:
case DRM_FORMAT_XBGR2101010:
@@ -13108,10 +13122,20 @@ intel_primary_plane_create(struct drm_i915_private 
*dev_priv, enum pipe pipe)
primary->frontbuffer_bit = INTEL_FRONTBUFFER_PRIMARY(pipe);
primary->check_plane = intel_check_primary_plane;
 
-   if (INTEL_GEN(dev_priv) >= 9) {
+   if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) {
+   intel_primary_formats = skl_primary_formats;
+   num_formats = ARRAY_SIZE(skl_primary_formats);
+   modifiers = skl_format_modifiers_ccs;
+
+   primary->update_plane = skylake_update_primary_plane;
+   primary->disable_plane = skylake_disable_primary_plane;
+   } else if (INTEL_GEN(dev_priv) >= 9) {
intel_primary_formats = skl_primary_formats;
num_formats = ARRAY_SIZE(skl_primary_formats);
-   modifiers = skl_format_modifiers;
+   if (pipe >= PIPE_C)
+   modifiers = skl_format_modifiers_ccs;
+   else
+   modifiers = skl_format_modifiers_noccs;
 
primary->update_plane = skylake_update_primary_plane;
primary->disable_plane = skylake_disable_primary_plane;
diff --git a/drivers/gpu/drm/i915/intel_sprite.c 
b/drivers/gpu/drm/i915/intel_sprite.c
index 05a15063ee97..97d29cc061ad 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -1079,7 +1079,17 @@ static uint32_t skl_plane_formats[] = {
DRM_FORMAT_VYUY,
 };
 
+static const uint64_t skl_plane_format_modifiers_noccs[] = {
+   I915_FORMAT_MOD_Yf_TILED,
+   I915_FORMAT_MOD_Y_TILED,
+   I915_FORMAT_MOD_X_TILED,
+   DRM_FORMAT_MOD_LINEAR,
+   DRM_FORMAT_MOD_INVALID
+};
+
 static const uint64_t skl_plane_format_modifiers[] = {
+   I915_FORMAT_MOD_Yf_TILED_CCS,
+   I915_FORMAT_MOD_Y_TILED_CCS,
I915_FORMAT_MOD_Yf_TILED,
I915_FORMAT_MOD_Y_TILED,
I915_FORMAT_MOD_X_TILED,
@@ -1224,7 +1234,7 @@ intel_sprite_plane_create(struct drm_i915_private 
*dev_priv,
}
intel_plane->base.state = >base;
 
-   if (INTEL_GEN(dev_priv) >= 9) {
+   if (INTEL_GEN(dev_priv) >= 10) {
intel_plane->can_scale = true;
state->scaler_id = -1;
 
@@ -1234,6 +1244,19 @@ intel_sprite_plane_create(struct drm_i915_private 
*dev_priv,
plane_formats = skl_plane_formats;
num_plane_formats = ARRAY_SIZE(skl_plane_formats);
modifiers = skl_plane_format_modifiers;
+   } else if (INTEL_GEN(dev_priv) >= 9) {
+   intel_plane->can_scale = true;
+   state->scaler_id = -1;
+
+   intel_plane->update_plane = skl_update_plane;
+   intel_plane->disable_plane = skl_disable_plane;
+
+   plane_formats = skl_plane_formats;
+   num_plane_formats = ARRAY_SIZE(skl_plane_formats);
+   if (pipe >= PIPE_C)
+   modifiers = skl_plane_format_modifiers_noccs;
+   else
+   modifiers = skl_plane_format_modifiers;
} else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
  

[PATCH 0/4] [v2] Blobifiers (FKA GET_PLANE2)

2017-07-23 Thread Ben Widawsky
Second attempt (although most patches are much further along than that) and the
blob property for modifiers.

This small series adds the DRM blob property that allows clients to be made
aware of per plane modifiers and the formats which are supported in conjunction
with  those modifiers. This interface will allow clients to create buffers for
scanout with a good set of modifiers, and later import those buffers (through
EGL already, and Vulkan WSI later) into a graphics runtime. EGL/WSI will provide
similar interfaces for rendering - modifiers which can be used for rendering.

Ben Widawsky (4):
  drm: Plumb modifiers through plane init
  drm: Create a format/modifier blob
  drm/i915: Add format modifiers for Intel
  drm/i915: Add support for CCS modifiers

 drivers/gpu/drm/arc/arcpgu_crtc.c   |   1 +
 drivers/gpu/drm/arm/hdlcd_crtc.c|   1 +
 drivers/gpu/drm/arm/malidp_planes.c |   2 +-
 drivers/gpu/drm/armada/armada_crtc.c|   1 +
 drivers/gpu/drm/armada/armada_overlay.c |   1 +
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c |   3 +-
 drivers/gpu/drm/drm_mode_config.c   |   7 +
 drivers/gpu/drm/drm_modeset_helper.c|   1 +
 drivers/gpu/drm/drm_plane.c | 120 +-
 drivers/gpu/drm/drm_simple_kms_helper.c |   3 +
 drivers/gpu/drm/exynos/exynos_drm_plane.c   |   2 +-
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c |   2 +-
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c  |   1 +
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c |   2 +-
 drivers/gpu/drm/i915/intel_display.c| 148 +-
 drivers/gpu/drm/i915/intel_drv.h|   1 -
 drivers/gpu/drm/i915/intel_sprite.c | 162 +++-
 drivers/gpu/drm/imx/ipuv3-plane.c   |   4 +-
 drivers/gpu/drm/mediatek/mtk_drm_plane.c|   2 +-
 drivers/gpu/drm/meson/meson_plane.c |   1 +
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c   |   2 +-
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c   |   4 +-
 drivers/gpu/drm/mxsfb/mxsfb_drv.c   |   2 +-
 drivers/gpu/drm/nouveau/nv50_display.c  |   5 +-
 drivers/gpu/drm/omapdrm/omap_plane.c|   2 +-
 drivers/gpu/drm/pl111/pl111_display.c   |   2 +-
 drivers/gpu/drm/qxl/qxl_display.c   |   2 +-
 drivers/gpu/drm/rcar-du/rcar_du_plane.c |   4 +-
 drivers/gpu/drm/rcar-du/rcar_du_vsp.c   |   4 +-
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c |   4 +-
 drivers/gpu/drm/sti/sti_cursor.c|   2 +-
 drivers/gpu/drm/sti/sti_gdp.c   |   2 +-
 drivers/gpu/drm/sti/sti_hqvdp.c |   2 +-
 drivers/gpu/drm/stm/ltdc.c  |   2 +-
 drivers/gpu/drm/sun4i/sun4i_layer.c |   2 +-
 drivers/gpu/drm/tegra/dc.c  |  12 +-
 drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c |   2 +-
 drivers/gpu/drm/vc4/vc4_plane.c |   2 +-
 drivers/gpu/drm/virtio/virtgpu_plane.c  |   2 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c |   4 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c|   4 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c|   4 +-
 drivers/gpu/drm/zte/zx_plane.c  |   2 +-
 include/drm/drm_mode_config.h   |   6 +
 include/drm/drm_plane.h |  22 +++-
 include/drm/drm_simple_kms_helper.h |   1 +
 include/uapi/drm/drm_fourcc.h   |  11 ++
 include/uapi/drm/drm_mode.h |  50 
 48 files changed, 576 insertions(+), 52 deletions(-)

-- 
2.13.3

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] [RESEND] drm/rockchip: fix Kconfig dependencies

2017-07-23 Thread Mark yao

On 2017年07月22日 05:12, Arnd Bergmann wrote:

A bug that I had fixed earlier just came back, with CONFIG_EXTCON=m,
the rockchip drm driver will fail to link:

drivers/gpu/drm/rockchip/cdn-dp-core.o: In function `cdn_dp_get_port_lanes':
cdn-dp-core.c:(.text.cdn_dp_get_port_lanes+0x30): undefined reference to 
`extcon_get_state'
cdn-dp-core.c:(.text.cdn_dp_get_port_lanes+0x6c): undefined reference to 
`extcon_get_property'
drivers/gpu/drm/rockchip/cdn-dp-core.o: In function 
`cdn_dp_check_sink_connection':
cdn-dp-core.c:(.text.cdn_dp_check_sink_connection+0x80): undefined reference to 
`extcon_get_state'
drivers/gpu/drm/rockchip/cdn-dp-core.o: In function `cdn_dp_enable':
cdn-dp-core.c:(.text.cdn_dp_enable+0x748): undefined reference to 
`extcon_get_property'

The problem is that that the sub-drivers are now all linked into the
main rockchip drm module, which breaks all the Kconfig dependencies
that are specified in the options for those sub-drivers.

This clarifies the dependency to ensure that we can only turn on the DP
driver when EXTCON is reachable. As the 'select' statements can now
cause additional options to become built-in when they should be
loadable modules, I'm moving those into the main driver config option.
The dependency on DRM_ROCKCHIP can be reduced into a single 'if'
statement here for brevity, but this has no functional effect.

Fixes: b6705157b2db ("drm/rockchip: add extcon dependency for DP")
Fixes: 8820b68bd378 ("drm/rockchip: Refactor the component match logic.")
Link:https://patchwork.kernel.org/patch/9648761/
Acked-by: Guenter Roeck
Tested-by: Jeffy Chen
Signed-off-by: Arnd Bergmann


Pushed to drm-misc-fixes.

Thanks.

--
Mark Yao


___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 84836] VERDE lockup with Unigine Valley/Heaven if ARB_sample_shading is enabled

2017-07-23 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=84836

--- Comment #7 from Alexander Tsoy  ---
(In reply to Alexander Tsoy from comment #2)
> (In reply to Michel Dänzer from comment #1)
> > Seems to work fine on my Cape Verde. What brand and model do you have
> > specifically?
> 
> Gigabyte GV-R775OC-2GI.

JFYI: This card was unstable when operating at 850Mhz sclk (same problem on
Windows). After flashing VBIOS from GV-R775D3-2GI (same card physically, but
with 800MHz sclk) it works fine now. So this looks like a faulty vendor
overclock.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v4 0/5] DAX common 4k zero page

2017-07-23 Thread Ross Zwisler
Changes since v3:
 - Rebased onto the current linux/master which is based on v4.13-rc1.

 - Instead of adding vm_insert_mkwrite_mixed() and duplicating code from
   vm_insert_mixed(), instead just add a 'mkwrite' parameter to
   vm_insert_mixed() and update all call sites.  (Vivek)

 - Added a sanity check to the mkwrite case of insert_pfn() to be sure the
   pfn for the pte we are about to make writable matches the pfn for our
   fault. (Jan)

 - Fixed up some changelog wording for clarity. (Jan)

---

When servicing mmap() reads from file holes the current DAX code allocates
a page cache page of all zeroes and places the struct page pointer in the
mapping->page_tree radix tree.  This has three major drawbacks:

1) It consumes memory unnecessarily.  For every 4k page that is read via a
DAX mmap() over a hole, we allocate a new page cache page.  This means that
if you read 1GiB worth of pages, you end up using 1GiB of zeroed memory.

2) It is slower than using a common zero page because each page fault has
more work to do.  Instead of just inserting a common zero page we have to
allocate a page cache page, zero it, and then insert it.

3) The fact that we had to check for both DAX exceptional entries and for
page cache pages in the radix tree made the DAX code more complex.

This series solves these issues by following the lead of the DAX PMD code
and using a common 4k zero page instead.  This reduces memory usage and
decreases latencies for some workloads, and it simplifies the DAX code,
removing over 100 lines in total.

This series has passed my targeted testing and a full xfstests run on both
XFS and ext4.

Ross Zwisler (5):
  mm: add mkwrite param to vm_insert_mixed()
  dax: relocate some dax functions
  dax: use common 4k zero page for dax mmap reads
  dax: remove DAX code from page_cache_tree_insert()
  dax: move all DAX radix tree defs to fs/dax.c

 Documentation/filesystems/dax.txt   |   5 +-
 drivers/dax/device.c|   2 +-
 drivers/gpu/drm/exynos/exynos_drm_gem.c |   3 +-
 drivers/gpu/drm/gma500/framebuffer.c|   2 +-
 drivers/gpu/drm/msm/msm_gem.c   |   3 +-
 drivers/gpu/drm/omapdrm/omap_gem.c  |   6 +-
 drivers/gpu/drm/ttm/ttm_bo_vm.c |   2 +-
 fs/dax.c| 342 +---
 fs/ext2/file.c  |  25 +--
 fs/ext4/file.c  |  32 +--
 fs/xfs/xfs_file.c   |   2 +-
 include/linux/dax.h |  45 -
 include/linux/mm.h  |   2 +-
 include/trace/events/fs_dax.h   |   2 -
 mm/filemap.c|  13 +-
 mm/memory.c |  27 ++-
 16 files changed, 181 insertions(+), 332 deletions(-)

-- 
2.9.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v4 3/5] dax: use common 4k zero page for dax mmap reads

2017-07-23 Thread Ross Zwisler
When servicing mmap() reads from file holes the current DAX code allocates
a page cache page of all zeroes and places the struct page pointer in the
mapping->page_tree radix tree.  This has three major drawbacks:

1) It consumes memory unnecessarily.  For every 4k page that is read via a
DAX mmap() over a hole, we allocate a new page cache page.  This means that
if you read 1GiB worth of pages, you end up using 1GiB of zeroed memory.
This is easily visible by looking at the overall memory consumption of the
system or by looking at /proc/[pid]/smaps:

7f62e72b3000-7f63272b3000 rw-s  103:00 12   /root/dax/data
Size:1048576 kB
Rss: 1048576 kB
Pss: 1048576 kB
Shared_Clean:  0 kB
Shared_Dirty:  0 kB
Private_Clean:   1048576 kB
Private_Dirty: 0 kB
Referenced:  1048576 kB
Anonymous: 0 kB
LazyFree:  0 kB
AnonHugePages: 0 kB
ShmemPmdMapped:0 kB
Shared_Hugetlb:0 kB
Private_Hugetlb:   0 kB
Swap:  0 kB
SwapPss:   0 kB
KernelPageSize:4 kB
MMUPageSize:   4 kB
Locked:0 kB

2) It is slower than using a common zero page because each page fault has
more work to do.  Instead of just inserting a common zero page we have to
allocate a page cache page, zero it, and then insert it.  Here are the
average latencies of dax_load_hole() as measured by ftrace on a random test
box:

Old method, using zeroed page cache pages:  3.4 us
New method, using the common 4k zero page:  0.8 us

This was the average latency over 1 GiB of sequential reads done by this
simple fio script:

  [global]
  size=1G
  filename=/root/dax/data
  fallocate=none
  [io]
  rw=read
  ioengine=mmap

3) The fact that we had to check for both DAX exceptional entries and for
page cache pages in the radix tree made the DAX code more complex.

Solve these issues by following the lead of the DAX PMD code and using a
common 4k zero page instead.  As with the PMD code we will now insert a DAX
exceptional entry into the radix tree instead of a struct page pointer
which allows us to remove all the special casing in the DAX code.

Note that we do still pretty aggressively check for regular pages in the
DAX radix tree, especially where we take action based on the bits set in
the page.  If we ever find a regular page in our radix tree now that most
likely means that someone besides DAX is inserting pages (which has
happened lots of times in the past), and we want to find that out early and
fail loudly.

This solution also removes the extra memory consumption.  Here is that same
/proc/[pid]/smaps after 1GiB of reading from a hole with the new code:

7f2054a74000-7f2094a74000 rw-s  103:00 12   /root/dax/data
Size:1048576 kB
Rss:   0 kB
Pss:   0 kB
Shared_Clean:  0 kB
Shared_Dirty:  0 kB
Private_Clean: 0 kB
Private_Dirty: 0 kB
Referenced:0 kB
Anonymous: 0 kB
LazyFree:  0 kB
AnonHugePages: 0 kB
ShmemPmdMapped:0 kB
Shared_Hugetlb:0 kB
Private_Hugetlb:   0 kB
Swap:  0 kB
SwapPss:   0 kB
KernelPageSize:4 kB
MMUPageSize:   4 kB
Locked:0 kB

Overall system memory consumption is similarly improved.

Another major change is that we remove dax_pfn_mkwrite() from our fault
flow, and instead rely on the page fault itself to make the PTE dirty and
writeable.  The following description from the patch adding the
vm_insert_mixed_mkwrite() call explains this a little more:

***
  To be able to use the common 4k zero page in DAX we need to have our PTE
  fault path look more like our PMD fault path where a PTE entry can be
  marked as dirty and writeable as it is first inserted, rather than
  waiting for a follow-up dax_pfn_mkwrite() => finish_mkwrite_fault() call.

  Right now we can rely on having a dax_pfn_mkwrite() call because we can
  distinguish between these two cases in do_wp_page():

  case 1: 4k zero page => writable DAX storage
  case 2: read-only DAX storage => writeable DAX storage

  This distinction is made by via vm_normal_page().  vm_normal_page()
  returns false for the common 4k zero page, though, just as it does for
  DAX ptes.  Instead of special casing the DAX + 4k zero page case, we will
  simplify our DAX PTE page fault sequence so that it matches our DAX PMD
  sequence, and get rid of the dax_pfn_mkwrite() helper.  We will instead
  use dax_iomap_fault() to handle write-protection faults.

  This means that insert_pfn() needs to follow the lead of 

[PATCH v4 2/5] dax: relocate some dax functions

2017-07-23 Thread Ross Zwisler
dax_load_hole() will soon need to call dax_insert_mapping_entry(), so it
needs to be moved lower in dax.c so the definition exists.

dax_wake_mapping_entry_waiter() will soon be removed from dax.h and be made
static to dax.c, so we need to move its definition above all its callers.

Signed-off-by: Ross Zwisler 
---
 fs/dax.c | 138 +++
 1 file changed, 69 insertions(+), 69 deletions(-)

diff --git a/fs/dax.c b/fs/dax.c
index c844a51..779dc5e 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -121,6 +121,31 @@ static int wake_exceptional_entry_func(wait_queue_entry_t 
*wait, unsigned int mo
 }
 
 /*
+ * We do not necessarily hold the mapping->tree_lock when we call this
+ * function so it is possible that 'entry' is no longer a valid item in the
+ * radix tree.  This is okay because all we really need to do is to find the
+ * correct waitqueue where tasks might be waiting for that old 'entry' and
+ * wake them.
+ */
+void dax_wake_mapping_entry_waiter(struct address_space *mapping,
+   pgoff_t index, void *entry, bool wake_all)
+{
+   struct exceptional_entry_key key;
+   wait_queue_head_t *wq;
+
+   wq = dax_entry_waitqueue(mapping, index, entry, );
+
+   /*
+* Checking for locked entry and prepare_to_wait_exclusive() happens
+* under mapping->tree_lock, ditto for entry handling in our callers.
+* So at this point all tasks that could have seen our entry locked
+* must be in the waitqueue and the following check will see them.
+*/
+   if (waitqueue_active(wq))
+   __wake_up(wq, TASK_NORMAL, wake_all ? 0 : 1, );
+}
+
+/*
  * Check whether the given slot is locked. The function must be called with
  * mapping->tree_lock held
  */
@@ -392,31 +417,6 @@ static void *grab_mapping_entry(struct address_space 
*mapping, pgoff_t index,
return entry;
 }
 
-/*
- * We do not necessarily hold the mapping->tree_lock when we call this
- * function so it is possible that 'entry' is no longer a valid item in the
- * radix tree.  This is okay because all we really need to do is to find the
- * correct waitqueue where tasks might be waiting for that old 'entry' and
- * wake them.
- */
-void dax_wake_mapping_entry_waiter(struct address_space *mapping,
-   pgoff_t index, void *entry, bool wake_all)
-{
-   struct exceptional_entry_key key;
-   wait_queue_head_t *wq;
-
-   wq = dax_entry_waitqueue(mapping, index, entry, );
-
-   /*
-* Checking for locked entry and prepare_to_wait_exclusive() happens
-* under mapping->tree_lock, ditto for entry handling in our callers.
-* So at this point all tasks that could have seen our entry locked
-* must be in the waitqueue and the following check will see them.
-*/
-   if (waitqueue_active(wq))
-   __wake_up(wq, TASK_NORMAL, wake_all ? 0 : 1, );
-}
-
 static int __dax_invalidate_mapping_entry(struct address_space *mapping,
  pgoff_t index, bool trunc)
 {
@@ -468,50 +468,6 @@ int dax_invalidate_mapping_entry_sync(struct address_space 
*mapping,
return __dax_invalidate_mapping_entry(mapping, index, false);
 }
 
-/*
- * The user has performed a load from a hole in the file.  Allocating
- * a new page in the file would cause excessive storage usage for
- * workloads with sparse files.  We allocate a page cache page instead.
- * We'll kick it out of the page cache if it's ever written to,
- * otherwise it will simply fall out of the page cache under memory
- * pressure without ever having been dirtied.
- */
-static int dax_load_hole(struct address_space *mapping, void **entry,
-struct vm_fault *vmf)
-{
-   struct inode *inode = mapping->host;
-   struct page *page;
-   int ret;
-
-   /* Hole page already exists? Return it...  */
-   if (!radix_tree_exceptional_entry(*entry)) {
-   page = *entry;
-   goto finish_fault;
-   }
-
-   /* This will replace locked radix tree entry with a hole page */
-   page = find_or_create_page(mapping, vmf->pgoff,
-  vmf->gfp_mask | __GFP_ZERO);
-   if (!page) {
-   ret = VM_FAULT_OOM;
-   goto out;
-   }
-
-finish_fault:
-   vmf->page = page;
-   ret = finish_fault(vmf);
-   vmf->page = NULL;
-   *entry = page;
-   if (!ret) {
-   /* Grab reference for PTE that is now referencing the page */
-   get_page(page);
-   ret = VM_FAULT_NOPAGE;
-   }
-out:
-   trace_dax_load_hole(inode, vmf, ret);
-   return ret;
-}
-
 static int copy_user_dax(struct block_device *bdev, struct dax_device *dax_dev,
sector_t sector, size_t size, struct page *to,
unsigned long vaddr)
@@ -938,6 +894,50 @@ int dax_pfn_mkwrite(struct vm_fault *vmf)
 }
 

Re: [PATCH v4 1/5] mm: add mkwrite param to vm_insert_mixed()

2017-07-23 Thread Dan Williams
On Fri, Jul 21, 2017 at 3:39 PM, Ross Zwisler
 wrote:
> To be able to use the common 4k zero page in DAX we need to have our PTE
> fault path look more like our PMD fault path where a PTE entry can be
> marked as dirty and writeable as it is first inserted, rather than waiting
> for a follow-up dax_pfn_mkwrite() => finish_mkwrite_fault() call.
>
> Right now we can rely on having a dax_pfn_mkwrite() call because we can
> distinguish between these two cases in do_wp_page():
>
> case 1: 4k zero page => writable DAX storage
> case 2: read-only DAX storage => writeable DAX storage
>
> This distinction is made by via vm_normal_page().  vm_normal_page() returns
> false for the common 4k zero page, though, just as it does for DAX ptes.
> Instead of special casing the DAX + 4k zero page case, we will simplify our
> DAX PTE page fault sequence so that it matches our DAX PMD sequence, and
> get rid of the dax_pfn_mkwrite() helper.  We will instead use
> dax_iomap_fault() to handle write-protection faults.
>
> This means that insert_pfn() needs to follow the lead of insert_pfn_pmd()
> and allow us to pass in a 'mkwrite' flag.  If 'mkwrite' is set insert_pfn()
> will do the work that was previously done by wp_page_reuse() as part of the
> dax_pfn_mkwrite() call path.
>
> Signed-off-by: Ross Zwisler 
> ---
>  drivers/dax/device.c|  2 +-
>  drivers/gpu/drm/exynos/exynos_drm_gem.c |  3 ++-
>  drivers/gpu/drm/gma500/framebuffer.c|  2 +-
>  drivers/gpu/drm/msm/msm_gem.c   |  3 ++-
>  drivers/gpu/drm/omapdrm/omap_gem.c  |  6 --
>  drivers/gpu/drm/ttm/ttm_bo_vm.c |  2 +-
>  fs/dax.c|  2 +-
>  include/linux/mm.h  |  2 +-
>  mm/memory.c | 27 +--
>  9 files changed, 34 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/dax/device.c b/drivers/dax/device.c
> index e9f3b3e..3973521 100644
> --- a/drivers/dax/device.c
> +++ b/drivers/dax/device.c
> @@ -273,7 +273,7 @@ static int __dev_dax_pte_fault(struct dev_dax *dev_dax, 
> struct vm_fault *vmf)
>
> pfn = phys_to_pfn_t(phys, dax_region->pfn_flags);
>
> -   rc = vm_insert_mixed(vmf->vma, vmf->address, pfn);
> +   rc = vm_insert_mixed(vmf->vma, vmf->address, pfn, false);

Ugh, I generally find bool flags unreadable. They place a tax on
jumping to function definition to recall what true and false mean. If
we want to go this 'add an argument' route can we at least add an enum
like:

enum {
PTE_MKDIRTY,
PTE_MKCLEAN,
};

...to differentiate the two cases?
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v4 5/5] dax: move all DAX radix tree defs to fs/dax.c

2017-07-23 Thread Ross Zwisler
Now that we no longer insert struct page pointers in DAX radix trees the
page cache code no longer needs to know anything about DAX exceptional
entries.  Move all the DAX exceptional entry definitions from dax.h to
fs/dax.c.

Signed-off-by: Ross Zwisler 
Suggested-by: Jan Kara 
---
 fs/dax.c| 34 ++
 include/linux/dax.h | 41 -
 2 files changed, 34 insertions(+), 41 deletions(-)

diff --git a/fs/dax.c b/fs/dax.c
index 0e27d90..e7acc45 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -54,6 +54,40 @@ static int __init init_dax_wait_table(void)
 }
 fs_initcall(init_dax_wait_table);
 
+/*
+ * We use lowest available bit in exceptional entry for locking, one bit for
+ * the entry size (PMD) and two more to tell us if the entry is a zero page or
+ * an empty entry that is just used for locking.  In total four special bits.
+ *
+ * If the PMD bit isn't set the entry has size PAGE_SIZE, and if the ZERO_PAGE
+ * and EMPTY bits aren't set the entry is a normal DAX entry with a filesystem
+ * block allocation.
+ */
+#define RADIX_DAX_SHIFT(RADIX_TREE_EXCEPTIONAL_SHIFT + 4)
+#define RADIX_DAX_ENTRY_LOCK   (1 << RADIX_TREE_EXCEPTIONAL_SHIFT)
+#define RADIX_DAX_PMD  (1 << (RADIX_TREE_EXCEPTIONAL_SHIFT + 1))
+#define RADIX_DAX_ZERO_PAGE(1 << (RADIX_TREE_EXCEPTIONAL_SHIFT + 2))
+#define RADIX_DAX_EMPTY(1 << (RADIX_TREE_EXCEPTIONAL_SHIFT + 
3))
+
+static unsigned long dax_radix_sector(void *entry)
+{
+   return (unsigned long)entry >> RADIX_DAX_SHIFT;
+}
+
+static void *dax_radix_locked_entry(sector_t sector, unsigned long flags)
+{
+   return (void *)(RADIX_TREE_EXCEPTIONAL_ENTRY | flags |
+   ((unsigned long)sector << RADIX_DAX_SHIFT) |
+   RADIX_DAX_ENTRY_LOCK);
+}
+
+static unsigned int dax_radix_order(void *entry)
+{
+   if ((unsigned long)entry & RADIX_DAX_PMD)
+   return PMD_SHIFT - PAGE_SHIFT;
+   return 0;
+}
+
 static int dax_is_pmd_entry(void *entry)
 {
return (unsigned long)entry & RADIX_DAX_PMD;
diff --git a/include/linux/dax.h b/include/linux/dax.h
index afa99bb..d0e3272 100644
--- a/include/linux/dax.h
+++ b/include/linux/dax.h
@@ -88,33 +88,6 @@ void dax_flush(struct dax_device *dax_dev, pgoff_t pgoff, 
void *addr,
size_t size);
 void dax_write_cache(struct dax_device *dax_dev, bool wc);
 
-/*
- * We use lowest available bit in exceptional entry for locking, one bit for
- * the entry size (PMD) and two more to tell us if the entry is a zero page or
- * an empty entry that is just used for locking.  In total four special bits.
- *
- * If the PMD bit isn't set the entry has size PAGE_SIZE, and if the ZERO_PAGE
- * and EMPTY bits aren't set the entry is a normal DAX entry with a filesystem
- * block allocation.
- */
-#define RADIX_DAX_SHIFT(RADIX_TREE_EXCEPTIONAL_SHIFT + 4)
-#define RADIX_DAX_ENTRY_LOCK (1 << RADIX_TREE_EXCEPTIONAL_SHIFT)
-#define RADIX_DAX_PMD (1 << (RADIX_TREE_EXCEPTIONAL_SHIFT + 1))
-#define RADIX_DAX_ZERO_PAGE (1 << (RADIX_TREE_EXCEPTIONAL_SHIFT + 2))
-#define RADIX_DAX_EMPTY (1 << (RADIX_TREE_EXCEPTIONAL_SHIFT + 3))
-
-static inline unsigned long dax_radix_sector(void *entry)
-{
-   return (unsigned long)entry >> RADIX_DAX_SHIFT;
-}
-
-static inline void *dax_radix_locked_entry(sector_t sector, unsigned long 
flags)
-{
-   return (void *)(RADIX_TREE_EXCEPTIONAL_ENTRY | flags |
-   ((unsigned long)sector << RADIX_DAX_SHIFT) |
-   RADIX_DAX_ENTRY_LOCK);
-}
-
 ssize_t dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter,
const struct iomap_ops *ops);
 int dax_iomap_fault(struct vm_fault *vmf, enum page_entry_size pe_size,
@@ -136,20 +109,6 @@ static inline int __dax_zero_page_range(struct 
block_device *bdev,
 }
 #endif
 
-#ifdef CONFIG_FS_DAX_PMD
-static inline unsigned int dax_radix_order(void *entry)
-{
-   if ((unsigned long)entry & RADIX_DAX_PMD)
-   return PMD_SHIFT - PAGE_SHIFT;
-   return 0;
-}
-#else
-static inline unsigned int dax_radix_order(void *entry)
-{
-   return 0;
-}
-#endif
-
 static inline bool dax_mapping(struct address_space *mapping)
 {
return mapping->host && IS_DAX(mapping->host);
-- 
2.9.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v4 1/5] mm: add mkwrite param to vm_insert_mixed()

2017-07-23 Thread Ross Zwisler
To be able to use the common 4k zero page in DAX we need to have our PTE
fault path look more like our PMD fault path where a PTE entry can be
marked as dirty and writeable as it is first inserted, rather than waiting
for a follow-up dax_pfn_mkwrite() => finish_mkwrite_fault() call.

Right now we can rely on having a dax_pfn_mkwrite() call because we can
distinguish between these two cases in do_wp_page():

case 1: 4k zero page => writable DAX storage
case 2: read-only DAX storage => writeable DAX storage

This distinction is made by via vm_normal_page().  vm_normal_page() returns
false for the common 4k zero page, though, just as it does for DAX ptes.
Instead of special casing the DAX + 4k zero page case, we will simplify our
DAX PTE page fault sequence so that it matches our DAX PMD sequence, and
get rid of the dax_pfn_mkwrite() helper.  We will instead use
dax_iomap_fault() to handle write-protection faults.

This means that insert_pfn() needs to follow the lead of insert_pfn_pmd()
and allow us to pass in a 'mkwrite' flag.  If 'mkwrite' is set insert_pfn()
will do the work that was previously done by wp_page_reuse() as part of the
dax_pfn_mkwrite() call path.

Signed-off-by: Ross Zwisler 
---
 drivers/dax/device.c|  2 +-
 drivers/gpu/drm/exynos/exynos_drm_gem.c |  3 ++-
 drivers/gpu/drm/gma500/framebuffer.c|  2 +-
 drivers/gpu/drm/msm/msm_gem.c   |  3 ++-
 drivers/gpu/drm/omapdrm/omap_gem.c  |  6 --
 drivers/gpu/drm/ttm/ttm_bo_vm.c |  2 +-
 fs/dax.c|  2 +-
 include/linux/mm.h  |  2 +-
 mm/memory.c | 27 +--
 9 files changed, 34 insertions(+), 15 deletions(-)

diff --git a/drivers/dax/device.c b/drivers/dax/device.c
index e9f3b3e..3973521 100644
--- a/drivers/dax/device.c
+++ b/drivers/dax/device.c
@@ -273,7 +273,7 @@ static int __dev_dax_pte_fault(struct dev_dax *dev_dax, 
struct vm_fault *vmf)
 
pfn = phys_to_pfn_t(phys, dax_region->pfn_flags);
 
-   rc = vm_insert_mixed(vmf->vma, vmf->address, pfn);
+   rc = vm_insert_mixed(vmf->vma, vmf->address, pfn, false);
 
if (rc == -ENOMEM)
return VM_FAULT_OOM;
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c 
b/drivers/gpu/drm/exynos/exynos_drm_gem.c
index c23479b..bfa6648 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
@@ -466,7 +466,8 @@ int exynos_drm_gem_fault(struct vm_fault *vmf)
}
 
pfn = page_to_pfn(exynos_gem->pages[page_offset]);
-   ret = vm_insert_mixed(vma, vmf->address, __pfn_to_pfn_t(pfn, PFN_DEV));
+   ret = vm_insert_mixed(vma, vmf->address, __pfn_to_pfn_t(pfn, PFN_DEV),
+   false);
 
 out:
switch (ret) {
diff --git a/drivers/gpu/drm/gma500/framebuffer.c 
b/drivers/gpu/drm/gma500/framebuffer.c
index 7da70b6..6dd865f 100644
--- a/drivers/gpu/drm/gma500/framebuffer.c
+++ b/drivers/gpu/drm/gma500/framebuffer.c
@@ -134,7 +134,7 @@ static int psbfb_vm_fault(struct vm_fault *vmf)
pfn = (phys_addr >> PAGE_SHIFT);
 
ret = vm_insert_mixed(vma, address,
-   __pfn_to_pfn_t(pfn, PFN_DEV));
+   __pfn_to_pfn_t(pfn, PFN_DEV), false);
if (unlikely((ret == -EBUSY) || (ret != 0 && i > 0)))
break;
else if (unlikely(ret != 0)) {
diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c
index 65f3554..c187fd1 100644
--- a/drivers/gpu/drm/msm/msm_gem.c
+++ b/drivers/gpu/drm/msm/msm_gem.c
@@ -249,7 +249,8 @@ int msm_gem_fault(struct vm_fault *vmf)
VERB("Inserting %p pfn %lx, pa %lx", (void *)vmf->address,
pfn, pfn << PAGE_SHIFT);
 
-   ret = vm_insert_mixed(vma, vmf->address, __pfn_to_pfn_t(pfn, PFN_DEV));
+   ret = vm_insert_mixed(vma, vmf->address, __pfn_to_pfn_t(pfn, PFN_DEV),
+   false);
 
 out_unlock:
mutex_unlock(_obj->lock);
diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c 
b/drivers/gpu/drm/omapdrm/omap_gem.c
index 5c5c86d..26eebcd 100644
--- a/drivers/gpu/drm/omapdrm/omap_gem.c
+++ b/drivers/gpu/drm/omapdrm/omap_gem.c
@@ -393,7 +393,8 @@ static int fault_1d(struct drm_gem_object *obj,
VERB("Inserting %p pfn %lx, pa %lx", (void *)vmf->address,
pfn, pfn << PAGE_SHIFT);
 
-   return vm_insert_mixed(vma, vmf->address, __pfn_to_pfn_t(pfn, PFN_DEV));
+   return vm_insert_mixed(vma, vmf->address, __pfn_to_pfn_t(pfn, PFN_DEV),
+   false);
 }
 
 /* Special handling for the case of faulting in 2d tiled buffers */
@@ -486,7 +487,8 @@ static int fault_2d(struct drm_gem_object *obj,
pfn, pfn << PAGE_SHIFT);
 
for (i = n; i > 0; i--) {
-   vm_insert_mixed(vma, vaddr, __pfn_to_pfn_t(pfn, PFN_DEV));
+ 

[PATCH v3 6/8] Documentation: Add device tree binding for Goldfish FB driver

2017-07-23 Thread Aleksandar Markovic
From: Aleksandar Markovic 

Add documentation for DT binding of Goldfish FB driver. The compatible
string used by OS for binding the driver is "google,goldfish-fb".

Signed-off-by: Miodrag Dinic 
Signed-off-by: Goran Ferenc 
Signed-off-by: Aleksandar Markovic 
---
 .../devicetree/bindings/display/google,goldfish-fb.txt | 18 ++
 1 file changed, 18 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/google,goldfish-fb.txt

diff --git a/Documentation/devicetree/bindings/display/google,goldfish-fb.txt 
b/Documentation/devicetree/bindings/display/google,goldfish-fb.txt
new file mode 100644
index 000..9ce0615
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/google,goldfish-fb.txt
@@ -0,0 +1,18 @@
+Android Goldfish framebuffer
+
+Android Goldfish framebuffer device used by Android emulator.
+
+Required properties:
+
+- compatible : should contain "google,goldfish-fb"
+- reg: 
+- interrupts : 
+
+Example:
+
+   goldfish_fb@1f008000 {
+   compatible = "google,goldfish-fb";
+   interrupts = <0x10>;
+   reg = <0x1f008000 0x0 0x100>;
+   compatible = "google,goldfish-fb";
+   };
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v4 4/5] dax: remove DAX code from page_cache_tree_insert()

2017-07-23 Thread Ross Zwisler
Now that we no longer insert struct page pointers in DAX radix trees we can
remove the special casing for DAX in page_cache_tree_insert().  This also
allows us to make dax_wake_mapping_entry_waiter() local to fs/dax.c,
removing it from dax.h.

Signed-off-by: Ross Zwisler 
Suggested-by: Jan Kara 
---
 fs/dax.c|  2 +-
 include/linux/dax.h |  2 --
 mm/filemap.c| 13 ++---
 3 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/fs/dax.c b/fs/dax.c
index fb0e4c1..0e27d90 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -127,7 +127,7 @@ static int wake_exceptional_entry_func(wait_queue_entry_t 
*wait, unsigned int mo
  * correct waitqueue where tasks might be waiting for that old 'entry' and
  * wake them.
  */
-void dax_wake_mapping_entry_waiter(struct address_space *mapping,
+static void dax_wake_mapping_entry_waiter(struct address_space *mapping,
pgoff_t index, void *entry, bool wake_all)
 {
struct exceptional_entry_key key;
diff --git a/include/linux/dax.h b/include/linux/dax.h
index 29cced8..afa99bb 100644
--- a/include/linux/dax.h
+++ b/include/linux/dax.h
@@ -122,8 +122,6 @@ int dax_iomap_fault(struct vm_fault *vmf, enum 
page_entry_size pe_size,
 int dax_delete_mapping_entry(struct address_space *mapping, pgoff_t index);
 int dax_invalidate_mapping_entry_sync(struct address_space *mapping,
  pgoff_t index);
-void dax_wake_mapping_entry_waiter(struct address_space *mapping,
-   pgoff_t index, void *entry, bool wake_all);
 
 #ifdef CONFIG_FS_DAX
 int __dax_zero_page_range(struct block_device *bdev,
diff --git a/mm/filemap.c b/mm/filemap.c
index a497024..1bf1265 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -130,17 +130,8 @@ static int page_cache_tree_insert(struct address_space 
*mapping,
return -EEXIST;
 
mapping->nrexceptional--;
-   if (!dax_mapping(mapping)) {
-   if (shadowp)
-   *shadowp = p;
-   } else {
-   /* DAX can replace empty locked entry with a hole */
-   WARN_ON_ONCE(p !=
-   dax_radix_locked_entry(0, RADIX_DAX_EMPTY));
-   /* Wakeup waiters for exceptional entry lock */
-   dax_wake_mapping_entry_waiter(mapping, page->index, p,
- true);
-   }
+   if (shadowp)
+   *shadowp = p;
}
__radix_tree_replace(>page_tree, node, slot, page,
 workingset_update_node, mapping);
-- 
2.9.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] android: amdgpu: move asic id table to a separate file

2017-07-23 Thread Mauro Rossi
Changes in Android.mk makefile to avoid building errors in mesa
due to missing LOCAL_CFLAGS variable definition for
AMDGPU_ASIC_ID_TABLE and ASIC_ID_TABLE_NUM_ENTRIES

Fixes: 7e6bf88cac ("amdgpu: move asic id table to a separate file")
---
 amdgpu/Android.mk | 8 
 1 file changed, 8 insertions(+)

diff --git a/amdgpu/Android.mk b/amdgpu/Android.mk
index bf0611ba..270680bb 100644
--- a/amdgpu/Android.mk
+++ b/amdgpu/Android.mk
@@ -10,5 +10,13 @@ LOCAL_SHARED_LIBRARIES := libdrm
 
 LOCAL_SRC_FILES := $(LIBDRM_AMDGPU_FILES)
 
+ASIC_ID_TABLE_NUM_ENTRIES := $(shell egrep -ci '^[0-9a-f]{4},.*[0-9a-f]+,' \
+   $(LIBDRM_TOP)/data/amdgpu.ids)
+
+LOCAL_CFLAGS += -DAMDGPU_ASIC_ID_TABLE=\"$(LIBDRM_TOP)/data/amdgpu.ids\" \
+   -DAMDGPU_ASIC_ID_TABLE_NUM_ENTRIES=$(ASIC_ID_TABLE_NUM_ENTRIES)
+
+$(intermediates)/amdgpu_asic_id.o: $(LIBDRM_TOP)/data/amdgpu.ids
+
 include $(LIBDRM_COMMON_MK)
 include $(BUILD_SHARED_LIBRARY)
-- 
2.11.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 000/102] Convert drivers to explicit reset API

2017-07-23 Thread Linus Walleij
On Thu, Jul 20, 2017 at 10:46 PM, Dmitry Torokhov
 wrote:
> On Thu, Jul 20, 2017 at 5:55 AM, Philipp Zabel  wrote:

>>> What about reset_control_get(struct device *, const char *, int flags)
>>> to replace all those variants ?
>>
>> While I like how this looks, unfortunately (devm_)reset_control_get
>> already exists without the flags, so we can't change to that with a
>> gentle transition.
>
> This was done for gpiod_get() and its flags argument with horrifying
> #define-ry, which thankfully was completely hidden from users.

For your reference:

commit bae48da237fcedd7ad09569025483b988635efb7
"gpiolib: add gpiod_get() and gpiod_put() functions"

commit 39b2bbe3d715cf5013b5c48695ccdd25bd3bf120
"gpio: add flags argument to gpiod_get*() functions"

commit 0dbc8b7afef6e4fddcfebcbacbeb269a0a3b06d5
"gpio: move varargs hack outside #ifdef GPIOLIB"

commit b17d1bf16cc72a374a48d748940f79d40ff4
"gpio: make flags mandatory for gpiod_get functions"

Retrospectively ... was that really a good idea... it was a LOT
of trouble to add a flag, maybe it had been better to try and
just slam all users in a single go.

But it worked.

Yours,
Linus Walleij
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 101653] FAN speed is too high when displays are off

2017-07-23 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101653

Alexander Tsoy  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #5 from Alexander Tsoy  ---
The patch is upstream:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=73cc90798ff765341a1d9c2cfe18153ab231c9bb

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: linux-next: build failure after merge of the drm-misc tree

2017-07-23 Thread Stephen Rothwell
Hi Daniel,

On Fri, 21 Jul 2017 09:24:49 +0200 Daniel Vetter  wrote:
>
> How are we going to handle this now? The refactor is deeply burried in
> drm-misc, I guess you could cherry-pick the relevant patches over. But
> that'll probably lead to more conflicts because git will get confused.

I'll just keep applying the merge resolution patch and will remind Dave
and Greg about it during the week before the merge window opens so that
they can let Linus know that the fix up is needed.

-- 
Cheers,
Stephen Rothwell
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 101881] [regression] 32bit steam games segfault when launched with DRI_PRIME=1

2017-07-23 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101881

--- Comment #4 from Mike Lothian  ---
So this only seems to happen if I compile LLVM with GCC 7.1, I don't see the
issue if it's compiled with Clang. The problem also goes away when I compile
with debugging on

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 31/41] drm/ast: Use the drm_driver.dumb_destroy default

2017-07-23 Thread Noralf Trønnes
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Dave Airlie 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/ast/ast_drv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c
index 3022b39..69dab82 100644
--- a/drivers/gpu/drm/ast/ast_drv.c
+++ b/drivers/gpu/drm/ast/ast_drv.c
@@ -209,7 +209,6 @@ static struct drm_driver driver = {
.gem_free_object_unlocked = ast_gem_free_object,
.dumb_create = ast_dumb_create,
.dumb_map_offset = ast_dumb_mmap_offset,
-   .dumb_destroy = drm_gem_dumb_destroy,
 
 };
 
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 15/41] drm/sti: Use .dumb_map_offset and .dumb_destroy defaults

2017-07-23 Thread Noralf Trønnes
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Benjamin Gaignard 
Cc: Vincent Abriou 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/sti/sti_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
index 06ef1e38..1700c54 100644
--- a/drivers/gpu/drm/sti/sti_drv.c
+++ b/drivers/gpu/drm/sti/sti_drv.c
@@ -175,8 +175,6 @@ static struct drm_driver sti_driver = {
.gem_free_object_unlocked = drm_gem_cma_free_object,
.gem_vm_ops = _gem_cma_vm_ops,
.dumb_create = drm_gem_cma_dumb_create,
-   .dumb_map_offset = drm_gem_cma_dumb_map_offset,
-   .dumb_destroy = drm_gem_dumb_destroy,
.fops = _driver_fops,
 
.enable_vblank = sti_crtc_enable_vblank,
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 14/41] drm/shmobile: Use .dumb_map_offset and .dumb_destroy defaults

2017-07-23 Thread Noralf Trønnes
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Laurent Pinchart 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/shmobile/shmob_drm_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c 
b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
index c2ca073..5925725 100644
--- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c
+++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
@@ -145,8 +145,6 @@ static struct drm_driver shmob_drm_driver = {
.gem_prime_vunmap   = drm_gem_cma_prime_vunmap,
.gem_prime_mmap = drm_gem_cma_prime_mmap,
.dumb_create= drm_gem_cma_dumb_create,
-   .dumb_map_offset= drm_gem_cma_dumb_map_offset,
-   .dumb_destroy   = drm_gem_dumb_destroy,
.fops   = _drm_fops,
.name   = "shmob-drm",
.desc   = "Renesas SH Mobile DRM",
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 16/41] drm/stm: Use .dumb_map_offset and .dumb_destroy defaults

2017-07-23 Thread Noralf Trønnes
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Yannick Fertre 
Cc: Philippe Cornu 
Cc: Benjamin Gaignard 
Cc: Vincent Abriou 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/stm/drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
index 095971f..b333b37 100644
--- a/drivers/gpu/drm/stm/drv.c
+++ b/drivers/gpu/drm/stm/drv.c
@@ -60,8 +60,6 @@ static struct drm_driver drv_driver = {
.patchlevel = 0,
.fops = _driver_fops,
.dumb_create = drm_gem_cma_dumb_create,
-   .dumb_map_offset = drm_gem_cma_dumb_map_offset,
-   .dumb_destroy = drm_gem_dumb_destroy,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_free_object_unlocked = drm_gem_cma_free_object,
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 32/41] drm/nouveau: Use the drm_driver.dumb_destroy default

2017-07-23 Thread Noralf Trønnes
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Ben Skeggs 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/nouveau/nouveau_drm.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c 
b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 2600b3b..df7e203 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -998,7 +998,6 @@ driver_stub = {
 
.dumb_create = nouveau_display_dumb_create,
.dumb_map_offset = nouveau_display_dumb_map_offset,
-   .dumb_destroy = drm_gem_dumb_destroy,
 
.name = DRIVER_NAME,
.desc = DRIVER_DESC,
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 41/41] drm/virtio: Use the drm_driver.dumb_destroy default

2017-07-23 Thread Noralf Trønnes
virtio_gpu_mode_dumb_destroy() is the same as drm_gem_dumb_destroy()
which is the drm_driver.dumb_destroy default, so no need to set it.

Cc: David Airlie 
Cc: Gerd Hoffmann 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/virtio/virtgpu_drv.c | 1 -
 drivers/gpu/drm/virtio/virtgpu_drv.h | 3 ---
 drivers/gpu/drm/virtio/virtgpu_gem.c | 7 ---
 3 files changed, 11 deletions(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c 
b/drivers/gpu/drm/virtio/virtgpu_drv.c
index 63d35c7..49a3d8d 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.c
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
@@ -122,7 +122,6 @@ static struct drm_driver driver = {
 
.dumb_create = virtio_gpu_mode_dumb_create,
.dumb_map_offset = virtio_gpu_mode_dumb_mmap,
-   .dumb_destroy = virtio_gpu_mode_dumb_destroy,
 
 #if defined(CONFIG_DEBUG_FS)
.debugfs_init = virtio_gpu_debugfs_init,
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h 
b/drivers/gpu/drm/virtio/virtgpu_drv.h
index 3a66abb..da2fb58 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.h
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.h
@@ -236,9 +236,6 @@ struct virtio_gpu_object *virtio_gpu_alloc_object(struct 
drm_device *dev,
 int virtio_gpu_mode_dumb_create(struct drm_file *file_priv,
struct drm_device *dev,
struct drm_mode_create_dumb *args);
-int virtio_gpu_mode_dumb_destroy(struct drm_file *file_priv,
-struct drm_device *dev,
-uint32_t handle);
 int virtio_gpu_mode_dumb_mmap(struct drm_file *file_priv,
  struct drm_device *dev,
  uint32_t handle, uint64_t *offset_p);
diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c 
b/drivers/gpu/drm/virtio/virtgpu_gem.c
index cc025d8..72ad7b1 100644
--- a/drivers/gpu/drm/virtio/virtgpu_gem.c
+++ b/drivers/gpu/drm/virtio/virtgpu_gem.c
@@ -118,13 +118,6 @@ int virtio_gpu_mode_dumb_create(struct drm_file *file_priv,
return ret;
 }
 
-int virtio_gpu_mode_dumb_destroy(struct drm_file *file_priv,
-struct drm_device *dev,
-uint32_t handle)
-{
-   return drm_gem_handle_delete(file_priv, handle);
-}
-
 int virtio_gpu_mode_dumb_mmap(struct drm_file *file_priv,
  struct drm_device *dev,
  uint32_t handle, uint64_t *offset_p)
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 13/41] drm/rcar-du: Use .dumb_map_offset and .dumb_destroy defaults

2017-07-23 Thread Noralf Trønnes
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Laurent Pinchart 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c 
b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
index d6a0255..c09cf84 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
@@ -238,8 +238,6 @@ static struct drm_driver rcar_du_driver = {
.gem_prime_vunmap   = drm_gem_cma_prime_vunmap,
.gem_prime_mmap = drm_gem_cma_prime_mmap,
.dumb_create= rcar_du_dumb_create,
-   .dumb_map_offset= drm_gem_cma_dumb_map_offset,
-   .dumb_destroy   = drm_gem_dumb_destroy,
.fops   = _du_fops,
.name   = "rcar-du",
.desc   = "Renesas R-Car Display Unit",
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 29/41] drm/amdgpu: Use the drm_driver.dumb_destroy default

2017-07-23 Thread Noralf Trønnes
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Alex Deucher 
Cc: Christian König 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 4699924..3c57102 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -822,7 +822,6 @@ static struct drm_driver kms_driver = {
.gem_close_object = amdgpu_gem_object_close,
.dumb_create = amdgpu_mode_dumb_create,
.dumb_map_offset = amdgpu_mode_dumb_mmap,
-   .dumb_destroy = drm_gem_dumb_destroy,
.fops = _driver_kms_fops,
 
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 27/41] drm/udl: Use the drm_driver.dumb_destroy default

2017-07-23 Thread Noralf Trønnes
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Dave Airlie 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/udl/udl_drv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/udl/udl_drv.c b/drivers/gpu/drm/udl/udl_drv.c
index 0f02e1ac..0b71865 100644
--- a/drivers/gpu/drm/udl/udl_drv.c
+++ b/drivers/gpu/drm/udl/udl_drv.c
@@ -54,7 +54,6 @@ static struct drm_driver driver = {
 
.dumb_create = udl_dumb_create,
.dumb_map_offset = udl_gem_mmap,
-   .dumb_destroy = drm_gem_dumb_destroy,
.fops = _driver_fops,
 
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 12/41] drm/pl111: Use .dumb_map_offset and .dumb_destroy defaults

2017-07-23 Thread Noralf Trønnes
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Eric Anholt 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/pl111/pl111_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/pl111/pl111_drv.c 
b/drivers/gpu/drm/pl111/pl111_drv.c
index 8907bc2..29653fe 100644
--- a/drivers/gpu/drm/pl111/pl111_drv.c
+++ b/drivers/gpu/drm/pl111/pl111_drv.c
@@ -159,8 +159,6 @@ static struct drm_driver pl111_drm_driver = {
.minor = 0,
.patchlevel = 0,
.dumb_create = drm_gem_cma_dumb_create,
-   .dumb_destroy = drm_gem_dumb_destroy,
-   .dumb_map_offset = drm_gem_cma_dumb_map_offset,
.gem_free_object_unlocked = drm_gem_cma_free_object,
.gem_vm_ops = _gem_cma_vm_ops,
 
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 40/41] drm/armada: Use the drm_driver.dumb_destroy default

2017-07-23 Thread Noralf Trønnes
armada_gem_dumb_destroy() is the same as drm_gem_dumb_destroy()
which is the drm_driver.dumb_destroy default, so no need to set it.

Cc: Russell King 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/armada/armada_drv.c | 1 -
 drivers/gpu/drm/armada/armada_gem.c | 6 --
 drivers/gpu/drm/armada/armada_gem.h | 2 --
 3 files changed, 9 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_drv.c 
b/drivers/gpu/drm/armada/armada_drv.c
index 0b3227c..8a37b9a 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -71,7 +71,6 @@ static struct drm_driver armada_drm_driver = {
.gem_prime_import   = armada_gem_prime_import,
.dumb_create= armada_gem_dumb_create,
.dumb_map_offset= armada_gem_dumb_map_offset,
-   .dumb_destroy   = armada_gem_dumb_destroy,
.gem_vm_ops = _gem_vm_ops,
.major  = 1,
.minor  = 0,
diff --git a/drivers/gpu/drm/armada/armada_gem.c 
b/drivers/gpu/drm/armada/armada_gem.c
index a76ca21..9d69132 100644
--- a/drivers/gpu/drm/armada/armada_gem.c
+++ b/drivers/gpu/drm/armada/armada_gem.c
@@ -300,12 +300,6 @@ int armada_gem_dumb_map_offset(struct drm_file *file, 
struct drm_device *dev,
return ret;
 }
 
-int armada_gem_dumb_destroy(struct drm_file *file, struct drm_device *dev,
-   uint32_t handle)
-{
-   return drm_gem_handle_delete(file, handle);
-}
-
 /* Private driver gem ioctls */
 int armada_gem_create_ioctl(struct drm_device *dev, void *data,
struct drm_file *file)
diff --git a/drivers/gpu/drm/armada/armada_gem.h 
b/drivers/gpu/drm/armada/armada_gem.h
index 6e524e0..78d5690 100644
--- a/drivers/gpu/drm/armada/armada_gem.h
+++ b/drivers/gpu/drm/armada/armada_gem.h
@@ -37,8 +37,6 @@ int armada_gem_dumb_create(struct drm_file *, struct 
drm_device *,
struct drm_mode_create_dumb *);
 int armada_gem_dumb_map_offset(struct drm_file *, struct drm_device *,
uint32_t, uint64_t *);
-int armada_gem_dumb_destroy(struct drm_file *, struct drm_device *,
-   uint32_t);
 struct dma_buf *armada_gem_prime_export(struct drm_device *dev,
struct drm_gem_object *obj, int flags);
 struct drm_gem_object *armada_gem_prime_import(struct drm_device *,
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 17/41] drm/sun4i: Use .dumb_map_offset and .dumb_destroy defaults

2017-07-23 Thread Noralf Trønnes
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Maxime Ripard 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/sun4i/sun4i_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c 
b/drivers/gpu/drm/sun4i/sun4i_drv.c
index 89cd590..d599206 100644
--- a/drivers/gpu/drm/sun4i/sun4i_drv.c
+++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
@@ -40,8 +40,6 @@ static struct drm_driver sun4i_drv_driver = {
 
/* GEM Operations */
.dumb_create= drm_gem_cma_dumb_create,
-   .dumb_destroy   = drm_gem_dumb_destroy,
-   .dumb_map_offset= drm_gem_cma_dumb_map_offset,
.gem_free_object_unlocked = drm_gem_cma_free_object,
.gem_vm_ops = _gem_cma_vm_ops,
 
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 24/41] drm/rockchip: Use .dumb_map_offset and .dumb_destroy defaults

2017-07-23 Thread Noralf Trønnes
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Mark Yao 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c |  2 --
 drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 26 --
 drivers/gpu/drm/rockchip/rockchip_drm_gem.h |  3 ---
 3 files changed, 31 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c 
b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
index 131cb5c..848edcf 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
@@ -233,8 +233,6 @@ static struct drm_driver rockchip_drm_driver = {
.gem_vm_ops = _gem_cma_vm_ops,
.gem_free_object_unlocked = rockchip_gem_free_object,
.dumb_create= rockchip_gem_dumb_create,
-   .dumb_map_offset= rockchip_gem_dumb_map_offset,
-   .dumb_destroy   = drm_gem_dumb_destroy,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import   = drm_gem_prime_import,
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c 
b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
index b74ac71..f74333e 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
@@ -393,32 +393,6 @@ rockchip_gem_create_with_handle(struct drm_file *file_priv,
return ERR_PTR(ret);
 }
 
-int rockchip_gem_dumb_map_offset(struct drm_file *file_priv,
-struct drm_device *dev, uint32_t handle,
-uint64_t *offset)
-{
-   struct drm_gem_object *obj;
-   int ret;
-
-   obj = drm_gem_object_lookup(file_priv, handle);
-   if (!obj) {
-   DRM_ERROR("failed to lookup gem object.\n");
-   return -EINVAL;
-   }
-
-   ret = drm_gem_create_mmap_offset(obj);
-   if (ret)
-   goto out;
-
-   *offset = drm_vma_node_offset_addr(>vma_node);
-   DRM_DEBUG_KMS("offset = 0x%llx\n", *offset);
-
-out:
-   drm_gem_object_unreference_unlocked(obj);
-
-   return 0;
-}
-
 /*
  * rockchip_gem_dumb_create - (struct drm_driver)->dumb_create callback
  * function
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.h 
b/drivers/gpu/drm/rockchip/rockchip_drm_gem.h
index 3f6ea4d..f237375 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.h
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.h
@@ -57,7 +57,4 @@ void rockchip_gem_free_object(struct drm_gem_object *obj);
 int rockchip_gem_dumb_create(struct drm_file *file_priv,
 struct drm_device *dev,
 struct drm_mode_create_dumb *args);
-int rockchip_gem_dumb_map_offset(struct drm_file *file_priv,
-struct drm_device *dev, uint32_t handle,
-uint64_t *offset);
 #endif /* _ROCKCHIP_DRM_GEM_H */
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 10/41] drm/meson: Use .dumb_map_offset and .dumb_destroy defaults

2017-07-23 Thread Noralf Trønnes
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Neil Armstrong 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/meson/meson_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/meson/meson_drv.c 
b/drivers/gpu/drm/meson/meson_drv.c
index 5375e6d..7742c7d 100644
--- a/drivers/gpu/drm/meson/meson_drv.c
+++ b/drivers/gpu/drm/meson/meson_drv.c
@@ -116,8 +116,6 @@ static struct drm_driver meson_driver = {
 
/* GEM Ops */
.dumb_create= drm_gem_cma_dumb_create,
-   .dumb_destroy   = drm_gem_dumb_destroy,
-   .dumb_map_offset= drm_gem_cma_dumb_map_offset,
.gem_free_object_unlocked = drm_gem_cma_free_object,
.gem_vm_ops = _gem_cma_vm_ops,
 
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 34/41] drm/msm: Use the drm_driver.dumb_destroy default

2017-07-23 Thread Noralf Trønnes
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Rob Clark 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/msm/msm_drv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index f49f6ac..b0129e7 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -832,7 +832,6 @@ static struct drm_driver msm_driver = {
.gem_vm_ops = _ops,
.dumb_create= msm_gem_dumb_create,
.dumb_map_offset= msm_gem_dumb_map_offset,
-   .dumb_destroy   = drm_gem_dumb_destroy,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_export   = drm_gem_prime_export,
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 21/41] drm/tinydrm: Use .dumb_map_offset and .dumb_destroy defaults

2017-07-23 Thread Noralf Trønnes
tinydrm can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Signed-off-by: Noralf Trønnes 
---
 include/drm/tinydrm/tinydrm.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/include/drm/tinydrm/tinydrm.h b/include/drm/tinydrm/tinydrm.h
index 00b800d..4774fe3 100644
--- a/include/drm/tinydrm/tinydrm.h
+++ b/include/drm/tinydrm/tinydrm.h
@@ -56,9 +56,7 @@ pipe_to_tinydrm(struct drm_simple_display_pipe *pipe)
.gem_prime_vmap = drm_gem_cma_prime_vmap, \
.gem_prime_vunmap   = drm_gem_cma_prime_vunmap, \
.gem_prime_mmap = drm_gem_cma_prime_mmap, \
-   .dumb_create= drm_gem_cma_dumb_create, \
-   .dumb_map_offset= drm_gem_cma_dumb_map_offset, \
-   .dumb_destroy   = drm_gem_dumb_destroy
+   .dumb_create= drm_gem_cma_dumb_create
 
 /**
  * TINYDRM_MODE - tinydrm display mode
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 28/41] drm/qxl: Use the drm_driver.dumb_destroy default

2017-07-23 Thread Noralf Trønnes
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Dave Airlie 
Cc: Gerd Hoffmann 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/qxl/qxl_drv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c
index 403e135..2445e75 100644
--- a/drivers/gpu/drm/qxl/qxl_drv.c
+++ b/drivers/gpu/drm/qxl/qxl_drv.c
@@ -263,7 +263,6 @@ static struct drm_driver qxl_driver = {
 
.dumb_create = qxl_mode_dumb_create,
.dumb_map_offset = qxl_mode_dumb_mmap,
-   .dumb_destroy = drm_gem_dumb_destroy,
 #if defined(CONFIG_DEBUG_FS)
.debugfs_init = qxl_debugfs_init,
 #endif
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 18/41] drm/tilcdc: Use .dumb_map_offset and .dumb_destroy defaults

2017-07-23 Thread Noralf Trønnes
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Jyri Sarha 
Cc: Tomi Valkeinen 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/tilcdc/tilcdc_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c 
b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 049d2f5..b0d70f9 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -542,8 +542,6 @@ static struct drm_driver tilcdc_driver = {
.gem_free_object_unlocked = drm_gem_cma_free_object,
.gem_vm_ops = _gem_cma_vm_ops,
.dumb_create= drm_gem_cma_dumb_create,
-   .dumb_map_offset= drm_gem_cma_dumb_map_offset,
-   .dumb_destroy   = drm_gem_dumb_destroy,
 
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 23/41] drm/gma500: Use .dumb_map_offset and .dumb_destroy defaults

2017-07-23 Thread Noralf Trønnes
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Patrik Jakobsson 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/gma500/gem.c | 30 --
 drivers/gpu/drm/gma500/psb_drv.c |  2 --
 drivers/gpu/drm/gma500/psb_drv.h |  2 --
 3 files changed, 34 deletions(-)

diff --git a/drivers/gpu/drm/gma500/gem.c b/drivers/gpu/drm/gma500/gem.c
index 7da061a..1312397 100644
--- a/drivers/gpu/drm/gma500/gem.c
+++ b/drivers/gpu/drm/gma500/gem.c
@@ -48,36 +48,6 @@ int psb_gem_get_aperture(struct drm_device *dev, void *data,
 }
 
 /**
- * psb_gem_dumb_map_gtt-   buffer mapping for dumb interface
- * @file: our drm client file
- * @dev: drm device
- * @handle: GEM handle to the object (from dumb_create)
- *
- * Do the necessary setup to allow the mapping of the frame buffer
- * into user memory. We don't have to do much here at the moment.
- */
-int psb_gem_dumb_map_gtt(struct drm_file *file, struct drm_device *dev,
-uint32_t handle, uint64_t *offset)
-{
-   int ret = 0;
-   struct drm_gem_object *obj;
-
-   /* GEM does all our handle to object mapping */
-   obj = drm_gem_object_lookup(file, handle);
-   if (obj == NULL)
-   return -ENOENT;
-
-   /* Make it mmapable */
-   ret = drm_gem_create_mmap_offset(obj);
-   if (ret)
-   goto out;
-   *offset = drm_vma_node_offset_addr(>vma_node);
-out:
-   drm_gem_object_unreference_unlocked(obj);
-   return ret;
-}
-
-/**
  * psb_gem_create  -   create a mappable object
  * @file: the DRM file of the client
  * @dev: our device
diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
index 747c06b..37a3be7 100644
--- a/drivers/gpu/drm/gma500/psb_drv.c
+++ b/drivers/gpu/drm/gma500/psb_drv.c
@@ -494,8 +494,6 @@ static struct drm_driver driver = {
.gem_vm_ops = _gem_vm_ops,
 
.dumb_create = psb_gem_dumb_create,
-   .dumb_map_offset = psb_gem_dumb_map_gtt,
-   .dumb_destroy = drm_gem_dumb_destroy,
.ioctls = psb_ioctls,
.fops = _gem_fops,
.name = DRIVER_NAME,
diff --git a/drivers/gpu/drm/gma500/psb_drv.h b/drivers/gpu/drm/gma500/psb_drv.h
index 8366708..821497d 100644
--- a/drivers/gpu/drm/gma500/psb_drv.h
+++ b/drivers/gpu/drm/gma500/psb_drv.h
@@ -750,8 +750,6 @@ extern int psb_gem_get_aperture(struct drm_device *dev, 
void *data,
struct drm_file *file);
 extern int psb_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
struct drm_mode_create_dumb *args);
-extern int psb_gem_dumb_map_gtt(struct drm_file *file, struct drm_device *dev,
-   uint32_t handle, uint64_t *offset);
 extern int psb_gem_fault(struct vm_fault *vmf);
 
 /* psb_device.c */
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 39/41] drm/bochs: Use the drm_driver.dumb_destroy default

2017-07-23 Thread Noralf Trønnes
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Gerd Hoffmann 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/bochs/bochs_drv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/bochs/bochs_drv.c 
b/drivers/gpu/drm/bochs/bochs_drv.c
index a1d2884..7b203184 100644
--- a/drivers/gpu/drm/bochs/bochs_drv.c
+++ b/drivers/gpu/drm/bochs/bochs_drv.c
@@ -93,7 +93,6 @@ static struct drm_driver bochs_driver = {
.gem_free_object_unlocked = bochs_gem_free_object,
.dumb_create= bochs_dumb_create,
.dumb_map_offset= bochs_dumb_mmap_offset,
-   .dumb_destroy   = drm_gem_dumb_destroy,
 };
 
 /* -- */
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 22/41] drm/mediatek: Use .dumb_map_offset and .dumb_destroy defaults

2017-07-23 Thread Noralf Trønnes
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: CK Hu 
Cc: Philipp Zabel 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/mediatek/mtk_drm_drv.c |  2 --
 drivers/gpu/drm/mediatek/mtk_drm_gem.c | 25 -
 drivers/gpu/drm/mediatek/mtk_drm_gem.h |  3 ---
 3 files changed, 30 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c 
b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
index f0cb276..a2ca90f 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
@@ -293,8 +293,6 @@ static struct drm_driver mtk_drm_driver = {
.gem_free_object_unlocked = mtk_drm_gem_free_object,
.gem_vm_ops = _gem_cma_vm_ops,
.dumb_create = mtk_drm_gem_dumb_create,
-   .dumb_map_offset = mtk_drm_gem_dumb_map_offset,
-   .dumb_destroy = drm_gem_dumb_destroy,
 
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.c 
b/drivers/gpu/drm/mediatek/mtk_drm_gem.c
index 7abc550..8ec963f 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_gem.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.c
@@ -131,31 +131,6 @@ int mtk_drm_gem_dumb_create(struct drm_file *file_priv, 
struct drm_device *dev,
return ret;
 }
 
-int mtk_drm_gem_dumb_map_offset(struct drm_file *file_priv,
-   struct drm_device *dev, uint32_t handle,
-   uint64_t *offset)
-{
-   struct drm_gem_object *obj;
-   int ret;
-
-   obj = drm_gem_object_lookup(file_priv, handle);
-   if (!obj) {
-   DRM_ERROR("failed to lookup gem object.\n");
-   return -EINVAL;
-   }
-
-   ret = drm_gem_create_mmap_offset(obj);
-   if (ret)
-   goto out;
-
-   *offset = drm_vma_node_offset_addr(>vma_node);
-   DRM_DEBUG_KMS("offset = 0x%llx\n", *offset);
-
-out:
-   drm_gem_object_unreference_unlocked(obj);
-   return ret;
-}
-
 static int mtk_drm_gem_object_mmap(struct drm_gem_object *obj,
   struct vm_area_struct *vma)
 
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.h 
b/drivers/gpu/drm/mediatek/mtk_drm_gem.h
index 2752718..534639b 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_gem.h
+++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.h
@@ -46,9 +46,6 @@ struct mtk_drm_gem_obj *mtk_drm_gem_create(struct drm_device 
*dev, size_t size,
   bool alloc_kmap);
 int mtk_drm_gem_dumb_create(struct drm_file *file_priv, struct drm_device *dev,
struct drm_mode_create_dumb *args);
-int mtk_drm_gem_dumb_map_offset(struct drm_file *file_priv,
-   struct drm_device *dev, uint32_t handle,
-   uint64_t *offset);
 int mtk_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma);
 int mtk_drm_gem_mmap_buf(struct drm_gem_object *obj,
 struct vm_area_struct *vma);
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 25/41] drm/tegra: Use .dumb_map_offset and .dumb_destroy defaults

2017-07-23 Thread Noralf Trønnes
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Thierry Reding 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/tegra/drm.c |  2 --
 drivers/gpu/drm/tegra/gem.c | 21 -
 drivers/gpu/drm/tegra/gem.h |  2 --
 3 files changed, 25 deletions(-)

diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index 3ba659a..224ce1d 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -1077,8 +1077,6 @@ static struct drm_driver tegra_drm_driver = {
.gem_prime_import = tegra_gem_prime_import,
 
.dumb_create = tegra_bo_dumb_create,
-   .dumb_map_offset = tegra_bo_dumb_map_offset,
-   .dumb_destroy = drm_gem_dumb_destroy,
 
.ioctls = tegra_drm_ioctls,
.num_ioctls = ARRAY_SIZE(tegra_drm_ioctls),
diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
index 7a39a35..c6079af 100644
--- a/drivers/gpu/drm/tegra/gem.c
+++ b/drivers/gpu/drm/tegra/gem.c
@@ -423,27 +423,6 @@ int tegra_bo_dumb_create(struct drm_file *file, struct 
drm_device *drm,
return 0;
 }
 
-int tegra_bo_dumb_map_offset(struct drm_file *file, struct drm_device *drm,
-u32 handle, u64 *offset)
-{
-   struct drm_gem_object *gem;
-   struct tegra_bo *bo;
-
-   gem = drm_gem_object_lookup(file, handle);
-   if (!gem) {
-   dev_err(drm->dev, "failed to lookup GEM object\n");
-   return -EINVAL;
-   }
-
-   bo = to_tegra_bo(gem);
-
-   *offset = drm_vma_node_offset_addr(>gem.vma_node);
-
-   drm_gem_object_unreference_unlocked(gem);
-
-   return 0;
-}
-
 static int tegra_bo_fault(struct vm_fault *vmf)
 {
struct vm_area_struct *vma = vmf->vma;
diff --git a/drivers/gpu/drm/tegra/gem.h b/drivers/gpu/drm/tegra/gem.h
index 8b32a6f..8eb9fd2 100644
--- a/drivers/gpu/drm/tegra/gem.h
+++ b/drivers/gpu/drm/tegra/gem.h
@@ -67,8 +67,6 @@ struct tegra_bo *tegra_bo_create_with_handle(struct drm_file 
*file,
 void tegra_bo_free_object(struct drm_gem_object *gem);
 int tegra_bo_dumb_create(struct drm_file *file, struct drm_device *drm,
 struct drm_mode_create_dumb *args);
-int tegra_bo_dumb_map_offset(struct drm_file *file, struct drm_device *drm,
-u32 handle, u64 *offset);
 
 int tegra_drm_mmap(struct file *file, struct vm_area_struct *vma);
 
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 26/41] drm/cirrus: Use the drm_driver.dumb_destroy default

2017-07-23 Thread Noralf Trønnes
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Dave Airlie 
Cc: Gerd Hoffmann 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/cirrus/cirrus_drv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.c 
b/drivers/gpu/drm/cirrus/cirrus_drv.c
index 910c300..69c4e35 100644
--- a/drivers/gpu/drm/cirrus/cirrus_drv.c
+++ b/drivers/gpu/drm/cirrus/cirrus_drv.c
@@ -142,7 +142,6 @@ static struct drm_driver driver = {
.gem_free_object_unlocked = cirrus_gem_free_object,
.dumb_create = cirrus_dumb_create,
.dumb_map_offset = cirrus_dumb_mmap_offset,
-   .dumb_destroy = drm_gem_dumb_destroy,
 };
 
 static const struct dev_pm_ops cirrus_pm_ops = {
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 35/41] drm/exynos: Use the drm_driver.dumb_destroy default

2017-07-23 Thread Noralf Trønnes
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Joonyoung Shim 
Cc: Seung-Woo Kim 
Cc: Kyungmin Park 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/exynos/exynos_drm_drv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c 
b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index cab9e12..be91b8e 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -146,7 +146,6 @@ static struct drm_driver exynos_drm_driver = {
.gem_vm_ops = _drm_gem_vm_ops,
.dumb_create= exynos_drm_gem_dumb_create,
.dumb_map_offset= exynos_drm_gem_dumb_map_offset,
-   .dumb_destroy   = drm_gem_dumb_destroy,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_export   = drm_gem_prime_export,
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 37/41] drm/mgag200: Use the drm_driver.dumb_destroy default

2017-07-23 Thread Noralf Trønnes
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Dave Airlie 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/mgag200/mgag200_drv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c 
b/drivers/gpu/drm/mgag200/mgag200_drv.c
index 4189160..74cdde2 100644
--- a/drivers/gpu/drm/mgag200/mgag200_drv.c
+++ b/drivers/gpu/drm/mgag200/mgag200_drv.c
@@ -102,7 +102,6 @@ static struct drm_driver driver = {
.gem_free_object_unlocked = mgag200_gem_free_object,
.dumb_create = mgag200_dumb_create,
.dumb_map_offset = mgag200_dumb_mmap_offset,
-   .dumb_destroy = drm_gem_dumb_destroy,
 };
 
 static struct pci_driver mgag200_pci_driver = {
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 38/41] drm/radeon: Use the drm_driver.dumb_destroy default

2017-07-23 Thread Noralf Trønnes
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Alex Deucher 
Cc: Christian König 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/radeon/radeon_drv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_drv.c 
b/drivers/gpu/drm/radeon/radeon_drv.c
index b401f16..f4becad 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -583,7 +583,6 @@ static struct drm_driver kms_driver = {
.gem_close_object = radeon_gem_object_close,
.dumb_create = radeon_mode_dumb_create,
.dumb_map_offset = radeon_mode_dumb_mmap,
-   .dumb_destroy = drm_gem_dumb_destroy,
.fops = _driver_kms_fops,
 
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 30/41] drm/omapdrm: Use the drm_driver.dumb_destroy default

2017-07-23 Thread Noralf Trønnes
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Tomi Valkeinen 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/omapdrm/omap_drv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c 
b/drivers/gpu/drm/omapdrm/omap_drv.c
index 022029e..ce3341d 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -517,7 +517,6 @@ static struct drm_driver omap_drm_driver = {
.gem_vm_ops = _gem_vm_ops,
.dumb_create = omap_gem_dumb_create,
.dumb_map_offset = omap_gem_dumb_map_offset,
-   .dumb_destroy = drm_gem_dumb_destroy,
.ioctls = ioctls,
.num_ioctls = DRM_OMAP_NUM_IOCTLS,
.fops = _fops,
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 36/41] drm/hisilicon: hibmc: Use the drm_driver.dumb_destroy default

2017-07-23 Thread Noralf Trønnes
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Chen Feng 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c 
b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
index 4d018ca..d4f6f1f 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
@@ -67,7 +67,6 @@ static struct drm_driver hibmc_driver = {
.gem_free_object_unlocked = hibmc_gem_free_object,
.dumb_create= hibmc_dumb_create,
.dumb_map_offset= hibmc_dumb_mmap_offset,
-   .dumb_destroy   = drm_gem_dumb_destroy,
.irq_handler= hibmc_drm_interrupt,
 };
 
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 20/41] drm/zte: Use .dumb_map_offset and .dumb_destroy defaults

2017-07-23 Thread Noralf Trønnes
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Shawn Guo 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/zte/zx_drm_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/zte/zx_drm_drv.c b/drivers/gpu/drm/zte/zx_drm_drv.c
index c983cdf..4524482 100644
--- a/drivers/gpu/drm/zte/zx_drm_drv.c
+++ b/drivers/gpu/drm/zte/zx_drm_drv.c
@@ -62,8 +62,6 @@ static struct drm_driver zx_drm_driver = {
.gem_free_object_unlocked = drm_gem_cma_free_object,
.gem_vm_ops = _gem_cma_vm_ops,
.dumb_create = drm_gem_cma_dumb_create,
-   .dumb_map_offset = drm_gem_cma_dumb_map_offset,
-   .dumb_destroy = drm_gem_dumb_destroy,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_export = drm_gem_prime_export,
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 33/41] drm/i915: Use the drm_driver.dumb_destroy default

2017-07-23 Thread Noralf Trønnes
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Daniel Vetter 
Cc: Jani Nikula 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/i915/i915_drv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index d310d82..4c96a72 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -2755,7 +2755,6 @@ static struct drm_driver driver = {
 
.dumb_create = i915_gem_dumb_create,
.dumb_map_offset = i915_gem_mmap_gtt,
-   .dumb_destroy = drm_gem_dumb_destroy,
.ioctls = i915_ioctls,
.num_ioctls = ARRAY_SIZE(i915_ioctls),
.fops = _driver_fops,
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 19/41] drm/vc4: Use .dumb_map_offset and .dumb_destroy defaults

2017-07-23 Thread Noralf Trønnes
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Eric Anholt 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/vc4/vc4_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c
index c6b487c..d0ba20f 100644
--- a/drivers/gpu/drm/vc4/vc4_drv.c
+++ b/drivers/gpu/drm/vc4/vc4_drv.c
@@ -178,8 +178,6 @@ static struct drm_driver vc4_drm_driver = {
.gem_prime_mmap = vc4_prime_mmap,
 
.dumb_create = vc4_dumb_create,
-   .dumb_map_offset = drm_gem_cma_dumb_map_offset,
-   .dumb_destroy = drm_gem_dumb_destroy,
 
.ioctls = vc4_drm_ioctls,
.num_ioctls = ARRAY_SIZE(vc4_drm_ioctls),
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 06/41] drm/atmel-hlcdc: Use .dumb_map_offset and .dumb_destroy defaults

2017-07-23 Thread Noralf Trønnes
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Boris Brezillon 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c 
b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
index 64f54dc..74d66e1 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
@@ -761,8 +761,6 @@ static struct drm_driver atmel_hlcdc_dc_driver = {
.gem_prime_vunmap = drm_gem_cma_prime_vunmap,
.gem_prime_mmap = drm_gem_cma_prime_mmap,
.dumb_create = drm_gem_cma_dumb_create,
-   .dumb_map_offset = drm_gem_cma_dumb_map_offset,
-   .dumb_destroy = drm_gem_dumb_destroy,
.fops = ,
.name = "atmel-hlcdc",
.desc = "Atmel HLCD Controller DRM",
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 03/41] drm/arc: Use .dumb_map_offset and .dumb_destroy defaults

2017-07-23 Thread Noralf Trønnes
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Alexey Brodkin 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/arc/arcpgu_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
index 3e43a5d..415b7da 100644
--- a/drivers/gpu/drm/arc/arcpgu_drv.c
+++ b/drivers/gpu/drm/arc/arcpgu_drv.c
@@ -172,8 +172,6 @@ static struct drm_driver arcpgu_drm_driver = {
.patchlevel = 0,
.fops = _drm_ops,
.dumb_create = drm_gem_cma_dumb_create,
-   .dumb_map_offset = drm_gem_cma_dumb_map_offset,
-   .dumb_destroy = drm_gem_dumb_destroy,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_free_object_unlocked = drm_gem_cma_free_object,
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 11/41] drm/mxsfb: Use .dumb_map_offset and .dumb_destroy defaults

2017-07-23 Thread Noralf Trønnes
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Marek Vasut 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/mxsfb/mxsfb_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c 
b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
index a34f41c..622d170 100644
--- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
+++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
@@ -337,8 +337,6 @@ static struct drm_driver mxsfb_driver = {
.gem_free_object_unlocked = drm_gem_cma_free_object,
.gem_vm_ops = _gem_cma_vm_ops,
.dumb_create= drm_gem_cma_dumb_create,
-   .dumb_map_offset= drm_gem_cma_dumb_map_offset,
-   .dumb_destroy   = drm_gem_dumb_destroy,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_export   = drm_gem_prime_export,
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 05/41] drm/arm: mali-dp: Use .dumb_map_offset and .dumb_destroy defaults

2017-07-23 Thread Noralf Trønnes
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Liviu Dudau 
Cc: Brian Starkey 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/arm/malidp_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c
index a6a05a7..1a57cc2 100644
--- a/drivers/gpu/drm/arm/malidp_drv.c
+++ b/drivers/gpu/drm/arm/malidp_drv.c
@@ -331,8 +331,6 @@ static struct drm_driver malidp_driver = {
.gem_free_object_unlocked = drm_gem_cma_free_object,
.gem_vm_ops = _gem_cma_vm_ops,
.dumb_create = drm_gem_cma_dumb_create,
-   .dumb_map_offset = drm_gem_cma_dumb_map_offset,
-   .dumb_destroy = drm_gem_dumb_destroy,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_export = drm_gem_prime_export,
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 00/41] drm/dumb-buffers: Add defaults for .dumb_map_offset and .dumb_destroy

2017-07-23 Thread Noralf Trønnes
This adds defaults for the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset callbacks as discussed with Daniel.

vmwgfx is the only driver that doesn't use drm_gem_dumb_destroy().

vgem

vgem changes behaviour after this, because it didn't have .dumb_destroy
set, something the docs mandates.

This patchset is part of a process to add a shmem gem library like the
cma library. The common parts between the two goes into core or helpers.

Noralf.


Noralf Trønnes (41):
  drm/gem: Add drm_gem_dumb_map_offset()
  drm/dumb-buffers: Add defaults for .dumb_map_offset and .dumb_destroy
  drm/arc: Use .dumb_map_offset and .dumb_destroy defaults
  drm/arm: hdlcd: Use .dumb_map_offset and .dumb_destroy defaults
  drm/arm: mali-dp: Use .dumb_map_offset and .dumb_destroy defaults
  drm/atmel-hlcdc: Use .dumb_map_offset and .dumb_destroy defaults
  drm/fsl-dcu: Use .dumb_map_offset and .dumb_destroy defaults
  drm/kirin: Use .dumb_map_offset and .dumb_destroy defaults
  drm/imx: Use .dumb_map_offset and .dumb_destroy defaults
  drm/meson: Use .dumb_map_offset and .dumb_destroy defaults
  drm/mxsfb: Use .dumb_map_offset and .dumb_destroy defaults
  drm/pl111: Use .dumb_map_offset and .dumb_destroy defaults
  drm/rcar-du: Use .dumb_map_offset and .dumb_destroy defaults
  drm/shmobile: Use .dumb_map_offset and .dumb_destroy defaults
  drm/sti: Use .dumb_map_offset and .dumb_destroy defaults
  drm/stm: Use .dumb_map_offset and .dumb_destroy defaults
  drm/sun4i: Use .dumb_map_offset and .dumb_destroy defaults
  drm/tilcdc: Use .dumb_map_offset and .dumb_destroy defaults
  drm/vc4: Use .dumb_map_offset and .dumb_destroy defaults
  drm/zte: Use .dumb_map_offset and .dumb_destroy defaults
  drm/tinydrm: Use .dumb_map_offset and .dumb_destroy defaults
  drm/mediatek: Use .dumb_map_offset and .dumb_destroy defaults
  drm/gma500: Use .dumb_map_offset and .dumb_destroy defaults
  drm/rockchip: Use .dumb_map_offset and .dumb_destroy defaults
  drm/tegra: Use .dumb_map_offset and .dumb_destroy defaults
  drm/cirrus: Use the drm_driver.dumb_destroy default
  drm/udl: Use the drm_driver.dumb_destroy default
  drm/qxl: Use the drm_driver.dumb_destroy default
  drm/amdgpu: Use the drm_driver.dumb_destroy default
  drm/omapdrm: Use the drm_driver.dumb_destroy default
  drm/ast: Use the drm_driver.dumb_destroy default
  drm/nouveau: Use the drm_driver.dumb_destroy default
  drm/i915: Use the drm_driver.dumb_destroy default
  drm/msm: Use the drm_driver.dumb_destroy default
  drm/exynos: Use the drm_driver.dumb_destroy default
  drm/hisilicon: hibmc: Use the drm_driver.dumb_destroy default
  drm/mgag200: Use the drm_driver.dumb_destroy default
  drm/radeon: Use the drm_driver.dumb_destroy default
  drm/bochs: Use the drm_driver.dumb_destroy default
  drm/armada: Use the drm_driver.dumb_destroy default
  drm/virtio: Use the drm_driver.dumb_destroy default

 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c |  1 -
 drivers/gpu/drm/arc/arcpgu_drv.c|  2 --
 drivers/gpu/drm/arm/hdlcd_drv.c |  2 --
 drivers/gpu/drm/arm/malidp_drv.c|  2 --
 drivers/gpu/drm/armada/armada_drv.c |  1 -
 drivers/gpu/drm/armada/armada_gem.c |  6 -
 drivers/gpu/drm/armada/armada_gem.h |  2 --
 drivers/gpu/drm/ast/ast_drv.c   |  1 -
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c|  2 --
 drivers/gpu/drm/bochs/bochs_drv.c   |  1 -
 drivers/gpu/drm/cirrus/cirrus_drv.c |  1 -
 drivers/gpu/drm/drm_dumb_buffers.c  | 26 --
 drivers/gpu/drm/drm_gem.c   | 35 +
 drivers/gpu/drm/exynos/exynos_drm_drv.c |  1 -
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c   |  2 --
 drivers/gpu/drm/gma500/gem.c| 30 -
 drivers/gpu/drm/gma500/psb_drv.c|  2 --
 drivers/gpu/drm/gma500/psb_drv.h|  2 --
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c |  1 -
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c |  2 --
 drivers/gpu/drm/i915/i915_drv.c |  1 -
 drivers/gpu/drm/imx/imx-drm-core.c  |  2 --
 drivers/gpu/drm/mediatek/mtk_drm_drv.c  |  2 --
 drivers/gpu/drm/mediatek/mtk_drm_gem.c  | 25 --
 drivers/gpu/drm/mediatek/mtk_drm_gem.h  |  3 ---
 drivers/gpu/drm/meson/meson_drv.c   |  2 --
 drivers/gpu/drm/mgag200/mgag200_drv.c   |  1 -
 drivers/gpu/drm/msm/msm_drv.c   |  1 -
 drivers/gpu/drm/mxsfb/mxsfb_drv.c   |  2 --
 drivers/gpu/drm/nouveau/nouveau_drm.c   |  1 -
 drivers/gpu/drm/omapdrm/omap_drv.c  |  1 -
 drivers/gpu/drm/pl111/pl111_drv.c   |  2 --
 drivers/gpu/drm/qxl/qxl_drv.c   |  1 -
 drivers/gpu/drm/radeon/radeon_drv.c |  1 -
 drivers/gpu/drm/rcar-du/rcar_du_drv.c   |  2 --
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c |  2 --
 

[PATCH 07/41] drm/fsl-dcu: Use .dumb_map_offset and .dumb_destroy defaults

2017-07-23 Thread Noralf Trønnes
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Stefan Agner 
Cc: Alison Wang 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c 
b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
index 5cbde19..58e9e06 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
@@ -176,8 +176,6 @@ static struct drm_driver fsl_dcu_drm_driver = {
.gem_prime_vunmap   = drm_gem_cma_prime_vunmap,
.gem_prime_mmap = drm_gem_cma_prime_mmap,
.dumb_create= drm_gem_cma_dumb_create,
-   .dumb_map_offset= drm_gem_cma_dumb_map_offset,
-   .dumb_destroy   = drm_gem_dumb_destroy,
.fops   = _dcu_drm_fops,
.name   = "fsl-dcu-drm",
.desc   = "Freescale DCU DRM",
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 09/41] drm/imx: Use .dumb_map_offset and .dumb_destroy defaults

2017-07-23 Thread Noralf Trønnes
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Philipp Zabel 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/imx/imx-drm-core.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/imx/imx-drm-core.c 
b/drivers/gpu/drm/imx/imx-drm-core.c
index f5c6212..f91cb72 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -182,8 +182,6 @@ static struct drm_driver imx_drm_driver = {
.gem_free_object_unlocked = drm_gem_cma_free_object,
.gem_vm_ops = _gem_cma_vm_ops,
.dumb_create= drm_gem_cma_dumb_create,
-   .dumb_map_offset= drm_gem_cma_dumb_map_offset,
-   .dumb_destroy   = drm_gem_dumb_destroy,
 
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 02/41] drm/dumb-buffers: Add defaults for .dumb_map_offset and .dumb_destroy

2017-07-23 Thread Noralf Trønnes
Almost everyone did end up using GEM as bo, so this adds defaults
for the drm_driver.dumb_destroy and drm_driver.dumb_map_offset
callbacks.

Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/drm_dumb_buffers.c | 26 ++
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/drm_dumb_buffers.c 
b/drivers/gpu/drm/drm_dumb_buffers.c
index 10307cc..cd68ab4 100644
--- a/drivers/gpu/drm/drm_dumb_buffers.c
+++ b/drivers/gpu/drm/drm_dumb_buffers.c
@@ -24,6 +24,7 @@
  */
 
 #include 
+#include 
 
 #include "drm_crtc_internal.h"
 
@@ -42,9 +43,10 @@
  * create dumb buffers suitable for scanout, which can then be used to create
  * KMS frame buffers.
  *
- * To support dumb objects drivers must implement the _driver.dumb_create,
- * _driver.dumb_destroy and _driver.dumb_map_offset operations. See
- * there for further details.
+ * To support dumb objects drivers must implement the _driver.dumb_create
+ * operation. _driver.dumb_destroy defaults to drm_gem_dumb_destroy() if
+ * not set and _driver.dumb_map_offset operations to
+ * drm_gem_dumb_map_offset(). See the callbacks for further details.
  *
  * Note that dumb objects may not be used for gpu acceleration, as has been
  * attempted on some ARM embedded platforms. Such drivers really must have
@@ -108,11 +110,16 @@ int drm_mode_mmap_dumb_ioctl(struct drm_device *dev,
 {
struct drm_mode_map_dumb *args = data;
 
-   /* call driver ioctl to get mmap offset */
-   if (!dev->driver->dumb_map_offset)
+   if (!dev->driver->dumb_create)
return -ENOSYS;
 
-   return dev->driver->dumb_map_offset(file_priv, dev, args->handle, 
>offset);
+   if (dev->driver->dumb_map_offset)
+   return dev->driver->dumb_map_offset(file_priv, dev,
+   args->handle,
+   >offset);
+   else
+   return drm_gem_dumb_map_offset(file_priv, dev, args->handle,
+  >offset);
 }
 
 int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,
@@ -120,9 +127,12 @@ int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,
 {
struct drm_mode_destroy_dumb *args = data;
 
-   if (!dev->driver->dumb_destroy)
+   if (!dev->driver->dumb_create)
return -ENOSYS;
 
-   return dev->driver->dumb_destroy(file_priv, dev, args->handle);
+   if (dev->driver->dumb_destroy)
+   return dev->driver->dumb_destroy(file_priv, dev, args->handle);
+   else
+   return drm_gem_dumb_destroy(file_priv, dev, args->handle);
 }
 
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 01/41] drm/gem: Add drm_gem_dumb_map_offset()

2017-07-23 Thread Noralf Trønnes
Add a common drm_driver.dumb_map_offset function for GEM backed drivers.

Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/drm_gem.c | 35 +++
 include/drm/drm_gem.h |  2 ++
 2 files changed, 37 insertions(+)

diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index 5df028a..a8d396b 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -311,6 +311,41 @@ drm_gem_handle_delete(struct drm_file *filp, u32 handle)
 EXPORT_SYMBOL(drm_gem_handle_delete);
 
 /**
+ * drm_gem_dumb_map_offset - return the fake mmap offset for a gem object
+ * @file: drm file-private structure containing the gem object
+ * @dev: corresponding drm_device
+ * @handle: gem object handle
+ * @offset: return location for the fake mmap offset
+ *
+ * This implements the _driver.dumb_map_offset kms driver callback for
+ * drivers which use gem to manage their backing storage.
+ *
+ * Returns:
+ * 0 on success or a negative error code on failure.
+ */
+int drm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
+   u32 handle, u64 *offset)
+{
+   struct drm_gem_object *obj;
+   int ret;
+
+   obj = drm_gem_object_lookup(file, handle);
+   if (!obj)
+   return -ENOENT;
+
+   ret = drm_gem_create_mmap_offset(obj);
+   if (ret)
+   goto out;
+
+   *offset = drm_vma_node_offset_addr(>vma_node);
+out:
+   drm_gem_object_put_unlocked(obj);
+
+   return ret;
+}
+EXPORT_SYMBOL_GPL(drm_gem_dumb_map_offset);
+
+/**
  * drm_gem_dumb_destroy - dumb fb callback helper for gem based drivers
  * @file: drm file-private structure to remove the dumb handle from
  * @dev: corresponding drm_device
diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h
index 4a9d231..9c55c2a 100644
--- a/include/drm/drm_gem.h
+++ b/include/drm/drm_gem.h
@@ -302,6 +302,8 @@ void drm_gem_put_pages(struct drm_gem_object *obj, struct 
page **pages,
bool dirty, bool accessed);
 
 struct drm_gem_object *drm_gem_object_lookup(struct drm_file *filp, u32 
handle);
+int drm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
+   u32 handle, u64 *offset);
 int drm_gem_dumb_destroy(struct drm_file *file,
 struct drm_device *dev,
 uint32_t handle);
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 04/41] drm/arm: hdlcd: Use .dumb_map_offset and .dumb_destroy defaults

2017-07-23 Thread Noralf Trønnes
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Liviu Dudau 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/arm/hdlcd_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index 90bd97b..f9bda7b 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -253,8 +253,6 @@ static struct drm_driver hdlcd_driver = {
.gem_free_object_unlocked = drm_gem_cma_free_object,
.gem_vm_ops = _gem_cma_vm_ops,
.dumb_create = drm_gem_cma_dumb_create,
-   .dumb_map_offset = drm_gem_cma_dumb_map_offset,
-   .dumb_destroy = drm_gem_dumb_destroy,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_export = drm_gem_prime_export,
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 08/41] drm/kirin: Use .dumb_map_offset and .dumb_destroy defaults

2017-07-23 Thread Noralf Trønnes
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Xinliang Liu 
Cc: Rongrong Zou 
Cc: Xinwei Kong 
Cc: Chen Feng 
Signed-off-by: Noralf Trønnes 
---
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c 
b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
index 1178341..6ecc401 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
@@ -162,8 +162,6 @@ static struct drm_driver kirin_drm_driver = {
.gem_free_object_unlocked = drm_gem_cma_free_object,
.gem_vm_ops = _gem_cma_vm_ops,
.dumb_create= kirin_gem_cma_dumb_create,
-   .dumb_map_offset= drm_gem_cma_dumb_map_offset,
-   .dumb_destroy   = drm_gem_dumb_destroy,
 
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 101877] R9 390 with multiple monitors always using highest memory clock

2017-07-23 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101877

--- Comment #4 from his...@siduge.v0yd.nl ---
Yeah, both my monitors are the same model so this is probably the case. If
there's no way to enable changing the mclk, can I set it to a lower default
value without disabling dpm completely?

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 101877] R9 390 with multiple monitors always using highest memory clock

2017-07-23 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101877

--- Comment #3 from Alex Deucher  ---
AFAIK, the windows driver forces the mclk high as well when multiple displays
are attached.  The only possible exception would be if multiple displays had
the exact same timing and the vblank periods could be aligned.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 101877] R9 390 with multiple monitors always using highest memory clock

2017-07-23 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101877

--- Comment #2 from his...@siduge.v0yd.nl ---
So does the windows driver detect the timing of the displays and keep the mclk
low if it's in sync?

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 101877] R9 390 with multiple monitors always using highest memory clock

2017-07-23 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101877

Alex Deucher  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |NOTABUG

--- Comment #1 from Alex Deucher  ---
mclk changes have to be synced to the vertical blanking period of the displays.
 If the displays have different timings, it's not possible to change the mclk
without causing display flickering.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 101881] [regression] 32bit steam games segfault when launched with DRI_PRIME=1

2017-07-23 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101881

--- Comment #3 from Mike Lothian  ---
I've switched on debugging and the issue has gone away, will check to see if
this is been fixed upstream, or if having debugging sidesteps the issue

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 101881] [regression] 32bit steam games segfault when launched with DRI_PRIME=1

2017-07-23 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101881

--- Comment #2 from Mike Lothian  ---
Sorry Civ 6 works fine

Interestingly the Talos Principle works fine in 64bit for OpenGL and Vulkan but
fails to start in 32bit for either of them


Under Vulkan:


WARNING: radv is not a conformant vulkan implementation, testing use only.
mesa: for the -simplifycfg-sink-common option: may only occur zero or one
times!
WRN:  CPU Power saving is enabled and performance governor is not used.
INF:  Encoded user ID = 39aefb47:1ca480c0
INF:  
INF:  * Desktop settings...
INF:  Color depth: 32-bit
INF:  Desktop resolution: 3840 x 2160
INF:  [Vulkan] Detected devices:
INF:#0 (0x0BAD2488): Intel(R) HD Graphics 530 (Skylake GT2) (integrated)
INF:#1 (0x0BB6B258): AMD RADV TONGA (discrete)
INF:  Using device #1 (0x0BB6B258)...
INF:  Crash! (Segmentation fault)
DBG:  
DBG:  //=
DBG:  Report generated at: unsupported unsupported
DBG:  Version: $Version: Talos_PC_distro; Talos_Executables-Linux-Final; 301136
2017-04-18 15:11:57 @builderl01; Linux-x86-Static-Final-Default$
DBG:  Build type: Linux-x86-Static-Final-Default
DBG:  Dump type: Crash
DBG:  
DBG:  Received signal 11 (Segmentation fault).
DBG:  
DBG:  Dumping registers:
DBG:  EAX:00FF
DBG:  EBX:00FF
DBG:  ECX:0020
DBG:  EDX:FF943D14
DBG:  ESI:FF00
DBG:  EDI:
DBG:  CS:EIP:0023:EE369077
DBG:  SS:ESP:002B:FF943870  EBP:FF943938
DBG:  
DBG:  Dumping stack back trace:
DBG:  EE369077 0001 $adr:
"/usr/lib/llvm/5/lib32/../lib32/libLLVMInstCombine.so.6" 0001:000C7077
DBG:  EE369077 0001 $adr:
"/usr/lib/llvm/5/lib32/../lib32/libLLVMInstCombine.so.6" 0001:000C7077
DBG:  EE36B14F 0001 $adr:
"/usr/lib/llvm/5/lib32/../lib32/libLLVMInstCombine.so.6" 0001:000C914F
DBG:  EE370BB0 0001 $adr:
"/usr/lib/llvm/5/lib32/../lib32/libLLVMInstCombine.so.6" 0001:000CEBB0
DBG:  EE36D38D 0001 $adr:
"/usr/lib/llvm/5/lib32/../lib32/libLLVMInstCombine.so.6" 0001:000CB38D
DBG:  EE37012B 0001 $adr:
"/usr/lib/llvm/5/lib32/../lib32/libLLVMInstCombine.so.6" 0001:000CE12B
DBG:  EE361390 0001 $adr:
"/usr/lib/llvm/5/lib32/../lib32/libLLVMInstCombine.so.6" 0001:000BF390
DBG:  EE3621FC 0001 $adr:
"/usr/lib/llvm/5/lib32/../lib32/libLLVMInstCombine.so.6" 0001:000C01FC
DBG:  EE2C81B7 0001 $adr:
"/usr/lib/llvm/5/lib32/../lib32/libLLVMInstCombine.so.6" 0001:000261B7
DBG:  EE2C97A3 0001 $adr:
"/usr/lib/llvm/5/lib32/../lib32/libLLVMInstCombine.so.6" 0001:000277A3
DBG:  EE2C9AD8 0001 $adr:
"/usr/lib/llvm/5/lib32/../lib32/libLLVMInstCombine.so.6" 0001:00027AD8
DBG:  EF2F96F9 0001 $adr: "/usr/lib/llvm/5/lib32/libLLVMCore.so.6"
0001:001626F9
DBG:  EF2F9830 0001 $adr: "/usr/lib/llvm/5/lib32/libLLVMCore.so.6"
0001:00162830
DBG:  EF2F9B2F 0001 $adr: "/usr/lib/llvm/5/lib32/libLLVMCore.so.6"
0001:00162B2F
DBG:  EF267AEC 0001 $adr: "/usr/lib/llvm/5/lib32/libLLVMCore.so.6"
0001:000D0AEC
DBG:  E7EA94A0 0001 $adr: "/usr/lib32/libvulkan_radeon.so" 0001:000724A0
DBG:  E7EB5220 0001 $adr: "/usr/lib32/libvulkan_radeon.so" 0001:0007E220
DBG:  E7EB6344 0001 $adr: "/usr/lib32/libvulkan_radeon.so" 0001:0007F344
DBG:  E7E8123B 0001 $adr: "/usr/lib32/libvulkan_radeon.so" 0001:0004A23B
DBG:  E7E8199F 0001 $adr: "/usr/lib32/libvulkan_radeon.so" 0001:0004A99F
DBG:  E7E8267B 0001 $adr: "/usr/lib32/libvulkan_radeon.so" 0001:0004B67B
DBG:  E7E83FC0 0001 $adr: "/usr/lib32/libvulkan_radeon.so" 0001:0004CFC0
DBG:  E7E752AC 0001 $adr: "/usr/lib32/libvulkan_radeon.so" 0001:0003E2AC
DBG:  E7E77C5A 0001 $adr: "/usr/lib32/libvulkan_radeon.so" 0001:00040C5A
DBG:  E7E59C5B 0001 $adr: "/usr/lib32/libvulkan_radeon.so" 0001:00022C5B
DBG:  E7E4EB63 0001 $adr: "/usr/lib32/libvulkan_radeon.so" 0001:00017B63
DBG:  E8A9FF79 0001 $adr: "/usr/lib32/libvulkan.so.1" 0001:CF79
DBG:  E8B08FAE 0001 $adr:
"/home/fireburn/.local/share/Steam/ubuntu12_32/steamoverlayvulkanlayer.so"
0001:4FAE
DBG:  E8AA6B4D 0001 $adr: "/usr/lib32/libvulkan.so.1" 0001:00013B4D
DBG:  E8AA8CD5 0001 $adr: "/usr/lib32/libvulkan.so.1" 0001:00015CD5
DBG:  0978ED83 0001 $adr:
"/home/fireburn/.local/share/Steam/steamapps/common/The Talos
Principle/Bin/Talos" 0001:01746D83
DBG:  09793A63 0001 $adr:
"/home/fireburn/.local/share/Steam/steamapps/common/The Talos
Principle/Bin/Talos" 0001:0174BA63
DBG:  093859B0 0001 $adr:
"/home/fireburn/.local/share/Steam/steamapps/common/The Talos
Principle/Bin/Talos" 0001:0Game removed: AppID 257510 "The Talos Principle",
ProcID 17311 
No cached sticky mapping in ActivateActionSet.Generating new string page
texture 201: 256x256, total string texture memory is 5.42 MB
Generating new string page texture 347: 256x256, total string texture memory is
5.69 MB
Installing breakpad exception handler for appid(steam)/version(1500335472)



Under OpenGL:

Game update: AppID 257510 "The Talos Principle", ProcID 17502, IP 0.0.0.0:0
>>> Adding 

[Bug 101377] Gigabyte R9 380 card fails to load, kernel reports bug

2017-07-23 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101377

--- Comment #5 from m8r-ux3...@safetymail.info ---
Yep, so if Linux 4.8 works for you, just follow my instructions for forcing
Linux 4.9 and newer to use the old firmware file, and I'm sure Linux 4.9 and
newer will work for you as well.

For what it's worth, I can tell you that this issue happened to me after
upgrading my system from a Trinity-based system to a Zen one. With the Trinity
system, using the new firmware file works just fine, but it doesn't with the
Zen system.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel