From ecbbe59bbb1cd2973e031c5b6ba28653d66a17de Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Tue, 13 May 2014 11:36:13 +0200 Subject: drm: Use size_t for blob property sizes size_t is the standard type when dealing with sizes of all kinds. Use it consistently when instantiating DRM blob properties. Signed-off-by: Thierry Reding --- drivers/gpu/drm/drm_crtc.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'drivers/gpu/drm') diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index e79c8d3700d8..d4d783477c99 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -3938,8 +3938,9 @@ done: return ret; } -static struct drm_property_blob *drm_property_create_blob(struct drm_device *dev, int length, - void *data) +static struct drm_property_blob * +drm_property_create_blob(struct drm_device *dev, size_t length, + void *data) { struct drm_property_blob *blob; int ret; @@ -4023,8 +4024,8 @@ int drm_mode_connector_set_path_property(struct drm_connector *connector, char *path) { struct drm_device *dev = connector->dev; - int ret, size; - size = strlen(path) + 1; + size_t size = strlen(path) + 1; + int ret; connector->path_blob_ptr = drm_property_create_blob(connector->dev, size, path); @@ -4053,7 +4054,8 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector, struct edid *edid) { struct drm_device *dev = connector->dev; - int ret, size; + size_t size; + int ret; /* ignore requests to set edid when overridden */ if (connector->override_edid) -- cgit v1.2.3 From 12e6cecd55e541d3e8110f7dfbb6a601e81733ff Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Tue, 13 May 2014 11:38:36 +0200 Subject: drm: Use const data when creating blob properties Creating a blob property will always copy the input data so the data that is passed in can be const. Signed-off-by: Thierry Reding --- drivers/gpu/drm/drm_crtc.c | 6 +++--- drivers/gpu/drm/i915/intel_dp_mst.c | 2 +- include/drm/drm_crtc.h | 4 ++-- include/drm/drm_dp_mst_helper.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'drivers/gpu/drm') diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index d4d783477c99..3ea31bc85263 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -3940,7 +3940,7 @@ done: static struct drm_property_blob * drm_property_create_blob(struct drm_device *dev, size_t length, - void *data) + const void *data) { struct drm_property_blob *blob; int ret; @@ -4021,7 +4021,7 @@ done: } int drm_mode_connector_set_path_property(struct drm_connector *connector, - char *path) + const char *path) { struct drm_device *dev = connector->dev; size_t size = strlen(path) + 1; @@ -4051,7 +4051,7 @@ EXPORT_SYMBOL(drm_mode_connector_set_path_property); * Zero on success, errno on failure. */ int drm_mode_connector_update_edid_property(struct drm_connector *connector, - struct edid *edid) + const struct edid *edid) { struct drm_device *dev = connector->dev; size_t size; diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c index d9a7a7865f66..eb023d6eafb6 100644 --- a/drivers/gpu/drm/i915/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/intel_dp_mst.c @@ -393,7 +393,7 @@ static void intel_connector_remove_from_fbdev(struct intel_connector *connector) #endif } -static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, char *pathprop) +static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, const char *pathprop) { struct intel_dp *intel_dp = container_of(mgr, struct intel_dp, mst_mgr); struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 628369c08503..ce0dd6c2d73d 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -978,9 +978,9 @@ extern void drm_mode_config_reset(struct drm_device *dev); extern void drm_mode_config_cleanup(struct drm_device *dev); extern int drm_mode_connector_set_path_property(struct drm_connector *connector, - char *path); + const char *path); extern int drm_mode_connector_update_edid_property(struct drm_connector *connector, - struct edid *edid); + const struct edid *edid); static inline bool drm_property_type_is(struct drm_property *property, uint32_t type) diff --git a/include/drm/drm_dp_mst_helper.h b/include/drm/drm_dp_mst_helper.h index 338fc1053835..fdcd7f271b66 100644 --- a/include/drm/drm_dp_mst_helper.h +++ b/include/drm/drm_dp_mst_helper.h @@ -371,7 +371,7 @@ struct drm_dp_sideband_msg_tx { struct drm_dp_mst_topology_mgr; struct drm_dp_mst_topology_cbs { /* create a connector for a port */ - struct drm_connector *(*add_connector)(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, char *path); + struct drm_connector *(*add_connector)(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, const char *path); void (*destroy_connector)(struct drm_dp_mst_topology_mgr *mgr, struct drm_connector *connector); void (*hotplug)(struct drm_dp_mst_topology_mgr *mgr); -- cgit v1.2.3 From c6a843256a2523c621eb109770c2868ebc29c508 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Thu, 2 Oct 2014 14:45:55 +0200 Subject: drm/gem: Fix typo in kerneldoc The function being documented is drm_gem_object_handle_free(), not drm_gem_object_free(). Signed-off-by: Thierry Reding --- drivers/gpu/drm/drm_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpu/drm') diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index f6ca51259fa3..973a9b6644d4 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -188,7 +188,7 @@ drm_gem_remove_prime_handles(struct drm_gem_object *obj, struct drm_file *filp) } /** - * drm_gem_object_free - release resources bound to userspace handles + * drm_gem_object_handle_free - release resources bound to userspace handles * @obj: GEM object to clean up. * * Called after the last handle to the object has been closed -- cgit v1.2.3 From 34eab43ed2483e69bc79fd2e3aaf5adfae771907 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Wed, 4 Jun 2014 09:18:29 +0200 Subject: drm/prime: Use unsigned type for number of pages The number of pages can never be negative, so an unsigned type is enough. This also matches the type of the n_pages argument of the sg_alloc_table_from_pages() function. Signed-off-by: Thierry Reding --- drivers/gpu/drm/drm_prime.c | 2 +- include/drm/drmP.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/drm') diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 78ca30808422..e15882fd45a3 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c @@ -669,7 +669,7 @@ int drm_prime_fd_to_handle_ioctl(struct drm_device *dev, void *data, * the driver is responsible for mapping the pages into the * importers address space for use with dma_buf itself. */ -struct sg_table *drm_prime_pages_to_sg(struct page **pages, int nr_pages) +struct sg_table *drm_prime_pages_to_sg(struct page **pages, unsigned int nr_pages) { struct sg_table *sg = NULL; int ret; diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 53ed87698a74..75b259492a8d 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -986,7 +986,7 @@ extern void drm_gem_dmabuf_release(struct dma_buf *dma_buf); extern int drm_prime_sg_to_page_addr_arrays(struct sg_table *sgt, struct page **pages, dma_addr_t *addrs, int max_pages); -extern struct sg_table *drm_prime_pages_to_sg(struct page **pages, int nr_pages); +extern struct sg_table *drm_prime_pages_to_sg(struct page **pages, unsigned int nr_pages); extern void drm_prime_gem_destroy(struct drm_gem_object *obj, struct sg_table *sg); -- cgit v1.2.3 From 2f7633125a1ca8a03b63bf91b5eca60551141ddb Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 13 Oct 2014 12:45:57 +0200 Subject: drm: Make drm_mode_create_tv_properties() signature consistent The prototype and the function implementation differ in their signature. Make them consistent and use an unsigned integer for the number of modes while at it. Signed-off-by: Thierry Reding --- drivers/gpu/drm/drm_crtc.c | 7 ++++--- include/drm/drm_crtc.h | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'drivers/gpu/drm') diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 3ea31bc85263..776ec41b73c9 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -1388,12 +1388,13 @@ EXPORT_SYMBOL(drm_mode_create_dvi_i_properties); * responsible for allocating a list of format names and passing them to * this routine. */ -int drm_mode_create_tv_properties(struct drm_device *dev, int num_modes, +int drm_mode_create_tv_properties(struct drm_device *dev, + unsigned int num_modes, char *modes[]) { struct drm_property *tv_selector; struct drm_property *tv_subconnector; - int i; + unsigned int i; if (dev->mode_config.tv_select_subconnector_property) return 0; @@ -2274,7 +2275,7 @@ static int __setplane_internal(struct drm_plane *plane, { int ret = 0; unsigned int fb_width, fb_height; - int i; + unsigned int i; /* No fb means shut it down */ if (!fb) { diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index ce0dd6c2d73d..48255076d1bd 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -1041,8 +1041,9 @@ extern void drm_property_destroy(struct drm_device *dev, struct drm_property *pr extern int drm_property_add_enum(struct drm_property *property, int index, uint64_t value, const char *name); extern int drm_mode_create_dvi_i_properties(struct drm_device *dev); -extern int drm_mode_create_tv_properties(struct drm_device *dev, int num_formats, - char *formats[]); +extern int drm_mode_create_tv_properties(struct drm_device *dev, + unsigned int num_modes, + char *modes[]); extern int drm_mode_create_scaling_mode_property(struct drm_device *dev); extern int drm_mode_create_aspect_ratio_property(struct drm_device *dev); extern int drm_mode_create_dirty_info_property(struct drm_device *dev); -- cgit v1.2.3 From 8446956ed2e877f8d725d7e3b59cbf35ee1081f0 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Tue, 5 Aug 2014 08:22:48 +0200 Subject: drm/gma500: mdfld: Reuse video/mipi_display.h The GMA500 driver redefines many constants already found in the generic header. Replace uses of the custom defines by the standard ones and get rid of the duplicate defininitions. Acked-by: Alan Cox Signed-off-by: Thierry Reding --- drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c | 75 +++++++++++---------------- drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.h | 12 ----- 2 files changed, 31 insertions(+), 56 deletions(-) (limited to 'drivers/gpu/drm') diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c b/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c index 87885d8c06e8..6b43ae3ffd73 100644 --- a/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c +++ b/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c @@ -25,6 +25,7 @@ */ #include +#include