summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2013-09-02 06:25:27 +0000
committerjsg <jsg@openbsd.org>2013-09-02 06:25:27 +0000
commitd7873f4edcf85f46e449137ca15899117dd9b22e (patch)
tree8d0db994369b344654af4d4fd19059b18b140082
parentUpdate to match VOP_READDIR() changes: no more cookies, but d_off instead. (diff)
downloadwireguard-openbsd-d7873f4edcf85f46e449137ca15899117dd9b22e.tar.xz
wireguard-openbsd-d7873f4edcf85f46e449137ca15899117dd9b22e.zip
add static back to functions that originally had it
reduces the diff to linux
-rw-r--r--sys/dev/pci/drm/drmP.h6
-rw-r--r--sys/dev/pci/drm/drm_crtc.c313
-rw-r--r--sys/dev/pci/drm/drm_crtc_helper.c100
-rw-r--r--sys/dev/pci/drm/drm_dp_helper.c70
-rw-r--r--sys/dev/pci/drm/drm_edid.c237
-rw-r--r--sys/dev/pci/drm/drm_fb_helper.c147
-rw-r--r--sys/dev/pci/drm/drm_irq.c121
-rw-r--r--sys/dev/pci/drm/drm_modes.c66
8 files changed, 338 insertions, 722 deletions
diff --git a/sys/dev/pci/drm/drmP.h b/sys/dev/pci/drm/drmP.h
index b7e48e3c48e..c4d706b7279 100644
--- a/sys/dev/pci/drm/drmP.h
+++ b/sys/dev/pci/drm/drmP.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: drmP.h,v 1.146 2013/08/27 03:06:02 jsg Exp $ */
+/* $OpenBSD: drmP.h,v 1.147 2013/09/02 06:25:27 jsg Exp $ */
/* drmP.h -- Private header for Direct Rendering Manager -*- linux-c -*-
* Created: Mon Jan 4 10:05:05 1999 by faith@precisioninsight.com
*/
@@ -893,6 +893,8 @@ void drm_reclaim_buffers(struct drm_device *, struct drm_file *);
int drm_irq_install(struct drm_device *);
int drm_irq_uninstall(struct drm_device *);
void drm_vblank_cleanup(struct drm_device *);
+u32 drm_get_last_vbltimestamp(struct drm_device *, int ,
+ struct timeval *, unsigned);
int drm_vblank_init(struct drm_device *, int);
u_int32_t drm_vblank_count(struct drm_device *, int);
u_int32_t drm_vblank_count_and_time(struct drm_device *, int, struct timeval *);
@@ -906,6 +908,8 @@ bool drm_handle_vblank(struct drm_device *, int);
void drm_calc_timestamping_constants(struct drm_crtc *);
int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *,
int, int *, struct timeval *, unsigned, struct drm_crtc *);
+bool drm_mode_parse_command_line_for_connector(const char *,
+ struct drm_connector *, struct drm_cmdline_mode *);
struct drm_display_mode *
drm_mode_create_from_cmdline_mode(struct drm_device *,
struct drm_cmdline_mode *);
diff --git a/sys/dev/pci/drm/drm_crtc.c b/sys/dev/pci/drm/drm_crtc.c
index 5178413ceb3..74b81a36414 100644
--- a/sys/dev/pci/drm/drm_crtc.c
+++ b/sys/dev/pci/drm/drm_crtc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_crtc.c,v 1.1 2013/03/18 12:36:51 jsg Exp $ */
+/* $OpenBSD: drm_crtc.c,v 1.2 2013/09/02 06:25:27 jsg Exp $ */
/*
* Copyright (c) 2006-2008 Intel Corporation
* Copyright (c) 2007 Dave Airlie <airlied@linux.ie>
@@ -51,34 +51,7 @@
char *drm_get_connector_status_name(enum drm_connector_status);
int drm_mode_group_init(struct drm_device *, struct drm_mode_group *);
-void drm_crtc_convert_to_umode(struct drm_mode_modeinfo *,
- const struct drm_display_mode *);
-int drm_mode_handle_cmp(struct drm_mode_handle *,
- struct drm_mode_handle *);
-int drm_crtc_convert_umode(struct drm_display_mode *,
- const struct drm_mode_modeinfo *);
-int drm_mode_object_get(struct drm_device *, struct drm_mode_object *,
- uint32_t);
-void drm_mode_object_put(struct drm_device *, struct drm_mode_object *);
-int drm_mode_create_standard_connector_properties(struct drm_device *);
-void drm_mode_attachmode(struct drm_device *, struct drm_connector *,
- struct drm_display_mode *);
-int drm_mode_detachmode(struct drm_device *, struct drm_connector *,
- struct drm_display_mode *);
-struct drm_property_blob *drm_property_create_blob(struct drm_device *,
- int, void *);
-void drm_property_destroy_blob(struct drm_device *,
- struct drm_property_blob *);
-int format_check(const struct drm_mode_fb_cmd2 *);
-int framebuffer_check(const struct drm_mode_fb_cmd2 *);
-bool drm_property_change_is_valid(struct drm_property *, uint64_t);
-int drm_mode_connector_set_obj_prop(struct drm_mode_object *,
- struct drm_property *, uint64_t);
-int drm_mode_crtc_set_obj_prop(struct drm_mode_object *,
- struct drm_property *, uint64_t);
-int drm_mode_plane_set_obj_prop(struct drm_mode_object *,
- struct drm_property *, uint64_t);
-void drm_framebuffer_free(struct drm_framebuffer *);
+int drm_mode_handle_cmp(struct drm_mode_handle *, struct drm_mode_handle *);
SPLAY_PROTOTYPE(drm_mode_tree, drm_mode_handle, entry, drm_mode_handle_cmp);
@@ -250,8 +223,7 @@ char *drm_get_connector_status_name(enum drm_connector_status status)
* New unique (relative to other objects in @dev) integer identifier for the
* object.
*/
-int
-drm_mode_object_get(struct drm_device *dev,
+static int drm_mode_object_get(struct drm_device *dev,
struct drm_mode_object *obj, uint32_t obj_type)
{
struct drm_mode_handle *han;
@@ -287,8 +259,7 @@ again:
*
* Free @id from @dev's unique identifier pool.
*/
-void
-drm_mode_object_put(struct drm_device *dev,
+static void drm_mode_object_put(struct drm_device *dev,
struct drm_mode_object *object)
{
struct drm_mode_handle han;
@@ -300,8 +271,7 @@ drm_mode_object_put(struct drm_device *dev,
rw_exit_write(&dev->mode_config.idr_rwl);
}
-struct drm_mode_object *
-drm_mode_object_find(struct drm_device *dev,
+struct drm_mode_object *drm_mode_object_find(struct drm_device *dev,
uint32_t id, uint32_t type)
{
struct drm_mode_object *obj = NULL;
@@ -338,8 +308,7 @@ EXPORT_SYMBOL(drm_mode_object_find);
* RETURNS:
* Zero on success, error code on failure.
*/
-int
-drm_framebuffer_init(struct drm_device *dev, struct drm_framebuffer *fb,
+int drm_framebuffer_init(struct drm_device *dev, struct drm_framebuffer *fb,
const struct drm_framebuffer_funcs *funcs)
{
int ret;
@@ -359,8 +328,7 @@ drm_framebuffer_init(struct drm_device *dev, struct drm_framebuffer *fb,
}
EXPORT_SYMBOL(drm_framebuffer_init);
-void
-drm_framebuffer_free(struct drm_framebuffer *fb)
+static void drm_framebuffer_free(struct drm_framebuffer *fb)
{
fb->funcs->destroy(fb);
}
@@ -371,8 +339,7 @@ drm_framebuffer_free(struct drm_framebuffer *fb)
* LOCKING:
* Caller must hold mode config lock.
*/
-void
-drm_framebuffer_unreference(struct drm_framebuffer *fb)
+void drm_framebuffer_unreference(struct drm_framebuffer *fb)
{
// struct drm_device *dev = fb->dev;
DRM_DEBUG("FB ID: %d\n", fb->base.id);
@@ -387,8 +354,7 @@ EXPORT_SYMBOL(drm_framebuffer_unreference);
/**
* drm_framebuffer_reference - incr the fb refcnt
*/
-void
-drm_framebuffer_reference(struct drm_framebuffer *fb)
+void drm_framebuffer_reference(struct drm_framebuffer *fb)
{
DRM_DEBUG("FB ID: %d\n", fb->base.id);
fb->refcount++;
@@ -405,8 +371,7 @@ EXPORT_SYMBOL(drm_framebuffer_reference);
* Scans all the CRTCs in @dev's mode_config. If they're using @fb, removes
* it, setting it to NULL.
*/
-void
-drm_framebuffer_cleanup(struct drm_framebuffer *fb)
+void drm_framebuffer_cleanup(struct drm_framebuffer *fb)
{
struct drm_device *dev = fb->dev;
/*
@@ -432,8 +397,7 @@ EXPORT_SYMBOL(drm_framebuffer_cleanup);
* Scans all the CRTCs and planes in @dev's mode_config. If they're
* using @fb, removes it, setting it to NULL.
*/
-void
-drm_framebuffer_remove(struct drm_framebuffer *fb)
+void drm_framebuffer_remove(struct drm_framebuffer *fb)
{
struct drm_device *dev = fb->dev;
struct drm_crtc *crtc;
@@ -486,8 +450,7 @@ EXPORT_SYMBOL(drm_framebuffer_remove);
* RETURNS:
* Zero on success, error code on failure.
*/
-int
-drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
+int drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
const struct drm_crtc_funcs *funcs)
{
int ret;
@@ -524,8 +487,7 @@ EXPORT_SYMBOL(drm_crtc_init);
* Cleanup @crtc. Removes from drm modesetting space
* does NOT free object, caller does that.
*/
-void
-drm_crtc_cleanup(struct drm_crtc *crtc)
+void drm_crtc_cleanup(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
@@ -550,8 +512,7 @@ EXPORT_SYMBOL(drm_crtc_cleanup);
*
* Add @mode to @connector's mode list for later use.
*/
-void
-drm_mode_probed_add(struct drm_connector *connector,
+void drm_mode_probed_add(struct drm_connector *connector,
struct drm_display_mode *mode)
{
list_add(&mode->head, &connector->probed_modes);
@@ -568,8 +529,7 @@ EXPORT_SYMBOL(drm_mode_probed_add);
*
* Remove @mode from @connector's mode list, then free it.
*/
-void
-drm_mode_remove(struct drm_connector *connector,
+void drm_mode_remove(struct drm_connector *connector,
struct drm_display_mode *mode)
{
list_del(&mode->head);
@@ -593,8 +553,7 @@ EXPORT_SYMBOL(drm_mode_remove);
* RETURNS:
* Zero on success, error code on failure.
*/
-int
-drm_connector_init(struct drm_device *dev,
+int drm_connector_init(struct drm_device *dev,
struct drm_connector *connector,
const struct drm_connector_funcs *funcs,
int connector_type)
@@ -646,8 +605,7 @@ EXPORT_SYMBOL(drm_connector_init);
*
* Cleans up the connector but doesn't free the object.
*/
-void
-drm_connector_cleanup(struct drm_connector *connector)
+void drm_connector_cleanup(struct drm_connector *connector)
{
struct drm_device *dev = connector->dev;
struct drm_display_mode *mode, *t;
@@ -669,8 +627,7 @@ drm_connector_cleanup(struct drm_connector *connector)
}
EXPORT_SYMBOL(drm_connector_cleanup);
-void
-drm_connector_unplug_all(struct drm_device *dev)
+void drm_connector_unplug_all(struct drm_device *dev)
{
#ifdef notyet
struct drm_connector *connector;
@@ -682,8 +639,7 @@ drm_connector_unplug_all(struct drm_device *dev)
}
EXPORT_SYMBOL(drm_connector_unplug_all);
-int
-drm_encoder_init(struct drm_device *dev,
+int drm_encoder_init(struct drm_device *dev,
struct drm_encoder *encoder,
const struct drm_encoder_funcs *funcs,
int encoder_type)
@@ -710,8 +666,7 @@ drm_encoder_init(struct drm_device *dev,
}
EXPORT_SYMBOL(drm_encoder_init);
-void
-drm_encoder_cleanup(struct drm_encoder *encoder)
+void drm_encoder_cleanup(struct drm_encoder *encoder)
{
struct drm_device *dev = encoder->dev;
rw_enter_write(&dev->mode_config.rwl);
@@ -722,8 +677,7 @@ drm_encoder_cleanup(struct drm_encoder *encoder)
}
EXPORT_SYMBOL(drm_encoder_cleanup);
-int
-drm_plane_init(struct drm_device *dev, struct drm_plane *plane,
+int drm_plane_init(struct drm_device *dev, struct drm_plane *plane,
unsigned long possible_crtcs,
const struct drm_plane_funcs *funcs,
const uint32_t *formats, uint32_t format_count,
@@ -772,8 +726,7 @@ drm_plane_init(struct drm_device *dev, struct drm_plane *plane,
}
EXPORT_SYMBOL(drm_plane_init);
-void
-drm_plane_cleanup(struct drm_plane *plane)
+void drm_plane_cleanup(struct drm_plane *plane)
{
struct drm_device *dev = plane->dev;
@@ -801,8 +754,7 @@ EXPORT_SYMBOL(drm_plane_cleanup);
* RETURNS:
* Pointer to new mode on success, NULL on error.
*/
-struct drm_display_mode *
-drm_mode_create(struct drm_device *dev)
+struct drm_display_mode *drm_mode_create(struct drm_device *dev)
{
struct drm_display_mode *nmode;
@@ -829,8 +781,7 @@ EXPORT_SYMBOL(drm_mode_create);
*
* Free @mode's unique identifier, then free it.
*/
-void
-drm_mode_destroy(struct drm_device *dev, struct drm_display_mode *mode)
+void drm_mode_destroy(struct drm_device *dev, struct drm_display_mode *mode)
{
if (!mode)
return;
@@ -841,8 +792,7 @@ drm_mode_destroy(struct drm_device *dev, struct drm_display_mode *mode)
}
EXPORT_SYMBOL(drm_mode_destroy);
-int
-drm_mode_create_standard_connector_properties(struct drm_device *dev)
+static int drm_mode_create_standard_connector_properties(struct drm_device *dev)
{
struct drm_property *edid;
struct drm_property *dpms;
@@ -869,8 +819,7 @@ drm_mode_create_standard_connector_properties(struct drm_device *dev)
*
* Called by a driver the first time a DVI-I connector is made.
*/
-int
-drm_mode_create_dvi_i_properties(struct drm_device *dev)
+int drm_mode_create_dvi_i_properties(struct drm_device *dev)
{
struct drm_property *dvi_i_selector;
struct drm_property *dvi_i_subconnector;
@@ -906,8 +855,7 @@ 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, int num_modes,
char *modes[])
{
struct drm_property *tv_selector;
@@ -984,8 +932,7 @@ EXPORT_SYMBOL(drm_mode_create_tv_properties);
* Called by a driver the first time it's needed, must be attached to desired
* connectors.
*/
-int
-drm_mode_create_scaling_mode_property(struct drm_device *dev)
+int drm_mode_create_scaling_mode_property(struct drm_device *dev)
{
struct drm_property *scaling_mode;
@@ -1010,8 +957,7 @@ EXPORT_SYMBOL(drm_mode_create_scaling_mode_property);
* Called by a driver the first time it's needed, must be attached to desired
* connectors.
*/
-int
-drm_mode_create_dithering_property(struct drm_device *dev)
+int drm_mode_create_dithering_property(struct drm_device *dev)
{
struct drm_property *dithering_mode;
@@ -1035,8 +981,7 @@ EXPORT_SYMBOL(drm_mode_create_dithering_property);
* Called by a driver the first time it's needed, must be attached to desired
* connectors.
*/
-int
-drm_mode_create_dirty_info_property(struct drm_device *dev)
+int drm_mode_create_dirty_info_property(struct drm_device *dev)
{
struct drm_property *dirty_info;
@@ -1064,8 +1009,7 @@ EXPORT_SYMBOL(drm_mode_create_dirty_info_property);
* Initialize @dev's mode_config structure, used for tracking the graphics
* configuration of @dev.
*/
-void
-drm_mode_config_init(struct drm_device *dev)
+void drm_mode_config_init(struct drm_device *dev)
{
rw_init(&dev->mode_config.rwl, "mcrwl");
rw_init(&dev->mode_config.idr_rwl, "idrwl");
@@ -1090,8 +1034,7 @@ drm_mode_config_init(struct drm_device *dev)
}
EXPORT_SYMBOL(drm_mode_config_init);
-int
-drm_mode_group_init(struct drm_device *dev, struct drm_mode_group *group)
+int drm_mode_group_init(struct drm_device *dev, struct drm_mode_group *group)
{
uint32_t total_objects = 0;
@@ -1110,8 +1053,7 @@ drm_mode_group_init(struct drm_device *dev, struct drm_mode_group *group)
return 0;
}
-int
-drm_mode_group_init_legacy_group(struct drm_device *dev,
+int drm_mode_group_init_legacy_group(struct drm_device *dev,
struct drm_mode_group *group)
{
struct drm_crtc *crtc;
@@ -1149,8 +1091,7 @@ EXPORT_SYMBOL(drm_mode_group_init_legacy_group);
*
* FIXME: cleanup any dangling user buffer objects too
*/
-void
-drm_mode_config_cleanup(struct drm_device *dev)
+void drm_mode_config_cleanup(struct drm_device *dev)
{
struct drm_connector *connector, *ot;
struct drm_crtc *crtc, *ct;
@@ -1202,8 +1143,7 @@ EXPORT_SYMBOL(drm_mode_config_cleanup);
* Convert a drm_display_mode into a drm_mode_modeinfo structure to return to
* the user.
*/
-void
-drm_crtc_convert_to_umode(struct drm_mode_modeinfo *out,
+static void drm_crtc_convert_to_umode(struct drm_mode_modeinfo *out,
const struct drm_display_mode *in)
{
#ifdef notyet
@@ -1247,8 +1187,7 @@ drm_crtc_convert_to_umode(struct drm_mode_modeinfo *out,
* RETURNS:
* Zero on success, errno on failure.
*/
-int
-drm_crtc_convert_umode(struct drm_display_mode *out,
+static int drm_crtc_convert_umode(struct drm_display_mode *out,
const struct drm_mode_modeinfo *in)
{
if (in->clock > INT_MAX || in->vrefresh > INT_MAX)
@@ -1292,8 +1231,7 @@ drm_crtc_convert_umode(struct drm_display_mode *out,
* RETURNS:
* Zero on success, errno on failure.
*/
-int
-drm_mode_getresources(struct drm_device *dev, void *data,
+int drm_mode_getresources(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
struct drm_mode_card_res *card_res = data;
@@ -1502,8 +1440,7 @@ out:
* RETURNS:
* Zero on success, errno on failure.
*/
-int
-drm_mode_getcrtc(struct drm_device *dev,
+int drm_mode_getcrtc(struct drm_device *dev,
void *data, struct drm_file *file_priv)
{
struct drm_mode_crtc *crtc_resp = data;
@@ -1563,8 +1500,7 @@ out:
* RETURNS:
* Zero on success, errno on failure.
*/
-int
-drm_mode_getconnector(struct drm_device *dev, void *data,
+int drm_mode_getconnector(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
struct drm_mode_get_connector *out_resp = data;
@@ -1694,8 +1630,7 @@ out:
return ret;
}
-int
-drm_mode_getencoder(struct drm_device *dev, void *data,
+int drm_mode_getencoder(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
struct drm_mode_get_encoder *enc_resp = data;
@@ -1740,8 +1675,7 @@ out:
*
* Return an plane count and set of IDs.
*/
-int
-drm_mode_getplane_res(struct drm_device *dev, void *data,
+int drm_mode_getplane_res(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
struct drm_mode_get_plane_res *plane_resp = data;
@@ -1792,8 +1726,7 @@ out:
* Return plane info, including formats supported, gamma size, any
* current fb, etc.
*/
-int
-drm_mode_getplane(struct drm_device *dev, void *data,
+int drm_mode_getplane(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
struct drm_mode_get_plane *plane_resp = data;
@@ -1861,8 +1794,7 @@ out:
* Set plane info, including placement, fb, scaling, and other factors.
* Or pass a NULL fb to disable.
*/
-int
-drm_mode_setplane(struct drm_device *dev, void *data,
+int drm_mode_setplane(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
struct drm_mode_set_plane *plane_req = data;
@@ -1998,8 +1930,7 @@ out:
* RETURNS:
* Zero on success, errno on failure.
*/
-int
-drm_mode_setcrtc(struct drm_device *dev, void *data,
+int drm_mode_setcrtc(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
struct drm_mode_config *config = &dev->mode_config;
@@ -2163,8 +2094,7 @@ out:
return ret;
}
-int
-drm_mode_cursor_ioctl(struct drm_device *dev,
+int drm_mode_cursor_ioctl(struct drm_device *dev,
void *data, struct drm_file *file_priv)
{
struct drm_mode_cursor *req = data;
@@ -2211,8 +2141,7 @@ out:
}
/* Original addfb only supported RGB formats, so figure out which one */
-uint32_t
-drm_mode_legacy_fb_format(uint32_t bpp, uint32_t depth)
+uint32_t drm_mode_legacy_fb_format(uint32_t bpp, uint32_t depth)
{
uint32_t fmt;
@@ -2264,8 +2193,7 @@ EXPORT_SYMBOL(drm_mode_legacy_fb_format);
* RETURNS:
* Zero on success, errno on failure.
*/
-int
-drm_mode_addfb(struct drm_device *dev,
+int drm_mode_addfb(struct drm_device *dev,
void *data, struct drm_file *file_priv)
{
struct drm_mode_fb_cmd *or = data;
@@ -2311,8 +2239,7 @@ out:
return ret;
}
-int
-format_check(const struct drm_mode_fb_cmd2 *r)
+static int format_check(const struct drm_mode_fb_cmd2 *r)
{
uint32_t format = r->pixel_format & ~DRM_FORMAT_BIG_ENDIAN;
@@ -2383,8 +2310,7 @@ format_check(const struct drm_mode_fb_cmd2 *r)
}
}
-int
-framebuffer_check(const struct drm_mode_fb_cmd2 *r)
+static int framebuffer_check(const struct drm_mode_fb_cmd2 *r)
{
int ret, hsub, vsub, num_planes, i;
@@ -2450,8 +2376,7 @@ framebuffer_check(const struct drm_mode_fb_cmd2 *r)
* RETURNS:
* Zero on success, errno on failure.
*/
-int
-drm_mode_addfb2(struct drm_device *dev,
+int drm_mode_addfb2(struct drm_device *dev,
void *data, struct drm_file *file_priv)
{
struct drm_mode_fb_cmd2 *r = data;
@@ -2516,8 +2441,7 @@ out:
* RETURNS:
* Zero on success, errno on failure.
*/
-int
-drm_mode_rmfb(struct drm_device *dev,
+int drm_mode_rmfb(struct drm_device *dev,
void *data, struct drm_file *file_priv)
{
struct drm_mode_object *obj;
@@ -2572,8 +2496,7 @@ out:
* RETURNS:
* Zero on success, errno on failure.
*/
-int
-drm_mode_getfb(struct drm_device *dev,
+int drm_mode_getfb(struct drm_device *dev,
void *data, struct drm_file *file_priv)
{
struct drm_mode_fb_cmd *r = data;
@@ -2604,8 +2527,7 @@ out:
return ret;
}
-int
-drm_mode_dirtyfb_ioctl(struct drm_device *dev,
+int drm_mode_dirtyfb_ioctl(struct drm_device *dev,
void *data, struct drm_file *file_priv)
{
struct drm_clip_rect __user *clips_ptr;
@@ -2695,8 +2617,7 @@ out_err1:
* RETURNS:
* Zero on success, errno on failure.
*/
-void
-drm_fb_release(struct drm_device *dev, struct drm_file *priv)
+void drm_fb_release(struct drm_device *dev, struct drm_file *priv)
{
struct drm_framebuffer *fb, *tfb;
@@ -2715,16 +2636,14 @@ drm_fb_release(struct drm_device *dev, struct drm_file *priv)
*
* Add @mode to @connector's user mode list.
*/
-void
-drm_mode_attachmode(struct drm_device *dev,
+static void drm_mode_attachmode(struct drm_device *dev,
struct drm_connector *connector,
struct drm_display_mode *mode)
{
list_add_tail(&mode->head, &connector->user_modes);
}
-int
-drm_mode_attachmode_crtc(struct drm_device *dev, struct drm_crtc *crtc,
+int drm_mode_attachmode_crtc(struct drm_device *dev, struct drm_crtc *crtc,
const struct drm_display_mode *mode)
{
struct drm_connector *connector;
@@ -2762,8 +2681,7 @@ drm_mode_attachmode_crtc(struct drm_device *dev, struct drm_crtc *crtc,
}
EXPORT_SYMBOL(drm_mode_attachmode_crtc);
-int
-drm_mode_detachmode(struct drm_device *dev,
+static int drm_mode_detachmode(struct drm_device *dev,
struct drm_connector *connector,
struct drm_display_mode *mode)
{
@@ -2786,8 +2704,7 @@ drm_mode_detachmode(struct drm_device *dev,
return ret;
}
-int
-drm_mode_detachmode_crtc(struct drm_device *dev, struct drm_display_mode *mode)
+int drm_mode_detachmode_crtc(struct drm_device *dev, struct drm_display_mode *mode)
{
struct drm_connector *connector;
@@ -2811,8 +2728,7 @@ EXPORT_SYMBOL(drm_mode_detachmode_crtc);
* RETURNS:
* Zero on success, errno on failure.
*/
-int
-drm_mode_attachmode_ioctl(struct drm_device *dev,
+int drm_mode_attachmode_ioctl(struct drm_device *dev,
void *data, struct drm_file *file_priv)
{
struct drm_mode_mode_cmd *mode_cmd = data;
@@ -2866,8 +2782,7 @@ out:
* RETURNS:
* Zero on success, errno on failure.
*/
-int
-drm_mode_detachmode_ioctl(struct drm_device *dev,
+int drm_mode_detachmode_ioctl(struct drm_device *dev,
void *data, struct drm_file *file_priv)
{
struct drm_mode_object *obj;
@@ -2901,8 +2816,7 @@ out:
return ret;
}
-struct drm_property *
-drm_property_create(struct drm_device *dev, int flags,
+struct drm_property *drm_property_create(struct drm_device *dev, int flags,
const char *name, int num_values)
{
struct drm_property *property = NULL;
@@ -2941,8 +2855,7 @@ fail:
}
EXPORT_SYMBOL(drm_property_create);
-struct drm_property *
-drm_property_create_enum(struct drm_device *dev, int flags,
+struct drm_property *drm_property_create_enum(struct drm_device *dev, int flags,
const char *name,
const struct drm_prop_enum_list *props,
int num_values)
@@ -2970,8 +2883,7 @@ drm_property_create_enum(struct drm_device *dev, int flags,
}
EXPORT_SYMBOL(drm_property_create_enum);
-struct drm_property *
-drm_property_create_bitmask(struct drm_device *dev,
+struct drm_property *drm_property_create_bitmask(struct drm_device *dev,
int flags, const char *name,
const struct drm_prop_enum_list *props,
int num_values)
@@ -2999,8 +2911,7 @@ drm_property_create_bitmask(struct drm_device *dev,
}
EXPORT_SYMBOL(drm_property_create_bitmask);
-struct drm_property *
-drm_property_create_range(struct drm_device *dev, int flags,
+struct drm_property *drm_property_create_range(struct drm_device *dev, int flags,
const char *name,
uint64_t min, uint64_t max)
{
@@ -3019,8 +2930,7 @@ drm_property_create_range(struct drm_device *dev, int flags,
}
EXPORT_SYMBOL(drm_property_create_range);
-int
-drm_property_add_enum(struct drm_property *property, int index,
+int drm_property_add_enum(struct drm_property *property, int index,
uint64_t value, const char *name)
{
struct drm_property_enum *prop_enum;
@@ -3060,8 +2970,7 @@ drm_property_add_enum(struct drm_property *property, int index,
}
EXPORT_SYMBOL(drm_property_add_enum);
-void
-drm_property_destroy(struct drm_device *dev, struct drm_property *property)
+void drm_property_destroy(struct drm_device *dev, struct drm_property *property)
{
struct drm_property_enum *prop_enum, *pt;
@@ -3078,8 +2987,7 @@ drm_property_destroy(struct drm_device *dev, struct drm_property *property)
}
EXPORT_SYMBOL(drm_property_destroy);
-void
-drm_object_attach_property(struct drm_mode_object *obj,
+void drm_object_attach_property(struct drm_mode_object *obj,
struct drm_property *property,
uint64_t init_val)
{
@@ -3099,8 +3007,7 @@ drm_object_attach_property(struct drm_mode_object *obj,
}
EXPORT_SYMBOL(drm_object_attach_property);
-int
-drm_object_property_set_value(struct drm_mode_object *obj,
+int drm_object_property_set_value(struct drm_mode_object *obj,
struct drm_property *property, uint64_t val)
{
int i;
@@ -3116,8 +3023,7 @@ drm_object_property_set_value(struct drm_mode_object *obj,
}
EXPORT_SYMBOL(drm_object_property_set_value);
-int
-drm_object_property_get_value(struct drm_mode_object *obj,
+int drm_object_property_get_value(struct drm_mode_object *obj,
struct drm_property *property, uint64_t *val)
{
int i;
@@ -3133,8 +3039,7 @@ drm_object_property_get_value(struct drm_mode_object *obj,
}
EXPORT_SYMBOL(drm_object_property_get_value);
-int
-drm_mode_getproperty_ioctl(struct drm_device *dev,
+int drm_mode_getproperty_ioctl(struct drm_device *dev,
void *data, struct drm_file *file_priv)
{
struct drm_mode_object *obj;
@@ -3244,8 +3149,7 @@ done:
return ret;
}
-struct drm_property_blob *
-drm_property_create_blob(struct drm_device *dev, int length,
+static struct drm_property_blob *drm_property_create_blob(struct drm_device *dev, int length,
void *data)
{
struct drm_property_blob *blob;
@@ -3273,8 +3177,7 @@ drm_property_create_blob(struct drm_device *dev, int length,
return blob;
}
-void
-drm_property_destroy_blob(struct drm_device *dev,
+static void drm_property_destroy_blob(struct drm_device *dev,
struct drm_property_blob *blob)
{
drm_mode_object_put(dev, &blob->base);
@@ -3282,8 +3185,7 @@ drm_property_destroy_blob(struct drm_device *dev,
free(blob, M_DRM);
}
-int
-drm_mode_getblob_ioctl(struct drm_device *dev,
+int drm_mode_getblob_ioctl(struct drm_device *dev,
void *data, struct drm_file *file_priv)
{
struct drm_mode_object *obj;
@@ -3317,8 +3219,7 @@ done:
return ret;
}
-int
-drm_mode_connector_update_edid_property(struct drm_connector *connector,
+int drm_mode_connector_update_edid_property(struct drm_connector *connector,
struct edid *edid)
{
struct drm_device *dev = connector->dev;
@@ -3348,8 +3249,7 @@ drm_mode_connector_update_edid_property(struct drm_connector *connector,
}
EXPORT_SYMBOL(drm_mode_connector_update_edid_property);
-bool
-drm_property_change_is_valid(struct drm_property *property,
+static bool drm_property_change_is_valid(struct drm_property *property,
uint64_t value)
{
if (property->flags & DRM_MODE_PROP_IMMUTABLE)
@@ -3376,8 +3276,7 @@ drm_property_change_is_valid(struct drm_property *property,
}
}
-int
-drm_mode_connector_property_set_ioctl(struct drm_device *dev,
+int drm_mode_connector_property_set_ioctl(struct drm_device *dev,
void *data, struct drm_file *file_priv)
{
struct drm_mode_connector_set_property *conn_set_prop = data;
@@ -3392,8 +3291,7 @@ drm_mode_connector_property_set_ioctl(struct drm_device *dev,
return drm_mode_obj_set_property_ioctl(dev, &obj_set_prop, file_priv);
}
-int
-drm_mode_connector_set_obj_prop(struct drm_mode_object *obj,
+static int drm_mode_connector_set_obj_prop(struct drm_mode_object *obj,
struct drm_property *property,
uint64_t value)
{
@@ -3414,8 +3312,7 @@ drm_mode_connector_set_obj_prop(struct drm_mode_object *obj,
return ret;
}
-int
-drm_mode_crtc_set_obj_prop(struct drm_mode_object *obj,
+static int drm_mode_crtc_set_obj_prop(struct drm_mode_object *obj,
struct drm_property *property,
uint64_t value)
{
@@ -3430,8 +3327,7 @@ drm_mode_crtc_set_obj_prop(struct drm_mode_object *obj,
return ret;
}
-int
-drm_mode_plane_set_obj_prop(struct drm_mode_object *obj,
+static int drm_mode_plane_set_obj_prop(struct drm_mode_object *obj,
struct drm_property *property,
uint64_t value)
{
@@ -3446,8 +3342,7 @@ drm_mode_plane_set_obj_prop(struct drm_mode_object *obj,
return ret;
}
-int
-drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data,
+int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
struct drm_mode_obj_get_properties *arg = data;
@@ -3505,8 +3400,7 @@ out:
return ret;
}
-int
-drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data,
+int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
struct drm_mode_obj_set_property *arg = data;
@@ -3561,8 +3455,7 @@ out:
return ret;
}
-int
-drm_mode_connector_attach_encoder(struct drm_connector *connector,
+int drm_mode_connector_attach_encoder(struct drm_connector *connector,
struct drm_encoder *encoder)
{
int i;
@@ -3577,8 +3470,7 @@ drm_mode_connector_attach_encoder(struct drm_connector *connector,
}
EXPORT_SYMBOL(drm_mode_connector_attach_encoder);
-void
-drm_mode_connector_detach_encoder(struct drm_connector *connector,
+void drm_mode_connector_detach_encoder(struct drm_connector *connector,
struct drm_encoder *encoder)
{
int i;
@@ -3593,8 +3485,7 @@ drm_mode_connector_detach_encoder(struct drm_connector *connector,
}
EXPORT_SYMBOL(drm_mode_connector_detach_encoder);
-int
-drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc,
+int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc,
int gamma_size)
{
crtc->gamma_size = gamma_size;
@@ -3610,8 +3501,7 @@ drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc,
}
EXPORT_SYMBOL(drm_mode_crtc_set_gamma_size);
-int
-drm_mode_gamma_set_ioctl(struct drm_device *dev,
+int drm_mode_gamma_set_ioctl(struct drm_device *dev,
void *data, struct drm_file *file_priv)
{
struct drm_mode_crtc_lut *crtc_lut = data;
@@ -3673,8 +3563,7 @@ out:
}
-int
-drm_mode_gamma_get_ioctl(struct drm_device *dev,
+int drm_mode_gamma_get_ioctl(struct drm_device *dev,
void *data, struct drm_file *file_priv)
{
struct drm_mode_crtc_lut *crtc_lut = data;
@@ -3727,8 +3616,7 @@ out:
return ret;
}
-int
-drm_mode_page_flip_ioctl(struct drm_device *dev,
+int drm_mode_page_flip_ioctl(struct drm_device *dev,
void *data, struct drm_file *file_priv)
{
struct drm_mode_crtc_page_flip *page_flip = data;
@@ -3828,8 +3716,7 @@ out:
return ret;
}
-void
-drm_mode_config_reset(struct drm_device *dev)
+void drm_mode_config_reset(struct drm_device *dev)
{
struct drm_crtc *crtc;
struct drm_encoder *encoder;
@@ -3852,8 +3739,7 @@ drm_mode_config_reset(struct drm_device *dev)
}
EXPORT_SYMBOL(drm_mode_config_reset);
-int
-drm_mode_create_dumb_ioctl(struct drm_device *dev,
+int drm_mode_create_dumb_ioctl(struct drm_device *dev,
void *data, struct drm_file *file_priv)
{
struct drm_mode_create_dumb *args = data;
@@ -3863,8 +3749,7 @@ drm_mode_create_dumb_ioctl(struct drm_device *dev,
return dev->driver->dumb_create(file_priv, dev, args);
}
-int
-drm_mode_mmap_dumb_ioctl(struct drm_device *dev,
+int drm_mode_mmap_dumb_ioctl(struct drm_device *dev,
void *data, struct drm_file *file_priv)
{
struct drm_mode_map_dumb *args = data;
@@ -3876,8 +3761,7 @@ drm_mode_mmap_dumb_ioctl(struct drm_device *dev,
return dev->driver->dumb_map_offset(file_priv, dev, args->handle, &args->offset);
}
-int
-drm_mode_destroy_dumb_ioctl(struct drm_device *dev,
+int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,
void *data, struct drm_file *file_priv)
{
struct drm_mode_destroy_dumb *args = data;
@@ -3892,8 +3776,7 @@ drm_mode_destroy_dumb_ioctl(struct drm_device *dev,
* Just need to support RGB formats here for compat with code that doesn't
* use pixel formats directly yet.
*/
-void
-drm_fb_get_bpp_depth(uint32_t format, unsigned int *depth,
+void drm_fb_get_bpp_depth(uint32_t format, unsigned int *depth,
int *bpp)
{
switch (format) {
@@ -3965,8 +3848,7 @@ EXPORT_SYMBOL(drm_fb_get_bpp_depth);
* RETURNS:
* The number of planes used by the specified pixel format.
*/
-int
-drm_format_num_planes(uint32_t format)
+int drm_format_num_planes(uint32_t format)
{
switch (format) {
case DRM_FORMAT_YUV410:
@@ -4001,8 +3883,7 @@ EXPORT_SYMBOL(drm_format_num_planes);
* RETURNS:
* The bytes per pixel value for the specified plane.
*/
-int
-drm_format_plane_cpp(uint32_t format, int plane)
+int drm_format_plane_cpp(uint32_t format, int plane)
{
unsigned int depth;
int bpp;
@@ -4049,8 +3930,7 @@ EXPORT_SYMBOL(drm_format_plane_cpp);
* The horizontal chroma subsampling factor for the
* specified pixel format.
*/
-int
-drm_format_horz_chroma_subsampling(uint32_t format)
+int drm_format_horz_chroma_subsampling(uint32_t format)
{
switch (format) {
case DRM_FORMAT_YUV411:
@@ -4085,8 +3965,7 @@ EXPORT_SYMBOL(drm_format_horz_chroma_subsampling);
* The vertical chroma subsampling factor for the
* specified pixel format.
*/
-int
-drm_format_vert_chroma_subsampling(uint32_t format)
+int drm_format_vert_chroma_subsampling(uint32_t format)
{
switch (format) {
case DRM_FORMAT_YUV410:
diff --git a/sys/dev/pci/drm/drm_crtc_helper.c b/sys/dev/pci/drm/drm_crtc_helper.c
index 929ea1bd8a1..53268e22d9b 100644
--- a/sys/dev/pci/drm/drm_crtc_helper.c
+++ b/sys/dev/pci/drm/drm_crtc_helper.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_crtc_helper.c,v 1.2 2013/08/12 04:11:52 jsg Exp $ */
+/* $OpenBSD: drm_crtc_helper.c,v 1.3 2013/09/02 06:25:27 jsg Exp $ */
/*
* Copyright (c) 2006-2008 Intel Corporation
* Copyright (c) 2007 Dave Airlie <airlied@linux.ie>
@@ -37,17 +37,6 @@
#include "drm_fb_helper.h"
#include "drm_edid.h"
-void drm_mode_validate_flag(struct drm_connector *, int);
-void drm_encoder_disable(struct drm_encoder *);
-void drm_calc_timestamping_constants(struct drm_crtc *);
-bool drm_encoder_crtc_ok(struct drm_encoder *, struct drm_crtc *);
-void drm_crtc_prepare_encoders(struct drm_device *);
-int drm_helper_choose_encoder_dpms(struct drm_encoder *);
-int drm_helper_choose_crtc_dpms(struct drm_crtc *);
-int drm_crtc_helper_disable(struct drm_crtc *);
-void drm_output_poll_execute(void *, void *);
-void drm_output_poll_tick(void *);
-
/**
* drm_helper_move_panel_connectors_to_head() - move panels to the front in the
* connector list
@@ -59,8 +48,7 @@ void drm_output_poll_tick(void *);
* (eDP/LVDS) panels to the front of the connector list, instead of
* painstakingly trying to initialize them in the right order.
*/
-void
-drm_helper_move_panel_connectors_to_head(struct drm_device *dev)
+void drm_helper_move_panel_connectors_to_head(struct drm_device *dev)
{
struct drm_connector *connector, *tmp;
struct list_head panel_list;
@@ -80,8 +68,7 @@ EXPORT_SYMBOL(drm_helper_move_panel_connectors_to_head);
static bool drm_kms_helper_poll = true;
-void
-drm_mode_validate_flag(struct drm_connector *connector,
+static void drm_mode_validate_flag(struct drm_connector *connector,
int flags)
{
struct drm_display_mode *mode;
@@ -122,8 +109,7 @@ drm_mode_validate_flag(struct drm_connector *connector,
* RETURNS:
* Number of modes found on @connector.
*/
-int
-drm_helper_probe_single_connector_modes(struct drm_connector *connector,
+int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
uint32_t maxX, uint32_t maxY)
{
struct drm_device *dev = connector->dev;
@@ -225,8 +211,7 @@ EXPORT_SYMBOL(drm_helper_probe_single_connector_modes);
* RETURNS:
* True if @encoder is part of the mode_config, false otherwise.
*/
-bool
-drm_helper_encoder_in_use(struct drm_encoder *encoder)
+bool drm_helper_encoder_in_use(struct drm_encoder *encoder)
{
struct drm_connector *connector;
struct drm_device *dev = encoder->dev;
@@ -249,8 +234,7 @@ EXPORT_SYMBOL(drm_helper_encoder_in_use);
* RETURNS:
* True if @crtc is part of the mode_config, false otherwise.
*/
-bool
-drm_helper_crtc_in_use(struct drm_crtc *crtc)
+bool drm_helper_crtc_in_use(struct drm_crtc *crtc)
{
struct drm_encoder *encoder;
struct drm_device *dev = crtc->dev;
@@ -262,7 +246,7 @@ drm_helper_crtc_in_use(struct drm_crtc *crtc)
}
EXPORT_SYMBOL(drm_helper_crtc_in_use);
-void
+static void
drm_encoder_disable(struct drm_encoder *encoder)
{
struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private;
@@ -283,8 +267,7 @@ drm_encoder_disable(struct drm_encoder *encoder)
* If an connector or CRTC isn't part of @dev's mode_config, it can be disabled
* by calling its dpms function, which should power it off.
*/
-void
-drm_helper_disable_unused_functions(struct drm_device *dev)
+void drm_helper_disable_unused_functions(struct drm_device *dev)
{
struct drm_encoder *encoder;
struct drm_connector *connector;
@@ -326,8 +309,7 @@ EXPORT_SYMBOL(drm_helper_disable_unused_functions);
*
* Return false if @encoder can't be driven by @crtc, true otherwise.
*/
-bool
-drm_encoder_crtc_ok(struct drm_encoder *encoder,
+static bool drm_encoder_crtc_ok(struct drm_encoder *encoder,
struct drm_crtc *crtc)
{
struct drm_device *dev;
@@ -355,7 +337,7 @@ drm_encoder_crtc_ok(struct drm_encoder *encoder,
* CRTC. If they don't match, we have to disable the output and the CRTC
* since the driver will have to re-route things.
*/
-void
+static void
drm_crtc_prepare_encoders(struct drm_device *dev)
{
struct drm_encoder_helper_funcs *encoder_funcs;
@@ -396,8 +378,7 @@ drm_crtc_prepare_encoders(struct drm_device *dev)
* RETURNS:
* True if the mode was set successfully, or false otherwise.
*/
-bool
-drm_crtc_helper_set_mode(struct drm_crtc *crtc,
+bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
struct drm_display_mode *mode,
int x, int y,
struct drm_framebuffer *old_fb)
@@ -522,7 +503,7 @@ done:
EXPORT_SYMBOL(drm_crtc_helper_set_mode);
-int
+static int
drm_crtc_helper_disable(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
@@ -562,8 +543,7 @@ drm_crtc_helper_disable(struct drm_crtc *crtc)
* RETURNS:
* Returns 0 on success, ERRNO on failure.
*/
-int
-drm_crtc_helper_set_config(struct drm_mode_set *set)
+int drm_crtc_helper_set_config(struct drm_mode_set *set)
{
struct drm_device *dev;
struct drm_crtc *save_crtcs, *new_crtc, *crtc;
@@ -830,8 +810,7 @@ fail:
}
EXPORT_SYMBOL(drm_crtc_helper_set_config);
-int
-drm_helper_choose_encoder_dpms(struct drm_encoder *encoder)
+static int drm_helper_choose_encoder_dpms(struct drm_encoder *encoder)
{
int dpms = DRM_MODE_DPMS_OFF;
struct drm_connector *connector;
@@ -844,8 +823,7 @@ drm_helper_choose_encoder_dpms(struct drm_encoder *encoder)
return dpms;
}
-int
-drm_helper_choose_crtc_dpms(struct drm_crtc *crtc)
+static int drm_helper_choose_crtc_dpms(struct drm_crtc *crtc)
{
int dpms = DRM_MODE_DPMS_OFF;
struct drm_connector *connector;
@@ -868,8 +846,7 @@ drm_helper_choose_crtc_dpms(struct drm_crtc *crtc)
* state for all encoders and crtcs in the output mesh and calls the ->dpms()
* callback provided by the driver appropriately.
*/
-void
-drm_helper_connector_dpms(struct drm_connector *connector, int mode)
+void drm_helper_connector_dpms(struct drm_connector *connector, int mode)
{
struct drm_encoder *encoder = connector->encoder;
struct drm_crtc *crtc = encoder ? encoder->crtc : NULL;
@@ -917,8 +894,7 @@ drm_helper_connector_dpms(struct drm_connector *connector, int mode)
}
EXPORT_SYMBOL(drm_helper_connector_dpms);
-int
-drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb,
+int drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb,
struct drm_mode_fb_cmd2 *mode_cmd)
{
int i;
@@ -937,8 +913,7 @@ drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb,
}
EXPORT_SYMBOL(drm_helper_mode_fill_fb_struct);
-int
-drm_helper_resume_force_mode(struct drm_device *dev)
+int drm_helper_resume_force_mode(struct drm_device *dev)
{
struct drm_crtc *crtc;
struct drm_encoder *encoder;
@@ -982,8 +957,7 @@ drm_helper_resume_force_mode(struct drm_device *dev)
}
EXPORT_SYMBOL(drm_helper_resume_force_mode);
-void
-drm_kms_helper_hotplug_event(struct drm_device *dev)
+void drm_kms_helper_hotplug_event(struct drm_device *dev)
{
/* send a uevent + call fbdev */
// drm_sysfs_hotplug_event(dev);
@@ -992,18 +966,8 @@ drm_kms_helper_hotplug_event(struct drm_device *dev)
}
EXPORT_SYMBOL(drm_kms_helper_hotplug_event);
-void
-drm_output_poll_tick(void *arg)
-{
- struct drm_device *dev = arg;
-
- workq_queue_task(NULL, &dev->mode_config.poll_task, 0,
- drm_output_poll_execute, dev, NULL);
-}
-
#define DRM_OUTPUT_POLL_SECONDS 10
-void
-drm_output_poll_execute(void *arg1, void *arg2)
+static void drm_output_poll_execute(void *arg1, void *arg2)
{
struct drm_device *dev = (struct drm_device *)arg1;
struct drm_connector *connector;
@@ -1054,8 +1018,16 @@ drm_output_poll_execute(void *arg1, void *arg2)
DRM_OUTPUT_POLL_SECONDS);
}
-void
-drm_kms_helper_poll_disable(struct drm_device *dev)
+static void
+drm_output_poll_tick(void *arg)
+{
+ struct drm_device *dev = arg;
+
+ workq_queue_task(NULL, &dev->mode_config.poll_task, 0,
+ drm_output_poll_execute, dev, NULL);
+}
+
+void drm_kms_helper_poll_disable(struct drm_device *dev)
{
if (!dev->mode_config.poll_enabled)
return;
@@ -1063,8 +1035,7 @@ drm_kms_helper_poll_disable(struct drm_device *dev)
}
EXPORT_SYMBOL(drm_kms_helper_poll_disable);
-void
-drm_kms_helper_poll_enable(struct drm_device *dev)
+void drm_kms_helper_poll_enable(struct drm_device *dev)
{
bool poll = false;
struct drm_connector *connector;
@@ -1084,8 +1055,7 @@ drm_kms_helper_poll_enable(struct drm_device *dev)
}
EXPORT_SYMBOL(drm_kms_helper_poll_enable);
-void
-drm_kms_helper_poll_init(struct drm_device *dev)
+void drm_kms_helper_poll_init(struct drm_device *dev)
{
timeout_set(&dev->mode_config.output_poll_to, drm_output_poll_tick,
dev);
@@ -1095,15 +1065,13 @@ drm_kms_helper_poll_init(struct drm_device *dev)
}
EXPORT_SYMBOL(drm_kms_helper_poll_init);
-void
-drm_kms_helper_poll_fini(struct drm_device *dev)
+void drm_kms_helper_poll_fini(struct drm_device *dev)
{
drm_kms_helper_poll_disable(dev);
}
EXPORT_SYMBOL(drm_kms_helper_poll_fini);
-void
-drm_helper_hpd_irq_event(struct drm_device *dev)
+void drm_helper_hpd_irq_event(struct drm_device *dev)
{
struct drm_connector *connector;
enum drm_connector_status old_status;
diff --git a/sys/dev/pci/drm/drm_dp_helper.c b/sys/dev/pci/drm/drm_dp_helper.c
index 88461e21f5d..2ab956ddf41 100644
--- a/sys/dev/pci/drm/drm_dp_helper.c
+++ b/sys/dev/pci/drm/drm_dp_helper.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_dp_helper.c,v 1.3 2013/03/30 18:33:56 kettenis Exp $ */
+/* $OpenBSD: drm_dp_helper.c,v 1.4 2013/09/02 06:25:27 jsg Exp $ */
/*
* Copyright © 2009 Keith Packard
*
@@ -33,24 +33,8 @@
* blocks, ...
*/
-int i2c_algo_dp_aux_transaction(struct i2c_controller *, int, uint8_t,
- uint8_t *);
-int i2c_algo_dp_aux_address(struct i2c_controller *, u16, bool);
-void i2c_algo_dp_aux_stop(struct i2c_controller *, bool);
-int i2c_algo_dp_aux_put_byte(struct i2c_controller *, u8);
-int i2c_algo_dp_aux_get_byte(struct i2c_controller *, u8 *);
-void i2c_dp_aux_reset_bus(struct i2c_controller *);
-int i2c_dp_aux_prepare_bus(struct i2c_controller *);
-int i2c_dp_aux_add_bus(struct i2c_controller *);
-u8 dp_link_status(u8 link_status[DP_LINK_STATUS_SIZE], int);
-u8 dp_get_lane_status(u8 link_status[DP_LINK_STATUS_SIZE], int);
-int i2c_algo_dp_aux_exec(void *, i2c_op_t, i2c_addr_t,
- const void *, size_t, void *, size_t, int);
-void i2c_dp_aux_release_bus(void *, int);
-int i2c_dp_aux_acquire_bus(void *, int);
-
/* Run a single AUX_CH I2C transaction, writing/reading data as necessary */
-int
+static int
i2c_algo_dp_aux_transaction(struct i2c_controller *adapter, int mode,
uint8_t write_byte, uint8_t *read_byte)
{
@@ -71,7 +55,7 @@ i2c_algo_dp_aux_transaction(struct i2c_controller *adapter, int mode,
* the connection with the new address, this is used for doing
* a write followed by a read (as needed for DDC)
*/
-int
+static int
i2c_algo_dp_aux_address(struct i2c_controller *adapter, u16 address, bool reading)
{
struct i2c_algo_dp_aux_data *algo_data = adapter->ic_cookie;
@@ -92,7 +76,7 @@ i2c_algo_dp_aux_address(struct i2c_controller *adapter, u16 address, bool readin
* Stop the I2C transaction. This closes out the link, sending
* a bare address packet with the MOT bit turned off
*/
-void
+static void
i2c_algo_dp_aux_stop(struct i2c_controller *adapter, bool reading)
{
struct i2c_algo_dp_aux_data *algo_data = adapter->ic_cookie;
@@ -112,7 +96,7 @@ i2c_algo_dp_aux_stop(struct i2c_controller *adapter, bool reading)
* Write a single byte to the current I2C address, the
* the I2C link must be running or this returns -EIO
*/
-int
+static int
i2c_algo_dp_aux_put_byte(struct i2c_controller *adapter, u8 byte)
{
struct i2c_algo_dp_aux_data *algo_data = adapter->ic_cookie;
@@ -129,7 +113,7 @@ i2c_algo_dp_aux_put_byte(struct i2c_controller *adapter, u8 byte)
* Read a single byte from the current I2C address, the
* I2C link must be running or this returns -EIO
*/
-int
+static int
i2c_algo_dp_aux_get_byte(struct i2c_controller *adapter, u8 *byte_ret)
{
struct i2c_algo_dp_aux_data *algo_data = adapter->ic_cookie;
@@ -142,7 +126,7 @@ i2c_algo_dp_aux_get_byte(struct i2c_controller *adapter, u8 *byte_ret)
return ret;
}
-int
+static int
i2c_algo_dp_aux_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
const void *cmdbuf, size_t cmdlen, void *buffer, size_t len, int flags)
{
@@ -191,20 +175,20 @@ out:
return ret;
}
-void
+static void
i2c_dp_aux_reset_bus(struct i2c_controller *adapter)
{
(void) i2c_algo_dp_aux_address(adapter, 0, false);
(void) i2c_algo_dp_aux_stop(adapter, false);
}
-int
+static int
i2c_dp_aux_acquire_bus(void *cookie, int flags)
{
return (0);
}
-void
+static void
i2c_dp_aux_release_bus(void *cookie, int flags)
{
struct i2c_algo_dp_aux_data *algo_data = cookie;
@@ -212,7 +196,7 @@ i2c_dp_aux_release_bus(void *cookie, int flags)
i2c_dp_aux_reset_bus(algo_data->adapter);
}
-int
+static int
i2c_dp_aux_prepare_bus(struct i2c_controller *adapter)
{
#ifdef notyet
@@ -255,14 +239,12 @@ i2c_dp_aux_add_bus(struct i2c_controller *adapter)
EXPORT_SYMBOL(i2c_dp_aux_add_bus);
/* Helpers for DP link training */
-u8
-dp_link_status(u8 link_status[DP_LINK_STATUS_SIZE], int r)
+static u8 dp_link_status(u8 link_status[DP_LINK_STATUS_SIZE], int r)
{
return link_status[r - DP_LANE0_1_STATUS];
}
-u8
-dp_get_lane_status(u8 link_status[DP_LINK_STATUS_SIZE],
+static u8 dp_get_lane_status(u8 link_status[DP_LINK_STATUS_SIZE],
int lane)
{
int i = DP_LANE0_1_STATUS + (lane >> 1);
@@ -271,8 +253,7 @@ dp_get_lane_status(u8 link_status[DP_LINK_STATUS_SIZE],
return (l >> s) & 0xf;
}
-bool
-drm_dp_channel_eq_ok(u8 link_status[DP_LINK_STATUS_SIZE],
+bool drm_dp_channel_eq_ok(u8 link_status[DP_LINK_STATUS_SIZE],
int lane_count)
{
u8 lane_align;
@@ -292,8 +273,7 @@ drm_dp_channel_eq_ok(u8 link_status[DP_LINK_STATUS_SIZE],
}
EXPORT_SYMBOL(drm_dp_channel_eq_ok);
-bool
-drm_dp_clock_recovery_ok(u8 link_status[DP_LINK_STATUS_SIZE],
+bool drm_dp_clock_recovery_ok(u8 link_status[DP_LINK_STATUS_SIZE],
int lane_count)
{
int lane;
@@ -308,8 +288,7 @@ drm_dp_clock_recovery_ok(u8 link_status[DP_LINK_STATUS_SIZE],
}
EXPORT_SYMBOL(drm_dp_clock_recovery_ok);
-u8
-drm_dp_get_adjust_request_voltage(u8 link_status[DP_LINK_STATUS_SIZE],
+u8 drm_dp_get_adjust_request_voltage(u8 link_status[DP_LINK_STATUS_SIZE],
int lane)
{
int i = DP_ADJUST_REQUEST_LANE0_1 + (lane >> 1);
@@ -322,8 +301,7 @@ drm_dp_get_adjust_request_voltage(u8 link_status[DP_LINK_STATUS_SIZE],
}
EXPORT_SYMBOL(drm_dp_get_adjust_request_voltage);
-u8
-drm_dp_get_adjust_request_pre_emphasis(u8 link_status[DP_LINK_STATUS_SIZE],
+u8 drm_dp_get_adjust_request_pre_emphasis(u8 link_status[DP_LINK_STATUS_SIZE],
int lane)
{
int i = DP_ADJUST_REQUEST_LANE0_1 + (lane >> 1);
@@ -336,9 +314,7 @@ drm_dp_get_adjust_request_pre_emphasis(u8 link_status[DP_LINK_STATUS_SIZE],
}
EXPORT_SYMBOL(drm_dp_get_adjust_request_pre_emphasis);
-void
-drm_dp_link_train_clock_recovery_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE])
-{
+void drm_dp_link_train_clock_recovery_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE]) {
if (dpcd[DP_TRAINING_AUX_RD_INTERVAL] == 0)
DELAY(100);
else
@@ -346,9 +322,7 @@ drm_dp_link_train_clock_recovery_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE])
}
EXPORT_SYMBOL(drm_dp_link_train_clock_recovery_delay);
-void
-drm_dp_link_train_channel_eq_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE])
-{
+void drm_dp_link_train_channel_eq_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE]) {
if (dpcd[DP_TRAINING_AUX_RD_INTERVAL] == 0)
DELAY(400);
else
@@ -356,8 +330,7 @@ drm_dp_link_train_channel_eq_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE])
}
EXPORT_SYMBOL(drm_dp_link_train_channel_eq_delay);
-u8
-drm_dp_link_rate_to_bw_code(int link_rate)
+u8 drm_dp_link_rate_to_bw_code(int link_rate)
{
switch (link_rate) {
case 162000:
@@ -371,8 +344,7 @@ drm_dp_link_rate_to_bw_code(int link_rate)
}
EXPORT_SYMBOL(drm_dp_link_rate_to_bw_code);
-int
-drm_dp_bw_code_to_link_rate(u8 link_bw)
+int drm_dp_bw_code_to_link_rate(u8 link_bw)
{
switch (link_bw) {
case DP_LINK_BW_1_62:
diff --git a/sys/dev/pci/drm/drm_edid.c b/sys/dev/pci/drm/drm_edid.c
index 8100b864dcf..6ae93305e97 100644
--- a/sys/dev/pci/drm/drm_edid.c
+++ b/sys/dev/pci/drm/drm_edid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_edid.c,v 1.5 2013/04/03 06:03:58 jsg Exp $ */
+/* $OpenBSD: drm_edid.c,v 1.6 2013/09/02 06:25:27 jsg Exp $ */
/*
* Copyright (c) 2006 Luc Verhaegen (quirks list)
* Copyright (c) 2007-2008 Intel Corporation
@@ -34,75 +34,6 @@
#include <dev/i2c/i2cvar.h>
-typedef void detailed_cb(struct detailed_timing *timing, void *closure);
-
-u8 *drm_do_get_edid(struct drm_connector *, struct i2c_controller *);
-int drm_do_probe_ddc_edid(struct i2c_controller *, unsigned char *, int,
- int);
-bool drm_edid_is_zero(u8 *, int);
-bool edid_vendor(struct edid *, char *);
-u32 edid_get_quirks(struct edid *);
-void edid_fixup_preferred(struct drm_connector *, u32);
-void cea_for_each_detailed_block(u8 *, detailed_cb *, void *);
-void vtb_for_each_detailed_block(u8 *, detailed_cb *, void *);
-void drm_for_each_detailed_block(u8 *, detailed_cb *, void *);
-void is_rb(struct detailed_timing *, void *);
-bool drm_monitor_supports_rb(struct edid *);
-void find_gtf2(struct detailed_timing *, void *);
-int drm_gtf2_hbreak(struct edid *);
-int drm_gtf2_2c(struct edid *);
-int drm_gtf2_m(struct edid *);
-int drm_gtf2_k(struct edid *);
-int drm_gtf2_2j(struct edid *);
-int standard_timing_level(struct edid *);
-int bad_std_timing(u8, u8);
-struct drm_display_mode *drm_mode_std(struct drm_connector *, struct edid *,
- struct std_timing *, int);
-void drm_mode_do_interlace_quirk(struct drm_display_mode *,
- struct detailed_pixel_timing *);
-struct drm_display_mode *
- drm_mode_detailed(struct drm_device *, struct edid *,
- struct detailed_timing *, u32);
-bool mode_is_rb(const struct drm_display_mode *);
-bool mode_in_hsync_range(const struct drm_display_mode *, struct edid *,
- u8 *);
-bool mode_in_vsync_range(const struct drm_display_mode *,
- struct edid *, u8 *);
-u32 range_pixel_clock(struct edid *, u8 *);
-bool mode_in_range(const struct drm_display_mode *, struct edid *,
- struct detailed_timing *);
-int drm_gtf_modes_for_range(struct drm_connector *, struct edid *,
- struct detailed_timing *);
-void do_inferred_modes(struct detailed_timing *, void *);
-int add_inferred_modes(struct drm_connector *, struct edid *);
-int drm_est3_modes(struct drm_connector *, struct detailed_timing *);
-void do_established_modes(struct detailed_timing *, void *);
-int add_established_modes(struct drm_connector *, struct edid *);
-void do_standard_modes(struct detailed_timing *, void *);
-int add_standard_modes(struct drm_connector *, struct edid *);
-int drm_cvt_modes(struct drm_connector *, struct detailed_timing *);
-void do_cvt_mode(struct detailed_timing *, void *);
-int add_cvt_modes(struct drm_connector *, struct edid *);
-void do_detailed_mode(struct detailed_timing *, void *);
-int add_detailed_modes(struct drm_connector *, struct edid *, u32);
-void drm_add_display_info(struct edid *, struct drm_display_info *);
-void parse_hdmi_vsdb(struct drm_connector *, const u8 *);
-void monitor_name(struct detailed_timing *, void *);
-bool valid_inferred_mode(const struct drm_connector *,
- const struct drm_display_mode *);
-int drm_dmt_modes_for_range(struct drm_connector *, struct edid *,
- struct detailed_timing *);
-void fixup_mode_1366x768(struct drm_display_mode *);
-int drm_cvt_modes_for_range(struct drm_connector *, struct edid *,
- struct detailed_timing *);
-int do_cea_modes (struct drm_connector *, u8 *, u8);
-int cea_db_payload_len(const u8 *);
-int cea_db_tag(const u8 *);
-int cea_revision(const u8 *);
-int cea_db_offsets(const u8 *, int *, int *);
-int add_cea_modes(struct drm_connector *, struct edid *);
-bool cea_db_is_hdmi_vsdb(const u8 *);
-
#define version_greater(edid, maj, min) \
(((edid)->version > (maj)) || \
((edid)->version == (maj) && (edid)->revision > (min)))
@@ -205,8 +136,7 @@ static const u8 edid_header[] = {
* Sanity check the header of the base EDID block. Return 8 if the header
* is perfect, down to 0 if it's totally wrong.
*/
-int
-drm_edid_header_is_valid(const u8 *raw_edid)
+int drm_edid_header_is_valid(const u8 *raw_edid)
{
int i, score = 0;
@@ -225,8 +155,7 @@ static int edid_fixup = 6;
* Sanity check the EDID block (base or extension). Return 0 if the block
* doesn't check out, or 1 if it's valid.
*/
-bool
-drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid)
+bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid)
{
int i;
u8 csum = 0;
@@ -298,8 +227,7 @@ EXPORT_SYMBOL(drm_edid_block_valid);
*
* Sanity-check an entire EDID record (including extensions)
*/
-bool
-drm_edid_is_valid(struct edid *edid)
+bool drm_edid_is_valid(struct edid *edid)
{
int i;
u8 *raw = (u8 *)edid;
@@ -326,7 +254,7 @@ EXPORT_SYMBOL(drm_edid_is_valid);
*
* Try to fetch EDID information by calling i2c driver function.
*/
-int
+static int
drm_do_probe_ddc_edid(struct i2c_controller *adapter, unsigned char *buf,
int block, int len)
{
@@ -350,8 +278,7 @@ i2c_err:
return (ret);
}
-bool
-drm_edid_is_zero(u8 *in_edid, int length)
+static bool drm_edid_is_zero(u8 *in_edid, int length)
{
int i;
u32 *raw_edid = (u32 *)in_edid;
@@ -362,7 +289,7 @@ drm_edid_is_zero(u8 *in_edid, int length)
return true;
}
-u8 *
+static u8 *
drm_do_get_edid(struct drm_connector *connector, struct i2c_controller *adapter)
{
int i, j = 0, valid_extensions = 0;
@@ -468,8 +395,7 @@ EXPORT_SYMBOL(drm_probe_ddc);
*
* Return edid data or NULL if we couldn't find any.
*/
-struct edid *
-drm_get_edid(struct drm_connector *connector,
+struct edid *drm_get_edid(struct drm_connector *connector,
struct i2c_controller *adapter)
{
struct edid *edid = NULL;
@@ -490,8 +416,7 @@ EXPORT_SYMBOL(drm_get_edid);
*
* Returns true if @vendor is in @edid, false otherwise
*/
-bool
-edid_vendor(struct edid *edid, char *vendor)
+static bool edid_vendor(struct edid *edid, char *vendor)
{
char edid_vendor[3];
@@ -509,8 +434,7 @@ edid_vendor(struct edid *edid, char *vendor)
*
* This tells subsequent routines what fixes they need to apply.
*/
-u32
-edid_get_quirks(struct edid *edid)
+static u32 edid_get_quirks(struct edid *edid)
{
struct edid_quirk *quirk;
int i;
@@ -537,8 +461,7 @@ edid_get_quirks(struct edid *edid)
* Walk the mode list for @connector, clearing the preferred status
* on existing modes and setting it anew for the right mode ala @quirks.
*/
-void
-edid_fixup_preferred(struct drm_connector *connector,
+static void edid_fixup_preferred(struct drm_connector *connector,
u32 quirks)
{
struct drm_display_mode *t, *cur_mode, *preferred_mode;
@@ -576,7 +499,7 @@ edid_fixup_preferred(struct drm_connector *connector,
preferred_mode->type |= DRM_MODE_TYPE_PREFERRED;
}
-bool
+static bool
mode_is_rb(const struct drm_display_mode *mode)
{
return (mode->htotal - mode->hdisplay == 160) &&
@@ -596,8 +519,7 @@ mode_is_rb(const struct drm_display_mode *mode)
* Walk the DMT mode list looking for a match for the given parameters.
* Return a newly allocated copy of the mode, or NULL if not found.
*/
-struct drm_display_mode *
-drm_mode_find_dmt(struct drm_device *dev,
+struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
int hsize, int vsize, int fresh,
bool rb)
{
@@ -621,7 +543,9 @@ drm_mode_find_dmt(struct drm_device *dev,
}
EXPORT_SYMBOL(drm_mode_find_dmt);
-void
+typedef void detailed_cb(struct detailed_timing *timing, void *closure);
+
+static void
cea_for_each_detailed_block(u8 *ext, detailed_cb *cb, void *closure)
{
int i, n = 0;
@@ -633,7 +557,7 @@ cea_for_each_detailed_block(u8 *ext, detailed_cb *cb, void *closure)
cb((struct detailed_timing *)(det_base + 18 * i), closure);
}
-void
+static void
vtb_for_each_detailed_block(u8 *ext, detailed_cb *cb, void *closure)
{
unsigned int i, n = min((int)ext[0x02], 6);
@@ -646,7 +570,7 @@ vtb_for_each_detailed_block(u8 *ext, detailed_cb *cb, void *closure)
cb((struct detailed_timing *)(det_base + 18 * i), closure);
}
-void
+static void
drm_for_each_detailed_block(u8 *raw_edid, detailed_cb *cb, void *closure)
{
int i;
@@ -673,7 +597,7 @@ drm_for_each_detailed_block(u8 *raw_edid, detailed_cb *cb, void *closure)
}
}
-void
+static void
is_rb(struct detailed_timing *t, void *data)
{
u8 *r = (u8 *)t;
@@ -683,7 +607,7 @@ is_rb(struct detailed_timing *t, void *data)
}
/* EDID 1.4 defines this explicitly. For EDID 1.3, we guess, badly. */
-bool
+static bool
drm_monitor_supports_rb(struct edid *edid)
{
if (edid->revision >= 4) {
@@ -695,7 +619,7 @@ drm_monitor_supports_rb(struct edid *edid)
return ((edid->input & DRM_EDID_INPUT_DIGITAL) != 0);
}
-void
+static void
find_gtf2(struct detailed_timing *t, void *data)
{
u8 *r = (u8 *)t;
@@ -704,7 +628,7 @@ find_gtf2(struct detailed_timing *t, void *data)
}
/* Secondary GTF curve kicks in above some break frequency */
-int
+static int
drm_gtf2_hbreak(struct edid *edid)
{
u8 *r = NULL;
@@ -712,7 +636,7 @@ drm_gtf2_hbreak(struct edid *edid)
return r ? (r[12] * 2) : 0;
}
-int
+static int
drm_gtf2_2c(struct edid *edid)
{
u8 *r = NULL;
@@ -720,7 +644,7 @@ drm_gtf2_2c(struct edid *edid)
return r ? r[13] : 0;
}
-int
+static int
drm_gtf2_m(struct edid *edid)
{
u8 *r = NULL;
@@ -728,7 +652,7 @@ drm_gtf2_m(struct edid *edid)
return r ? (r[15] << 8) + r[14] : 0;
}
-int
+static int
drm_gtf2_k(struct edid *edid)
{
u8 *r = NULL;
@@ -736,7 +660,7 @@ drm_gtf2_k(struct edid *edid)
return r ? r[16] : 0;
}
-int
+static int
drm_gtf2_2j(struct edid *edid)
{
u8 *r = NULL;
@@ -748,8 +672,7 @@ drm_gtf2_2j(struct edid *edid)
* standard_timing_level - get std. timing level(CVT/GTF/DMT)
* @edid: EDID block to scan
*/
-int
-standard_timing_level(struct edid *edid)
+static int standard_timing_level(struct edid *edid)
{
if (edid->revision >= 2) {
if (edid->revision >= 4 && (edid->features & DRM_EDID_FEATURE_DEFAULT_GTF))
@@ -765,7 +688,7 @@ standard_timing_level(struct edid *edid)
* 0 is reserved. The spec says 0x01 fill for unused timings. Some old
* monitors fill with ascii space (0x20) instead.
*/
-int
+static int
bad_std_timing(u8 a, u8 b)
{
return (a == 0x00 && b == 0x00) ||
@@ -781,7 +704,7 @@ bad_std_timing(u8 a, u8 b)
* Take the standard timing params (in this case width, aspect, and refresh)
* and convert them into a real mode using CVT/GTF/DMT.
*/
-struct drm_display_mode *
+static struct drm_display_mode *
drm_mode_std(struct drm_connector *connector, struct edid *edid,
struct std_timing *t, int revision)
{
@@ -897,7 +820,7 @@ drm_mode_std(struct drm_connector *connector, struct edid *edid,
* The format list here is from CEA, in frame size. Technically we
* should be checking refresh rate too. Whatever.
*/
-void
+static void
drm_mode_do_interlace_quirk(struct drm_display_mode *mode,
struct detailed_pixel_timing *pt)
{
@@ -941,8 +864,7 @@ drm_mode_do_interlace_quirk(struct drm_display_mode *mode,
* An EDID detailed timing block contains enough info for us to create and
* return a new struct drm_display_mode.
*/
-struct drm_display_mode *
-drm_mode_detailed(struct drm_device *dev,
+static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,
struct edid *edid,
struct detailed_timing *timing,
u32 quirks)
@@ -1042,7 +964,7 @@ set_size:
return mode;
}
-bool
+static bool
mode_in_hsync_range(const struct drm_display_mode *mode,
struct edid *edid, u8 *t)
{
@@ -1059,7 +981,7 @@ mode_in_hsync_range(const struct drm_display_mode *mode,
return (hsync <= hmax && hsync >= hmin);
}
-bool
+static bool
mode_in_vsync_range(const struct drm_display_mode *mode,
struct edid *edid, u8 *t)
{
@@ -1076,7 +998,7 @@ mode_in_vsync_range(const struct drm_display_mode *mode,
return (vsync <= vmax && vsync >= vmin);
}
-u32
+static u32
range_pixel_clock(struct edid *edid, u8 *t)
{
/* unspecified */
@@ -1091,7 +1013,7 @@ range_pixel_clock(struct edid *edid, u8 *t)
return t[9] * 10000 + 5001;
}
-bool
+static bool
mode_in_range(const struct drm_display_mode *mode, struct edid *edid,
struct detailed_timing *timing)
{
@@ -1119,8 +1041,7 @@ mode_in_range(const struct drm_display_mode *mode, struct edid *edid,
return true;
}
-bool
-valid_inferred_mode(const struct drm_connector *connector,
+static bool valid_inferred_mode(const struct drm_connector *connector,
const struct drm_display_mode *mode)
{
struct drm_display_mode *m;
@@ -1138,7 +1059,7 @@ valid_inferred_mode(const struct drm_connector *connector,
return ok;
}
-int
+static int
drm_dmt_modes_for_range(struct drm_connector *connector, struct edid *edid,
struct detailed_timing *timing)
{
@@ -1163,8 +1084,7 @@ drm_dmt_modes_for_range(struct drm_connector *connector, struct edid *edid,
/* fix up 1366x768 mode from 1368x768;
* GFT/CVT can't express 1366 width which isn't dividable by 8
*/
-void
-fixup_mode_1366x768(struct drm_display_mode *mode)
+static void fixup_mode_1366x768(struct drm_display_mode *mode)
{
if (mode->hdisplay == 1368 && mode->vdisplay == 768) {
mode->hdisplay = 1366;
@@ -1174,7 +1094,7 @@ fixup_mode_1366x768(struct drm_display_mode *mode)
}
}
-int
+static int
drm_gtf_modes_for_range(struct drm_connector *connector, struct edid *edid,
struct detailed_timing *timing)
{
@@ -1202,7 +1122,7 @@ drm_gtf_modes_for_range(struct drm_connector *connector, struct edid *edid,
return modes;
}
-int
+static int
drm_cvt_modes_for_range(struct drm_connector *connector, struct edid *edid,
struct detailed_timing *timing)
{
@@ -1231,7 +1151,7 @@ drm_cvt_modes_for_range(struct drm_connector *connector, struct edid *edid,
return modes;
}
-void
+static void
do_inferred_modes(struct detailed_timing *timing, void *c)
{
struct detailed_mode_closure *closure = c;
@@ -1269,7 +1189,7 @@ do_inferred_modes(struct detailed_timing *timing, void *c)
}
}
-int
+static int
add_inferred_modes(struct drm_connector *connector, struct edid *edid)
{
struct detailed_mode_closure closure = {
@@ -1283,7 +1203,7 @@ add_inferred_modes(struct drm_connector *connector, struct edid *edid)
return closure.modes;
}
-int
+static int
drm_est3_modes(struct drm_connector *connector, struct detailed_timing *timing)
{
int i, j, m, modes = 0;
@@ -1312,7 +1232,7 @@ drm_est3_modes(struct drm_connector *connector, struct detailed_timing *timing)
return modes;
}
-void
+static void
do_established_modes(struct detailed_timing *timing, void *c)
{
struct detailed_mode_closure *closure = c;
@@ -1329,7 +1249,7 @@ do_established_modes(struct detailed_timing *timing, void *c)
* Each EDID block contains a bitmap of the supported "established modes" list
* (defined above). Tease them out and add them to the global modes list.
*/
-int
+static int
add_established_modes(struct drm_connector *connector, struct edid *edid)
{
struct drm_device *dev = connector->dev;
@@ -1359,7 +1279,7 @@ add_established_modes(struct drm_connector *connector, struct edid *edid)
return modes + closure.modes;
}
-void
+static void
do_standard_modes(struct detailed_timing *timing, void *c)
{
struct detailed_mode_closure *closure = c;
@@ -1391,7 +1311,7 @@ do_standard_modes(struct detailed_timing *timing, void *c)
* Standard modes can be calculated using the appropriate standard (DMT,
* GTF or CVT. Grab them from @edid and add them to the list.
*/
-int
+static int
add_standard_modes(struct drm_connector *connector, struct edid *edid)
{
int i, modes = 0;
@@ -1420,8 +1340,7 @@ add_standard_modes(struct drm_connector *connector, struct edid *edid)
return modes + closure.modes;
}
-int
-drm_cvt_modes(struct drm_connector *connector,
+static int drm_cvt_modes(struct drm_connector *connector,
struct detailed_timing *timing)
{
int i, j, modes = 0;
@@ -1470,7 +1389,7 @@ drm_cvt_modes(struct drm_connector *connector,
return modes;
}
-void
+static void
do_cvt_mode(struct detailed_timing *timing, void *c)
{
struct detailed_mode_closure *closure = c;
@@ -1480,7 +1399,7 @@ do_cvt_mode(struct detailed_timing *timing, void *c)
closure->modes += drm_cvt_modes(closure->connector, timing);
}
-int
+static int
add_cvt_modes(struct drm_connector *connector, struct edid *edid)
{
struct detailed_mode_closure closure = {
@@ -1495,7 +1414,7 @@ add_cvt_modes(struct drm_connector *connector, struct edid *edid)
return closure.modes;
}
-void
+static void
do_detailed_mode(struct detailed_timing *timing, void *c)
{
struct detailed_mode_closure *closure = c;
@@ -1523,7 +1442,7 @@ do_detailed_mode(struct detailed_timing *timing, void *c)
* @edid: EDID block to scan
* @quirks: quirks to apply
*/
-int
+static int
add_detailed_modes(struct drm_connector *connector, struct edid *edid,
u32 quirks)
{
@@ -1556,8 +1475,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
/**
* Search EDID for CEA extension block.
*/
-u8 *
-drm_find_cea_extension(struct edid *edid)
+u8 *drm_find_cea_extension(struct edid *edid)
{
u8 *edid_ext = NULL;
int i;
@@ -1584,8 +1502,7 @@ EXPORT_SYMBOL(drm_find_cea_extension);
* Looks for a CEA mode matching given drm_display_mode.
* Returns its CEA Video ID code, or 0 if not found.
*/
-u8
-drm_match_cea_mode(struct drm_display_mode *to_match)
+u8 drm_match_cea_mode(struct drm_display_mode *to_match)
{
struct drm_display_mode *cea_mode;
u8 mode;
@@ -1601,7 +1518,7 @@ drm_match_cea_mode(struct drm_display_mode *to_match)
EXPORT_SYMBOL(drm_match_cea_mode);
-int
+static int
do_cea_modes (struct drm_connector *connector, u8 *db, u8 len)
{
struct drm_device *dev = connector->dev;
@@ -1624,25 +1541,25 @@ do_cea_modes (struct drm_connector *connector, u8 *db, u8 len)
return modes;
}
-int
+static int
cea_db_payload_len(const u8 *db)
{
return db[0] & 0x1f;
}
-int
+static int
cea_db_tag(const u8 *db)
{
return db[0] >> 5;
}
-int
+static int
cea_revision(const u8 *cea)
{
return cea[1];
}
-int
+static int
cea_db_offsets(const u8 *cea, int *start, int *end)
{
/* Data block offset in CEA extension block */
@@ -1658,7 +1575,7 @@ cea_db_offsets(const u8 *cea, int *start, int *end)
#define for_each_cea_db(cea, i, start, end) \
for ((i) = (start); (i) < (end) && (i) + cea_db_payload_len(&(cea)[(i)]) < (end); (i) += cea_db_payload_len(&(cea)[(i)]) + 1)
-int
+static int
add_cea_modes(struct drm_connector *connector, struct edid *edid)
{
u8 * cea = drm_find_cea_extension(edid);
@@ -1683,7 +1600,7 @@ add_cea_modes(struct drm_connector *connector, struct edid *edid)
return modes;
}
-void
+static void
parse_hdmi_vsdb(struct drm_connector *connector, const u8 *db)
{
u8 len = cea_db_payload_len(db);
@@ -1722,15 +1639,14 @@ parse_hdmi_vsdb(struct drm_connector *connector, const u8 *db)
connector->audio_latency[1]);
}
-void
+static void
monitor_name(struct detailed_timing *t, void *data)
{
if (t->data.other_data.type == EDID_DETAIL_MONITOR_NAME)
*(u8 **)data = t->data.other_data.data.str.str;
}
-bool
-cea_db_is_hdmi_vsdb(const u8 *db)
+static bool cea_db_is_hdmi_vsdb(const u8 *db)
{
int hdmi_id;
@@ -1756,8 +1672,7 @@ cea_db_is_hdmi_vsdb(const u8 *db)
* - HDCP
* - Port_ID
*/
-void
-drm_edid_to_eld(struct drm_connector *connector, struct edid *edid)
+void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid)
{
uint8_t *eld = connector->eld;
u8 *cea;
@@ -1838,8 +1753,7 @@ EXPORT_SYMBOL(drm_edid_to_eld);
* @connector: connector associated with the HDMI/DP sink
* @mode: the display mode
*/
-int
-drm_av_sync_delay(struct drm_connector *connector,
+int drm_av_sync_delay(struct drm_connector *connector,
struct drm_display_mode *mode)
{
int i = !!(mode->flags & DRM_MODE_FLAG_INTERLACE);
@@ -1880,8 +1794,7 @@ EXPORT_SYMBOL(drm_av_sync_delay);
* It's possible for one encoder to be associated with multiple HDMI/DP sinks.
* The policy is now hard coded to simply use the first HDMI/DP sink's ELD.
*/
-struct drm_connector *
-drm_select_eld(struct drm_encoder *encoder,
+struct drm_connector *drm_select_eld(struct drm_encoder *encoder,
struct drm_display_mode *mode)
{
struct drm_connector *connector;
@@ -1902,8 +1815,7 @@ EXPORT_SYMBOL(drm_select_eld);
* Parse the CEA extension according to CEA-861-B.
* Return true if HDMI, false if not or unknown.
*/
-bool
-drm_detect_hdmi_monitor(struct edid *edid)
+bool drm_detect_hdmi_monitor(struct edid *edid)
{
u8 *edid_ext;
int i;
@@ -1939,8 +1851,7 @@ EXPORT_SYMBOL(drm_detect_hdmi_monitor);
* audio' is not defined in EDID.
*
*/
-bool
-drm_detect_monitor_audio(struct edid *edid)
+bool drm_detect_monitor_audio(struct edid *edid)
{
u8 *edid_ext;
int i, j;
@@ -1984,8 +1895,7 @@ EXPORT_SYMBOL(drm_detect_monitor_audio);
* structure that's part of the connector. Useful for tracking bpp and
* color spaces.
*/
-void
-drm_add_display_info(struct edid *edid,
+static void drm_add_display_info(struct edid *edid,
struct drm_display_info *info)
{
u8 *edid_ext;
@@ -2061,8 +1971,7 @@ drm_add_display_info(struct edid *edid,
*
* Return number of modes added or 0 if we couldn't find any.
*/
-int
-drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
+int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
{
int num_modes = 0;
u32 quirks;
@@ -2120,8 +2029,7 @@ EXPORT_SYMBOL(drm_add_edid_modes);
*
* Return number of modes added or 0 if we couldn't find any.
*/
-int
-drm_add_modes_noedid(struct drm_connector *connector,
+int drm_add_modes_noedid(struct drm_connector *connector,
int hdisplay, int vdisplay)
{
int i, count, num_modes = 0;
@@ -2165,8 +2073,7 @@ EXPORT_SYMBOL(drm_add_modes_noedid);
* RETURNS:
* The VIC number, 0 in case it's not a CEA-861 mode.
*/
-uint8_t
-drm_mode_cea_vic(const struct drm_display_mode *mode)
+uint8_t drm_mode_cea_vic(const struct drm_display_mode *mode)
{
uint8_t i;
diff --git a/sys/dev/pci/drm/drm_fb_helper.c b/sys/dev/pci/drm/drm_fb_helper.c
index b482fa517e5..67c03a69fb3 100644
--- a/sys/dev/pci/drm/drm_fb_helper.c
+++ b/sys/dev/pci/drm/drm_fb_helper.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_fb_helper.c,v 1.4 2013/08/12 04:11:52 jsg Exp $ */
+/* $OpenBSD: drm_fb_helper.c,v 1.5 2013/09/02 06:25:28 jsg Exp $ */
/*
* Copyright (c) 2006-2009 Red Hat Inc.
* Copyright (c) 2006-2008 Intel Corporation
@@ -35,34 +35,6 @@
#include "drm_fb_helper.h"
#include "drm_crtc_helper.h"
-bool drm_fb_helper_connector_parse_command_line(
- struct drm_fb_helper_connector *, const char *);
-int fb_get_options(const char *, char **);
-int drm_fb_helper_parse_command_line(struct drm_fb_helper *);
-void drm_fb_helper_crtc_free(struct drm_fb_helper *);
-struct drm_display_mode *drm_has_preferred_mode(
- struct drm_fb_helper_connector *, int, int);
-int drm_fb_helper_probe_connector_modes(struct drm_fb_helper *,
- uint32_t, uint32_t);
-bool drm_has_cmdline_mode(struct drm_fb_helper_connector *);
-struct drm_display_mode *drm_pick_cmdline_mode(struct drm_fb_helper_connector *,
- int, int);
-bool drm_connector_enabled(struct drm_connector *, bool);
-void drm_enable_connectors(struct drm_fb_helper *, bool *);
-bool drm_target_cloned(struct drm_fb_helper *, struct drm_display_mode **,
- bool *, int, int);
-bool drm_target_preferred(struct drm_fb_helper *,
- struct drm_display_mode **, bool *, int, int);
-int drm_pick_crtcs(struct drm_fb_helper *, struct drm_fb_helper_crtc **,
- struct drm_display_mode **, int, int, int);
-void drm_setup_crtcs(struct drm_fb_helper *);
-void drm_fb_helper_save_lut_atomic(struct drm_crtc *,
- struct drm_fb_helper *);
-void drm_fb_helper_restore_lut_atomic(struct drm_crtc *);
-struct drm_framebuffer *
- drm_mode_config_fb(struct drm_crtc *);
-bool drm_fb_helper_force_kernel_mode(void);
-
static DRM_LIST_HEAD(kernel_fb_helper_list);
/**
@@ -75,8 +47,7 @@ static DRM_LIST_HEAD(kernel_fb_helper_list);
*/
/* simple single crtc case helper function */
-int
-drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper)
+int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper)
{
struct drm_device *dev = fb_helper->dev;
struct drm_connector *connector;
@@ -104,8 +75,7 @@ fail:
}
EXPORT_SYMBOL(drm_fb_helper_single_add_all_connectors);
-int
-drm_fb_helper_parse_command_line(struct drm_fb_helper *fb_helper)
+static int drm_fb_helper_parse_command_line(struct drm_fb_helper *fb_helper)
{
struct drm_fb_helper_connector *fb_helper_conn;
int i;
@@ -161,8 +131,7 @@ drm_fb_helper_parse_command_line(struct drm_fb_helper *fb_helper)
return 0;
}
-void
-drm_fb_helper_save_lut_atomic(struct drm_crtc *crtc, struct drm_fb_helper *helper)
+static void drm_fb_helper_save_lut_atomic(struct drm_crtc *crtc, struct drm_fb_helper *helper)
{
uint16_t *r_base, *g_base, *b_base;
int i;
@@ -175,8 +144,7 @@ drm_fb_helper_save_lut_atomic(struct drm_crtc *crtc, struct drm_fb_helper *helpe
helper->funcs->gamma_get(crtc, &r_base[i], &g_base[i], &b_base[i], i);
}
-void
-drm_fb_helper_restore_lut_atomic(struct drm_crtc *crtc)
+static void drm_fb_helper_restore_lut_atomic(struct drm_crtc *crtc)
{
uint16_t *r_base, *g_base, *b_base;
@@ -190,8 +158,7 @@ drm_fb_helper_restore_lut_atomic(struct drm_crtc *crtc)
crtc->funcs->gamma_set(crtc, r_base, g_base, b_base, 0, crtc->gamma_size);
}
-int
-drm_fb_helper_debug_enter(struct drm_fb_helper *helper)
+int drm_fb_helper_debug_enter(struct drm_fb_helper *helper)
{
struct drm_crtc_helper_funcs *funcs;
int i;
@@ -222,8 +189,7 @@ drm_fb_helper_debug_enter(struct drm_fb_helper *helper)
EXPORT_SYMBOL(drm_fb_helper_debug_enter);
/* Find the real fb for a given fb helper CRTC */
-struct drm_framebuffer *
-drm_mode_config_fb(struct drm_crtc *crtc)
+static struct drm_framebuffer *drm_mode_config_fb(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct drm_crtc *c;
@@ -236,8 +202,7 @@ drm_mode_config_fb(struct drm_crtc *crtc)
return NULL;
}
-int
-drm_fb_helper_debug_leave(struct drm_fb_helper *helper)
+int drm_fb_helper_debug_leave(struct drm_fb_helper *helper)
{
struct drm_crtc *crtc;
struct drm_crtc_helper_funcs *funcs;
@@ -267,8 +232,7 @@ drm_fb_helper_debug_leave(struct drm_fb_helper *helper)
}
EXPORT_SYMBOL(drm_fb_helper_debug_leave);
-bool
-drm_fb_helper_restore_fbdev_mode(struct drm_fb_helper *fb_helper)
+bool drm_fb_helper_restore_fbdev_mode(struct drm_fb_helper *fb_helper)
{
bool error = false;
int i, ret;
@@ -282,8 +246,7 @@ drm_fb_helper_restore_fbdev_mode(struct drm_fb_helper *fb_helper)
}
EXPORT_SYMBOL(drm_fb_helper_restore_fbdev_mode);
-bool
-drm_fb_helper_force_kernel_mode(void)
+static bool drm_fb_helper_force_kernel_mode(void)
{
bool ret, error = false;
struct drm_fb_helper *helper;
@@ -305,8 +268,7 @@ drm_fb_helper_force_kernel_mode(void)
}
#if 0
-int
-drm_fb_helper_panic(struct notifier_block *n, unsigned long ununsed,
+int drm_fb_helper_panic(struct notifier_block *n, unsigned long ununsed,
void *panic_str)
{
/*
@@ -331,8 +293,7 @@ static struct notifier_block paniced = {
*
* Restore's the kernel's fbcon mode, used for lastclose & panic paths.
*/
-void
-drm_fb_helper_restore(void)
+void drm_fb_helper_restore(void)
{
bool ret;
ret = drm_fb_helper_force_kernel_mode();
@@ -343,15 +304,13 @@ EXPORT_SYMBOL(drm_fb_helper_restore);
#if 0
#ifdef CONFIG_MAGIC_SYSRQ
-void
-drm_fb_helper_restore_work_fn(struct work_struct *ignored)
+static void drm_fb_helper_restore_work_fn(struct work_struct *ignored)
{
drm_fb_helper_restore();
}
static DECLARE_WORK(drm_fb_helper_restore_work, drm_fb_helper_restore_work_fn);
-void
-drm_fb_helper_sysrq(int dummy1)
+static void drm_fb_helper_sysrq(int dummy1)
{
schedule_work(&drm_fb_helper_restore_work);
}
@@ -366,8 +325,7 @@ static struct sysrq_key_op sysrq_drm_fb_helper_restore_op = { };
#endif
#endif
-void
-drm_fb_helper_dpms(struct drm_fb_helper *fb_helper, int dpms_mode)
+void drm_fb_helper_dpms(struct drm_fb_helper *fb_helper, int dpms_mode)
{
struct drm_device *dev = fb_helper->dev;
struct drm_crtc *crtc;
@@ -396,8 +354,7 @@ drm_fb_helper_dpms(struct drm_fb_helper *fb_helper, int dpms_mode)
}
#if 0
-int
-drm_fb_helper_blank(int blank, struct fb_info *info)
+int drm_fb_helper_blank(int blank, struct fb_info *info)
{
switch (blank) {
/* Display: On; HSync: On, VSync: On */
@@ -426,8 +383,7 @@ drm_fb_helper_blank(int blank, struct fb_info *info)
EXPORT_SYMBOL(drm_fb_helper_blank);
#endif
-void
-drm_fb_helper_crtc_free(struct drm_fb_helper *helper)
+static void drm_fb_helper_crtc_free(struct drm_fb_helper *helper)
{
int i;
@@ -442,8 +398,7 @@ drm_fb_helper_crtc_free(struct drm_fb_helper *helper)
free(helper->crtc_info, M_DRM);
}
-int
-drm_fb_helper_init(struct drm_device *dev,
+int drm_fb_helper_init(struct drm_device *dev,
struct drm_fb_helper *fb_helper,
int crtc_count, int max_conn_count)
{
@@ -492,8 +447,7 @@ out_free:
}
EXPORT_SYMBOL(drm_fb_helper_init);
-void
-drm_fb_helper_fini(struct drm_fb_helper *fb_helper)
+void drm_fb_helper_fini(struct drm_fb_helper *fb_helper)
{
if (!list_empty(&fb_helper->kernel_fb_list)) {
list_del(&fb_helper->kernel_fb_list);
@@ -513,8 +467,7 @@ drm_fb_helper_fini(struct drm_fb_helper *fb_helper)
EXPORT_SYMBOL(drm_fb_helper_fini);
#if 0
-int
-setcolreg(struct drm_crtc *crtc, u16 red, u16 green,
+static int setcolreg(struct drm_crtc *crtc, u16 red, u16 green,
u16 blue, u16 regno, struct fb_info *info)
{
struct drm_fb_helper *fb_helper = info->par;
@@ -580,8 +533,7 @@ setcolreg(struct drm_crtc *crtc, u16 red, u16 green,
#endif
#if 0
-int
-drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info)
+int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info)
{
struct drm_fb_helper *fb_helper = info->par;
struct drm_crtc_helper_funcs *crtc_funcs;
@@ -622,8 +574,7 @@ EXPORT_SYMBOL(drm_fb_helper_setcmap);
#endif
#if 0
-int
-drm_fb_helper_check_var(struct fb_var_screeninfo *var,
+int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
struct fb_info *info)
{
struct drm_fb_helper *fb_helper = info->par;
@@ -718,8 +669,7 @@ EXPORT_SYMBOL(drm_fb_helper_check_var);
#if 0
/* this will let fbcon do the mode init */
-int
-drm_fb_helper_set_par(struct fb_info *info)
+int drm_fb_helper_set_par(struct fb_info *info)
{
struct drm_fb_helper *fb_helper = info->par;
struct drm_device *dev = fb_helper->dev;
@@ -754,8 +704,7 @@ EXPORT_SYMBOL(drm_fb_helper_set_par);
#endif
#if 0
-int
-drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
+int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info)
{
struct drm_fb_helper *fb_helper = info->par;
@@ -788,8 +737,7 @@ drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
EXPORT_SYMBOL(drm_fb_helper_pan_display);
#endif
-int
-drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
+int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
int preferred_bpp)
{
int new_fb = 0;
@@ -914,8 +862,7 @@ drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
EXPORT_SYMBOL(drm_fb_helper_single_fb_probe);
#if 0
-void
-drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
+void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
uint32_t depth)
{
info->fix.type = FB_TYPE_PACKED_PIXELS;
@@ -935,8 +882,7 @@ drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
}
EXPORT_SYMBOL(drm_fb_helper_fill_fix);
-void
-drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper,
+void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper,
uint32_t fb_width, uint32_t fb_height)
{
struct drm_framebuffer *fb = fb_helper->fb;
@@ -1011,8 +957,7 @@ drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper,
EXPORT_SYMBOL(drm_fb_helper_fill_var);
#endif
-int
-drm_fb_helper_probe_connector_modes(struct drm_fb_helper *fb_helper,
+static int drm_fb_helper_probe_connector_modes(struct drm_fb_helper *fb_helper,
uint32_t maxX,
uint32_t maxY)
{
@@ -1028,8 +973,7 @@ drm_fb_helper_probe_connector_modes(struct drm_fb_helper *fb_helper,
return count;
}
-struct drm_display_mode *
-drm_has_preferred_mode(struct drm_fb_helper_connector *fb_connector, int width, int height)
+static struct drm_display_mode *drm_has_preferred_mode(struct drm_fb_helper_connector *fb_connector, int width, int height)
{
struct drm_display_mode *mode;
@@ -1043,16 +987,14 @@ drm_has_preferred_mode(struct drm_fb_helper_connector *fb_connector, int width,
return NULL;
}
-bool
-drm_has_cmdline_mode(struct drm_fb_helper_connector *fb_connector)
+static bool drm_has_cmdline_mode(struct drm_fb_helper_connector *fb_connector)
{
struct drm_cmdline_mode *cmdline_mode;
cmdline_mode = &fb_connector->cmdline_mode;
return cmdline_mode->specified;
}
-struct drm_display_mode *
-drm_pick_cmdline_mode(struct drm_fb_helper_connector *fb_helper_conn,
+static struct drm_display_mode *drm_pick_cmdline_mode(struct drm_fb_helper_connector *fb_helper_conn,
int width, int height)
{
struct drm_cmdline_mode *cmdline_mode;
@@ -1093,8 +1035,7 @@ create_mode:
return mode;
}
-bool
-drm_connector_enabled(struct drm_connector *connector, bool strict)
+static bool drm_connector_enabled(struct drm_connector *connector, bool strict)
{
bool enable;
@@ -1106,8 +1047,7 @@ drm_connector_enabled(struct drm_connector *connector, bool strict)
return enable;
}
-void
-drm_enable_connectors(struct drm_fb_helper *fb_helper,
+static void drm_enable_connectors(struct drm_fb_helper *fb_helper,
bool *enabled)
{
bool any_enabled = false;
@@ -1131,8 +1071,7 @@ drm_enable_connectors(struct drm_fb_helper *fb_helper,
}
}
-bool
-drm_target_cloned(struct drm_fb_helper *fb_helper,
+static bool drm_target_cloned(struct drm_fb_helper *fb_helper,
struct drm_display_mode **modes,
bool *enabled, int width, int height)
{
@@ -1205,8 +1144,7 @@ drm_target_cloned(struct drm_fb_helper *fb_helper,
return false;
}
-bool
-drm_target_preferred(struct drm_fb_helper *fb_helper,
+static bool drm_target_preferred(struct drm_fb_helper *fb_helper,
struct drm_display_mode **modes,
bool *enabled, int width, int height)
{
@@ -1240,8 +1178,7 @@ drm_target_preferred(struct drm_fb_helper *fb_helper,
return true;
}
-int
-drm_pick_crtcs(struct drm_fb_helper *fb_helper,
+static int drm_pick_crtcs(struct drm_fb_helper *fb_helper,
struct drm_fb_helper_crtc **best_crtcs,
struct drm_display_mode **modes,
int n, int width, int height)
@@ -1325,8 +1262,7 @@ out:
return best_score;
}
-void
-drm_setup_crtcs(struct drm_fb_helper *fb_helper)
+static void drm_setup_crtcs(struct drm_fb_helper *fb_helper)
{
struct drm_device *dev = fb_helper->dev;
struct drm_fb_helper_crtc **crtcs;
@@ -1414,8 +1350,7 @@ out:
* RETURNS:
* Zero if everything went ok, nonzero otherwise.
*/
-bool
-drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel)
+bool drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel)
{
struct drm_device *dev = fb_helper->dev;
int count = 0;
@@ -1454,8 +1389,7 @@ EXPORT_SYMBOL(drm_fb_helper_initial_config);
* RETURNS:
* 0 on success and a non-zero error code otherwise.
*/
-int
-drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper)
+int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper)
{
struct drm_device *dev = fb_helper->dev;
int count = 0;
@@ -1500,8 +1434,7 @@ EXPORT_SYMBOL(drm_fb_helper_hotplug_event);
* attempt to load fbcon to avoid leaving the system without a usable console.
*/
#if defined(CONFIG_FRAMEBUFFER_CONSOLE_MODULE) && !defined(CONFIG_EXPERT)
-int
-__init drm_fb_helper_modinit(void)
+static int __init drm_fb_helper_modinit(void)
{
const char *name = "fbcon";
struct module *fbcon;
diff --git a/sys/dev/pci/drm/drm_irq.c b/sys/dev/pci/drm/drm_irq.c
index 83270740ace..35cc10318b5 100644
--- a/sys/dev/pci/drm/drm_irq.c
+++ b/sys/dev/pci/drm/drm_irq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_irq.c,v 1.47 2013/08/12 04:11:52 jsg Exp $ */
+/* $OpenBSD: drm_irq.c,v 1.48 2013/09/02 06:25:28 jsg Exp $ */
/**
* \file drm_irq.c
* IRQ support
@@ -54,22 +54,8 @@
*/
#define DRM_REDUNDANT_VBLIRQ_THRESH_NS 1000000
-void clear_vblank_timestamps(struct drm_device *, int);
-void vblank_disable_and_save(struct drm_device *, int);
-u32 drm_get_last_vbltimestamp(struct drm_device *, int, struct timeval *,
- unsigned);
-void vblank_disable_fn(void *);
int64_t timeval_to_ns(const struct timeval *);
struct timeval ns_to_timeval(const int64_t);
-void drm_irq_vgaarb_nokms(void *, bool);
-struct timeval get_drm_timestamp(void);
-void send_vblank_event(struct drm_device *,
- struct drm_pending_vblank_event *, unsigned long,
- struct timeval *);
-void drm_update_vblank_count(struct drm_device *, int);
-int drm_queue_vblank_event(struct drm_device *, int,
- union drm_wait_vblank *, struct drm_file *);
-void drm_handle_vblank_events(struct drm_device *, int);
#ifdef DRM_VBLANK_DEBUG
#define DPRINTF(x...) do { printf(x); } while(/* CONSTCOND */ 0)
@@ -98,8 +84,8 @@ unsigned int drm_timestamp_monotonic = 1;
* This IOCTL is deprecated, and will now return EINVAL for any busid not equal
* to that of the device that this DRM instance attached to.
*/
-int
-drm_irq_by_busid(struct drm_device *dev, void *data, struct drm_file *file_priv)
+int drm_irq_by_busid(struct drm_device *dev, void *data,
+ struct drm_file *file_priv)
{
struct drm_irq_busid *irq = data;
@@ -119,8 +105,7 @@ drm_irq_by_busid(struct drm_device *dev, void *data, struct drm_file *file_priv)
/*
* Clear vblank timestamp buffer for a crtc.
*/
-void
-clear_vblank_timestamps(struct drm_device *dev, int crtc)
+static void clear_vblank_timestamps(struct drm_device *dev, int crtc)
{
memset(&dev->_vblank_time[crtc * DRM_VBLANKTIME_RBSIZE], 0,
DRM_VBLANKTIME_RBSIZE * sizeof(struct timeval));
@@ -170,8 +155,7 @@ abs64(int64_t x)
* are preserved, even if there are any spurious vblank irq's after
* disable.
*/
-void
-vblank_disable_and_save(struct drm_device *dev, int crtc)
+static void vblank_disable_and_save(struct drm_device *dev, int crtc)
{
u32 vblcount;
s64 diff_ns;
@@ -239,8 +223,7 @@ vblank_disable_and_save(struct drm_device *dev, int crtc)
mtx_leave(&dev->vblank_time_lock);
}
-void
-vblank_disable_fn(void *arg)
+static void vblank_disable_fn(void *arg)
{
struct drm_device *dev = (struct drm_device *)arg;
int i;
@@ -259,8 +242,7 @@ vblank_disable_fn(void *arg)
}
}
-void
-drm_vblank_cleanup(struct drm_device *dev)
+void drm_vblank_cleanup(struct drm_device *dev)
{
/* Bail if the driver didn't call drm_vblank_init() */
if (dev->num_crtcs == 0)
@@ -281,9 +263,9 @@ drm_vblank_cleanup(struct drm_device *dev)
dev->num_crtcs = 0;
}
+EXPORT_SYMBOL(drm_vblank_cleanup);
-int
-drm_vblank_init(struct drm_device *dev, int num_crtcs)
+int drm_vblank_init(struct drm_device *dev, int num_crtcs)
{
int i, ret = -ENOMEM;
@@ -355,9 +337,10 @@ err:
drm_vblank_cleanup(dev);
return ret;
}
+EXPORT_SYMBOL(drm_vblank_init);
-void
-drm_irq_vgaarb_nokms(void *cookie, bool state)
+#ifdef notyet
+static void drm_irq_vgaarb_nokms(void *cookie, bool state)
{
struct drm_device *dev = cookie;
@@ -381,6 +364,7 @@ drm_irq_vgaarb_nokms(void *cookie, bool state)
dev->driver->irq_postinstall(dev);
}
}
+#endif
/**
* Install IRQ handler.
@@ -391,8 +375,7 @@ drm_irq_vgaarb_nokms(void *cookie, bool state)
* \c irq_preinstall() and \c irq_postinstall() functions
* before and after the installation.
*/
-int
-drm_irq_install(struct drm_device *dev)
+int drm_irq_install(struct drm_device *dev)
{
int ret;
@@ -426,6 +409,7 @@ err:
DRM_UNLOCK();
return (ret);
}
+EXPORT_SYMBOL(drm_irq_install);
/**
* Uninstall the IRQ handler.
@@ -434,8 +418,7 @@ err:
*
* Calls the driver's \c irq_uninstall() function, and stops the irq.
*/
-int
-drm_irq_uninstall(struct drm_device *dev)
+int drm_irq_uninstall(struct drm_device *dev)
{
int i;
@@ -470,6 +453,7 @@ drm_irq_uninstall(struct drm_device *dev)
return (0);
}
+EXPORT_SYMBOL(drm_irq_uninstall);
/**
* IRQ control ioctl.
@@ -482,8 +466,8 @@ drm_irq_uninstall(struct drm_device *dev)
*
* Calls irq_install() or irq_uninstall() according to \p arg.
*/
-int
-drm_control(struct drm_device *dev, void *data, struct drm_file *file_priv)
+int drm_control(struct drm_device *dev, void *data,
+ struct drm_file *file_priv)
{
struct drm_control *ctl = data;
@@ -520,8 +504,7 @@ drm_control(struct drm_device *dev, void *data, struct drm_file *file_priv)
* @crtc drm_crtc whose timestamp constants should be updated.
*
*/
-void
-drm_calc_timestamping_constants(struct drm_crtc *crtc)
+void drm_calc_timestamping_constants(struct drm_crtc *crtc)
{
s64 linedur_ns = 0, pixeldur_ns = 0, framedur_ns = 0;
u64 dotclock;
@@ -560,6 +543,7 @@ drm_calc_timestamping_constants(struct drm_crtc *crtc)
crtc->base.id, (int) dotclock/1000, (int) framedur_ns,
(int) linedur_ns, (int) pixeldur_ns);
}
+EXPORT_SYMBOL(drm_calc_timestamping_constants);
/**
* drm_calc_vbltimestamp_from_scanoutpos - helper routine for kms
@@ -605,8 +589,7 @@ drm_calc_timestamping_constants(struct drm_crtc *crtc)
* DRM_VBLANKTIME_INVBL - Timestamp taken while scanout was in vblank interval.
*
*/
-int
-drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc,
+int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc,
int *max_error,
struct timeval *vblank_time,
unsigned flags,
@@ -756,9 +739,9 @@ drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc,
return vbl_status;
}
+EXPORT_SYMBOL(drm_calc_vbltimestamp_from_scanoutpos);
-struct timeval
-get_drm_timestamp(void)
+static struct timeval get_drm_timestamp(void)
{
struct timeval now;
@@ -791,8 +774,7 @@ get_drm_timestamp(void)
*
* Returns non-zero if timestamp is considered to be very precise.
*/
-u32
-drm_get_last_vbltimestamp(struct drm_device *dev, int crtc,
+u32 drm_get_last_vbltimestamp(struct drm_device *dev, int crtc,
struct timeval *tvblank, unsigned flags)
{
int ret;
@@ -815,6 +797,7 @@ drm_get_last_vbltimestamp(struct drm_device *dev, int crtc,
return 0;
}
+EXPORT_SYMBOL(drm_get_last_vbltimestamp);
/**
* drm_vblank_count - retrieve "cooked" vblank counter value
@@ -825,11 +808,11 @@ drm_get_last_vbltimestamp(struct drm_device *dev, int crtc,
* vblank events since the system was booted, including lost events due to
* modesetting activity.
*/
-u32
-drm_vblank_count(struct drm_device *dev, int crtc)
+u32 drm_vblank_count(struct drm_device *dev, int crtc)
{
return atomic_read(&dev->_vblank_count[crtc]);
}
+EXPORT_SYMBOL(drm_vblank_count);
/**
* drm_vblank_count_and_time - retrieve "cooked" vblank counter value
@@ -845,8 +828,7 @@ drm_vblank_count(struct drm_device *dev, int crtc)
* of the vblank interval that corresponds to the current value vblank counter
* value.
*/
-u32
-drm_vblank_count_and_time(struct drm_device *dev, int crtc,
+u32 drm_vblank_count_and_time(struct drm_device *dev, int crtc,
struct timeval *vblanktime)
{
u32 cur_vblank;
@@ -864,9 +846,9 @@ drm_vblank_count_and_time(struct drm_device *dev, int crtc,
return cur_vblank;
}
+EXPORT_SYMBOL(drm_vblank_count_and_time);
-void
-send_vblank_event(struct drm_device *dev,
+static void send_vblank_event(struct drm_device *dev,
struct drm_pending_vblank_event *e,
unsigned long seq, struct timeval *now)
{
@@ -894,8 +876,7 @@ send_vblank_event(struct drm_device *dev,
* Updates sequence # and timestamp on event, and sends it to userspace.
* Caller must hold event lock.
*/
-void
-drm_send_vblank_event(struct drm_device *dev, int crtc,
+void drm_send_vblank_event(struct drm_device *dev, int crtc,
struct drm_pending_vblank_event *e)
{
struct timeval now;
@@ -909,6 +890,7 @@ drm_send_vblank_event(struct drm_device *dev, int crtc,
}
send_vblank_event(dev, e, seq, &now);
}
+EXPORT_SYMBOL(drm_send_vblank_event);
/**
* drm_update_vblank_count - update the master vblank counter
@@ -926,8 +908,7 @@ drm_send_vblank_event(struct drm_device *dev, int crtc,
* Note: caller must hold dev->vbl_lock since this reads & writes
* device vblank fields.
*/
-void
-drm_update_vblank_count(struct drm_device *dev, int crtc)
+static void drm_update_vblank_count(struct drm_device *dev, int crtc)
{
u32 cur_vblank, diff, tslot, rc;
struct timeval t_vblank;
@@ -986,8 +967,7 @@ drm_update_vblank_count(struct drm_device *dev, int crtc)
* RETURNS
* Zero on success, nonzero on failure.
*/
-int
-drm_vblank_get(struct drm_device *dev, int crtc)
+int drm_vblank_get(struct drm_device *dev, int crtc)
{
int ret = 0;
@@ -1023,6 +1003,7 @@ drm_vblank_get(struct drm_device *dev, int crtc)
return ret;
}
+EXPORT_SYMBOL(drm_vblank_get);
/**
* drm_vblank_put - give up ownership of vblank events
@@ -1032,8 +1013,7 @@ drm_vblank_get(struct drm_device *dev, int crtc)
* Release ownership of a given vblank counter, turning off interrupts
* if possible. Disable interrupts after drm_vblank_offdelay milliseconds.
*/
-void
-drm_vblank_put(struct drm_device *dev, int crtc)
+void drm_vblank_put(struct drm_device *dev, int crtc)
{
BUG_ON(atomic_read(&dev->vblank_refcount[crtc]) == 0);
@@ -1050,8 +1030,7 @@ drm_vblank_put(struct drm_device *dev, int crtc)
*
* Caller must hold event lock.
*/
-void
-drm_vblank_off(struct drm_device *dev, int crtc)
+void drm_vblank_off(struct drm_device *dev, int crtc)
{
struct drmevlist *list;
struct drm_pending_event *ev, *tmp;
@@ -1095,8 +1074,7 @@ drm_vblank_off(struct drm_device *dev, int crtc)
* Account for vblank events across mode setting events, which will likely
* reset the hardware frame counter.
*/
-void
-drm_vblank_pre_modeset(struct drm_device *dev, int crtc)
+void drm_vblank_pre_modeset(struct drm_device *dev, int crtc)
{
/* vblank is not initialized (IRQ not installed ?) */
if (!dev->num_crtcs)
@@ -1114,9 +1092,9 @@ drm_vblank_pre_modeset(struct drm_device *dev, int crtc)
dev->vblank_inmodeset[crtc] |= 0x2;
}
}
+EXPORT_SYMBOL(drm_vblank_pre_modeset);
-void
-drm_vblank_post_modeset(struct drm_device *dev, int crtc)
+void drm_vblank_post_modeset(struct drm_device *dev, int crtc)
{
if (dev->vblank_inmodeset[crtc]) {
mtx_enter(&dev->vbl_lock);
@@ -1129,6 +1107,7 @@ drm_vblank_post_modeset(struct drm_device *dev, int crtc)
dev->vblank_inmodeset[crtc] = 0;
}
}
+EXPORT_SYMBOL(drm_vblank_post_modeset);
/**
* drm_modeset_ctl - handle vblank event counter changes across mode switch
@@ -1141,8 +1120,7 @@ drm_vblank_post_modeset(struct drm_device *dev, int crtc)
* enabled around this call, we don't have to do anything since the counter
* will have already been incremented.
*/
-int
-drm_modeset_ctl(struct drm_device *dev, void *data,
+int drm_modeset_ctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
struct drm_modeset_ctl *modeset = data;
@@ -1174,8 +1152,7 @@ drm_modeset_ctl(struct drm_device *dev, void *data,
return 0;
}
-int
-drm_queue_vblank_event(struct drm_device *dev, int pipe,
+static int drm_queue_vblank_event(struct drm_device *dev, int pipe,
union drm_wait_vblank *vblwait,
struct drm_file *file_priv)
{
@@ -1260,8 +1237,7 @@ err_put:
* the vblank interrupt refcount afterwards. (vblank irq disable follows that
* after a timeout with no further vblank waits scheduled).
*/
-int
-drm_wait_vblank(struct drm_device *dev, void *data,
+int drm_wait_vblank(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
union drm_wait_vblank *vblwait = data;
@@ -1349,8 +1325,7 @@ done:
return ret;
}
-void
-drm_handle_vblank_events(struct drm_device *dev, int crtc)
+static void drm_handle_vblank_events(struct drm_device *dev, int crtc)
{
struct drmevlist *list;
struct drm_pending_event *ev, *tmp;
@@ -1394,8 +1369,7 @@ drm_handle_vblank_events(struct drm_device *dev, int crtc)
* Drivers should call this routine in their vblank interrupt handlers to
* update the vblank counter and send any signals that may be pending.
*/
-bool
-drm_handle_vblank(struct drm_device *dev, int crtc)
+bool drm_handle_vblank(struct drm_device *dev, int crtc)
{
u32 vblcount;
s64 diff_ns;
@@ -1458,3 +1432,4 @@ drm_handle_vblank(struct drm_device *dev, int crtc)
mtx_leave(&dev->vblank_time_lock);
return true;
}
+EXPORT_SYMBOL(drm_handle_vblank);
diff --git a/sys/dev/pci/drm/drm_modes.c b/sys/dev/pci/drm/drm_modes.c
index b9d16b4c777..4d1bae610d6 100644
--- a/sys/dev/pci/drm/drm_modes.c
+++ b/sys/dev/pci/drm/drm_modes.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_modes.c,v 1.2 2013/08/12 04:11:52 jsg Exp $ */
+/* $OpenBSD: drm_modes.c,v 1.3 2013/09/02 06:25:28 jsg Exp $ */
/*
* Copyright © 1997-2003 by The XFree86 Project, Inc.
* Copyright © 2007 Dave Airlie
@@ -38,9 +38,6 @@
void drm_mode_validate_clocks(struct drm_device *, struct list_head *,
int *, int *, int);
-bool drm_mode_parse_command_line_for_connector(const char *,
- struct drm_connector *, struct drm_cmdline_mode *);
-int drm_mode_compare(struct drm_display_mode *, struct drm_display_mode*);
long simple_strtol(const char *, char **, int);
/**
@@ -53,8 +50,7 @@ long simple_strtol(const char *, char **, int);
*
* Describe @mode using DRM_DEBUG.
*/
-void
-drm_mode_debug_printmodeline(const struct drm_display_mode *mode)
+void drm_mode_debug_printmodeline(const struct drm_display_mode *mode)
{
DRM_DEBUG_KMS("Modeline %d:\"%s\" %d %d %d %d %d %d %d %d %d %d "
"0x%x 0x%x\n",
@@ -90,8 +86,7 @@ EXPORT_SYMBOL(drm_mode_debug_printmodeline);
* What I have done is to translate it by using integer calculation.
*/
#define HV_FACTOR 1000
-struct drm_display_mode *
-drm_cvt_mode(struct drm_device *dev, int hdisplay,
+struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, int hdisplay,
int vdisplay, int vrefresh,
bool reduced, bool interlaced, bool margins)
{
@@ -522,8 +517,7 @@ EXPORT_SYMBOL(drm_gtf_mode);
*
* Set the name of @mode to a standard format.
*/
-void
-drm_mode_set_name(struct drm_display_mode *mode)
+void drm_mode_set_name(struct drm_display_mode *mode)
{
bool interlaced = !!(mode->flags & DRM_MODE_FLAG_INTERLACE);
@@ -543,8 +537,7 @@ EXPORT_SYMBOL(drm_mode_set_name);
*
* Move all the modes from @head to @new.
*/
-void
-drm_mode_list_concat(struct list_head *head, struct list_head *new)
+void drm_mode_list_concat(struct list_head *head, struct list_head *new)
{
struct list_head *entry, *tmp;
@@ -569,8 +562,7 @@ EXPORT_SYMBOL(drm_mode_list_concat);
* RETURNS:
* @mode->hdisplay
*/
-int
-drm_mode_width(const struct drm_display_mode *mode)
+int drm_mode_width(const struct drm_display_mode *mode)
{
return mode->hdisplay;
@@ -591,8 +583,7 @@ EXPORT_SYMBOL(drm_mode_width);
* RETURNS:
* @mode->vdisplay
*/
-int
-drm_mode_height(const struct drm_display_mode *mode)
+int drm_mode_height(const struct drm_display_mode *mode)
{
return mode->vdisplay;
}
@@ -606,8 +597,7 @@ EXPORT_SYMBOL(drm_mode_height);
*
* Return @modes's hsync rate in kHz, rounded to the nearest int.
*/
-int
-drm_mode_hsync(const struct drm_display_mode *mode)
+int drm_mode_hsync(const struct drm_display_mode *mode)
{
unsigned int calc_val;
@@ -641,8 +631,7 @@ EXPORT_SYMBOL(drm_mode_hsync);
* If it is 70.288, it will return 70Hz.
* If it is 59.6, it will return 60Hz.
*/
-int
-drm_mode_vrefresh(const struct drm_display_mode *mode)
+int drm_mode_vrefresh(const struct drm_display_mode *mode)
{
int refresh = 0;
unsigned int calc_val;
@@ -678,8 +667,7 @@ EXPORT_SYMBOL(drm_mode_vrefresh);
*
* Setup the CRTC modesetting parameters for @p, adjusting if necessary.
*/
-void
-drm_mode_set_crtcinfo(struct drm_display_mode *p, int adjust_flags)
+void drm_mode_set_crtcinfo(struct drm_display_mode *p, int adjust_flags)
{
if ((p == NULL) || ((p->type & DRM_MODE_TYPE_CRTC_C) == DRM_MODE_TYPE_BUILTIN))
return;
@@ -736,8 +724,7 @@ EXPORT_SYMBOL(drm_mode_set_crtcinfo);
* Copy an existing mode into another mode, preserving the object id
* of the destination mode.
*/
-void
-drm_mode_copy(struct drm_display_mode *dst, const struct drm_display_mode *src)
+void drm_mode_copy(struct drm_display_mode *dst, const struct drm_display_mode *src)
{
int id = dst->base.id;
@@ -757,8 +744,7 @@ EXPORT_SYMBOL(drm_mode_copy);
* Just allocate a new mode, copy the existing mode into it, and return
* a pointer to it. Used to create new instances of established modes.
*/
-struct drm_display_mode *
-drm_mode_duplicate(struct drm_device *dev,
+struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev,
const struct drm_display_mode *mode)
{
struct drm_display_mode *nmode;
@@ -786,8 +772,7 @@ EXPORT_SYMBOL(drm_mode_duplicate);
* RETURNS:
* True if the modes are equal, false otherwise.
*/
-bool
-drm_mode_equal(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2)
+bool drm_mode_equal(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2)
{
/* do clock check convert to PICOS so fb modes get matched
* the same */
@@ -829,8 +814,7 @@ EXPORT_SYMBOL(drm_mode_equal);
* modes we probed for @dev against those limits and set their status as
* necessary.
*/
-void
-drm_mode_validate_size(struct drm_device *dev,
+void drm_mode_validate_size(struct drm_device *dev,
struct list_head *mode_list,
int maxX, int maxY, int maxPitch)
{
@@ -865,8 +849,7 @@ EXPORT_SYMBOL(drm_mode_validate_size);
* sure each mode falls within a given range (defined by @min and @max
* arrays) and sets @mode->status as needed.
*/
-void
-drm_mode_validate_clocks(struct drm_device *dev,
+void drm_mode_validate_clocks(struct drm_device *dev,
struct list_head *mode_list,
int *min, int *max, int n_ranges)
{
@@ -900,8 +883,7 @@ EXPORT_SYMBOL(drm_mode_validate_clocks);
* remove invalid modes from a mode list. If any of the modes have a
* status other than %MODE_OK, they are removed from @mode_list and freed.
*/
-void
-drm_mode_prune_invalid(struct drm_device *dev,
+void drm_mode_prune_invalid(struct drm_device *dev,
struct list_head *mode_list, bool verbose)
{
struct drm_display_mode *mode, *t;
@@ -936,8 +918,7 @@ EXPORT_SYMBOL(drm_mode_prune_invalid);
* Negative if @lh_a is better than @lh_b, zero if they're equivalent, or
* positive if @lh_b is better than @lh_a.
*/
-int
-drm_mode_compare(struct drm_display_mode *a, struct drm_display_mode* b)
+static int drm_mode_compare(struct drm_display_mode *a, struct drm_display_mode* b)
{
int diff;
@@ -965,8 +946,7 @@ RB_HEAD(drm_mode_sort, drm_display_mode);
RB_PROTOTYPE(drm_mode_sort, drm_display_mode, sort, drm_mode_compare);
-void
-drm_mode_sort(struct list_head *mode_list)
+void drm_mode_sort(struct list_head *mode_list)
{
struct drm_display_mode *mode, *t;
struct drm_mode_sort drm_mode_tree;
@@ -979,10 +959,10 @@ drm_mode_sort(struct list_head *mode_list)
RB_FOREACH(mode, drm_mode_sort, &drm_mode_tree)
list_add_tail(&mode->head, mode_list);
}
-RB_GENERATE(drm_mode_sort, drm_display_mode, sort, drm_mode_compare);
-
EXPORT_SYMBOL(drm_mode_sort);
+RB_GENERATE(drm_mode_sort, drm_display_mode, sort, drm_mode_compare);
+
/**
* drm_mode_connector_list_update - update the mode list for the connector
* @connector: the connector to update
@@ -995,8 +975,7 @@ EXPORT_SYMBOL(drm_mode_sort);
* list and only adds different modes. All modes unverified after this point
* will be removed by the prune invalid modes.
*/
-void
-drm_mode_connector_list_update(struct drm_connector *connector)
+void drm_mode_connector_list_update(struct drm_connector *connector)
{
struct drm_display_mode *mode;
struct drm_display_mode *pmode, *pt;
@@ -1039,8 +1018,7 @@ EXPORT_SYMBOL(drm_mode_connector_list_update);
*
* enable/enable Digital/disable bit at the end
*/
-bool
-drm_mode_parse_command_line_for_connector(const char *mode_option,
+bool drm_mode_parse_command_line_for_connector(const char *mode_option,
struct drm_connector *connector,
struct drm_cmdline_mode *mode)
{