<div dir="ltr">Hi,<div>I really don't whether I am doing things on right workflow of dri-devel.</div><div>I am new to this community and I want to help.</div><div>Could anybody spare some time to tell me the right way .</div><div>Thanks.</div><div><br></div><div>John</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 12, 2015 at 4:02 PM, John Hunter <span dir="ltr"><<a href="mailto:zhaojunwang@pku.edu.cn" target="_blank">zhaojunwang@pku.edu.cn</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: John Hunter <<a href="mailto:zhjwpku@gmail.com">zhjwpku@gmail.com</a>><br>
<br>
IMHO, some annotations were copypaste from somewhere else, it is<br>
obviously not rightly modified. Hope I am right with that.<br>
---<br>
drivers/gpu/drm/drm_crtc.c | 115 ++++++++++++++++++++++-----------------------<br>
1 file changed, 56 insertions(+), 59 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c<br>
index f2d667b..7f771e9 100644<br>
--- a/drivers/gpu/drm/drm_crtc.c<br>
+++ b/drivers/gpu/drm/drm_crtc.c<br>
@@ -205,12 +205,12 @@ char *drm_get_connector_status_name(enum drm_connector_status status)<br>
/**<br>
* drm_mode_object_get - allocate a new identifier<br>
* @dev: DRM device<br>
- * @ptr: object pointer, used to generate unique ID<br>
- * @type: object type<br>
+ * @obj: object pointer, used to generate unique ID<br>
+ * @obj_type: object type<br>
*<br>
* LOCKING:<br>
*<br>
- * Create a unique identifier based on @ptr in @dev's identifier space. Used<br>
+ * Create a unique identifier based on @obj in @dev's identifier space. Used<br>
* for tracking modes, CRTCs and connectors.<br>
*<br>
* RETURNS:<br>
@@ -245,12 +245,12 @@ again:<br>
/**<br>
* drm_mode_object_put - free an identifer<br>
* @dev: DRM device<br>
- * @id: ID to free<br>
+ * @object: object to free<br>
*<br>
* LOCKING:<br>
* Caller must hold DRM mode_config lock.<br>
*<br>
- * Free @id from @dev's unique identifier pool.<br>
+ * Free @object from @dev's unique identifier pool.<br>
*/<br>
static void drm_mode_object_put(struct drm_device *dev,<br>
struct drm_mode_object *object)<br>
@@ -353,10 +353,11 @@ EXPORT_SYMBOL(drm_framebuffer_reference);<br>
void drm_framebuffer_cleanup(struct drm_framebuffer *fb)<br>
{<br>
struct drm_device *dev = fb->dev;<br>
+<br>
/*<br>
* This could be moved to drm_framebuffer_remove(), but for<br>
* debugging is nice to keep around the list of fb's that are<br>
- * no longer associated w/ a drm_file but are not unreferenced<br>
+ * no longer associated with a drm_file but are not unreferenced<br>
* yet. (i915 and omapdrm have debugfs files which will show<br>
* this.)<br>
*/<br>
@@ -519,7 +520,7 @@ EXPORT_SYMBOL(drm_mode_remove);<br>
* @dev: DRM device<br>
* @connector: the connector to init<br>
* @funcs: callbacks for this connector<br>
- * @name: user visible name of the connector<br>
+ * @connector_type: type of the connector<br>
*<br>
* LOCKING:<br>
* Takes mode config lock.<br>
@@ -683,7 +684,8 @@ int drm_plane_init(struct drm_device *dev, struct drm_plane *plane,<br>
plane->format_count = format_count;<br>
plane->possible_crtcs = possible_crtcs;<br>
<br>
- /* private planes are not exposed to userspace, but depending on<br>
+ /*<br>
+ * private planes are not exposed to userspace, but depending on<br>
* display hardware, might be convenient to allow sharing programming<br>
* for the scanout engine with the crtc implementation.<br>
*/<br>
@@ -1188,10 +1190,9 @@ static int drm_crtc_convert_umode(struct drm_display_mode *out,<br>
<br>
/**<br>
* drm_mode_getresources - get graphics configuration<br>
- * @inode: inode from the ioctl<br>
- * @filp: file * from the ioctl<br>
- * @cmd: cmd from ioctl<br>
- * @arg: arg from ioctl<br>
+ * @dev: DRM device<br>
+ * @data: ioctl data<br>
+ * @file_priv: DRM file info<br>
*<br>
* LOCKING:<br>
* Takes mode config lock.<br>
@@ -1249,7 +1250,6 @@ int drm_mode_getresources(struct drm_device *dev, void *data,<br>
list_for_each(lh, &dev->mode_config.encoder_list)<br>
encoder_count++;<br>
} else {<br>
-<br>
crtc_count = mode_group->num_crtcs;<br>
connector_count = mode_group->num_connectors;<br>
encoder_count = mode_group->num_encoders;<br>
@@ -1328,7 +1328,6 @@ int drm_mode_getresources(struct drm_device *dev, void *data,<br>
}<br>
copied++;<br>
}<br>
-<br>
}<br>
}<br>
card_res->count_encoders = encoder_count;<br>
@@ -1376,10 +1375,9 @@ out:<br>
<br>
/**<br>
* drm_mode_getcrtc - get CRTC configuration<br>
- * @inode: inode from the ioctl<br>
- * @filp: file * from the ioctl<br>
- * @cmd: cmd from ioctl<br>
- * @arg: arg from ioctl<br>
+ * @dev: DRM device<br>
+ * @data: ioctl data<br>
+ * @file_priv: DRM file info<br>
*<br>
* LOCKING:<br>
* Takes mode config lock.<br>
@@ -1421,10 +1419,8 @@ int drm_mode_getcrtc(struct drm_device *dev,<br>
crtc_resp->fb_id = 0;<br>
<br>
if (crtc->enabled) {<br>
-<br>
drm_crtc_convert_to_umode(&crtc_resp->mode, &crtc->mode);<br>
crtc_resp->mode_valid = 1;<br>
-<br>
} else {<br>
crtc_resp->mode_valid = 0;<br>
}<br>
@@ -1436,10 +1432,9 @@ out:<br>
<br>
/**<br>
* drm_mode_getconnector - get connector configuration<br>
- * @inode: inode from the ioctl<br>
- * @filp: file * from the ioctl<br>
- * @cmd: cmd from ioctl<br>
- * @arg: arg from ioctl<br>
+ * @dev: DRM device<br>
+ * @data: ioctl data<br>
+ * @file_priv: DRM file info<br>
*<br>
* LOCKING:<br>
* Takes mode config lock.<br>
@@ -1732,8 +1727,8 @@ out:<br>
/**<br>
* drm_mode_setplane - set up or tear down an plane<br>
* @dev: DRM device<br>
- * @data: ioctl data*<br>
- * @file_prive: DRM file info<br>
+ * @data: ioctl data<br>
+ * @file_priv: DRM file info<br>
*<br>
* LOCKING:<br>
* Takes mode config lock.<br>
@@ -1862,10 +1857,9 @@ out:<br>
<br>
/**<br>
* drm_mode_setcrtc - set CRTC configuration<br>
- * @inode: inode from the ioctl<br>
- * @filp: file * from the ioctl<br>
- * @cmd: cmd from ioctl<br>
- * @arg: arg from ioctl<br>
+ * @dev: DRM device<br>
+ * @data: ioctl data<br>
+ * @file_priv: DRM file info<br>
*<br>
* LOCKING:<br>
* Takes mode config lock.<br>
@@ -2077,6 +2071,7 @@ int drm_mode_cursor_ioctl(struct drm_device *dev,<br>
goto out;<br>
}<br>
}<br>
+<br>
out:<br>
mutex_unlock(&dev->mode_config.mutex);<br>
return ret;<br>
@@ -2120,10 +2115,9 @@ EXPORT_SYMBOL(drm_mode_legacy_fb_format);<br>
<br>
/**<br>
* drm_mode_addfb - add an FB to the graphics configuration<br>
- * @inode: inode from the ioctl<br>
- * @filp: file * from the ioctl<br>
- * @cmd: cmd from ioctl<br>
- * @arg: arg from ioctl<br>
+ * @dev: DRM device<br>
+ * @data: ioctl data<br>
+ * @file_priv: DRM file info<br>
*<br>
* LOCKING:<br>
* Takes mode config lock.<br>
@@ -2304,10 +2298,9 @@ static int framebuffer_check(const struct drm_mode_fb_cmd2 *r)<br>
<br>
/**<br>
* drm_mode_addfb2 - add an FB to the graphics configuration<br>
- * @inode: inode from the ioctl<br>
- * @filp: file * from the ioctl<br>
- * @cmd: cmd from ioctl<br>
- * @arg: arg from ioctl<br>
+ * @dev: DRM device<br>
+ * @data: ioctl data<br>
+ * @file_priv: DRM file info<br>
*<br>
* LOCKING:<br>
* Takes mode config lock.<br>
@@ -2370,10 +2363,9 @@ out:<br>
<br>
/**<br>
* drm_mode_rmfb - remove an FB from the configuration<br>
- * @inode: inode from the ioctl<br>
- * @filp: file * from the ioctl<br>
- * @cmd: cmd from ioctl<br>
- * @arg: arg from ioctl<br>
+ * @dev: DRM device<br>
+ * @data: ioctl data<br>
+ * @file_priv: DRM file info<br>
*<br>
* LOCKING:<br>
* Takes mode config lock.<br>
@@ -2425,10 +2417,9 @@ out:<br>
<br>
/**<br>
* drm_mode_getfb - get FB info<br>
- * @inode: inode from the ioctl<br>
- * @filp: file * from the ioctl<br>
- * @cmd: cmd from ioctl<br>
- * @arg: arg from ioctl<br>
+ * @dev: DRM device<br>
+ * @data: ioctl data<br>
+ * @file_priv: DRM file info<br>
*<br>
* LOCKING:<br>
* Takes mode config lock.<br>
@@ -2515,6 +2506,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev,<br>
ret = -EINVAL;<br>
goto out_err1;<br>
}<br>
+<br>
clips = kzalloc(num_clips * sizeof(*clips), GFP_KERNEL);<br>
if (!clips) {<br>
ret = -ENOMEM;<br>
@@ -2544,15 +2536,14 @@ out_err1:<br>
return ret;<br>
}<br>
<br>
-<br>
/**<br>
* drm_fb_release - remove and free the FBs on this file<br>
- * @filp: file * from the ioctl<br>
+ * @priv: file * from the ioctl<br>
*<br>
* LOCKING:<br>
* Takes mode config lock.<br>
*<br>
- * Destroy all the FBs associated with @filp.<br>
+ * Destroy all the FBs associated with @priv.<br>
*<br>
* Called by the user via ioctl.<br>
*<br>
@@ -2616,7 +2607,7 @@ int drm_mode_attachmode_crtc(struct drm_device *dev, struct drm_crtc *crtc,<br>
<br>
WARN_ON(!list_empty(&list));<br>
<br>
- out:<br>
+out:<br>
list_for_each_entry_safe(dup_mode, next, &list, head)<br>
drm_mode_destroy(dev, dup_mode);<br>
<br>
@@ -2660,10 +2651,9 @@ EXPORT_SYMBOL(drm_mode_detachmode_crtc);<br>
<br>
/**<br>
* drm_fb_attachmode - Attach a user mode to an connector<br>
- * @inode: inode from the ioctl<br>
- * @filp: file * from the ioctl<br>
- * @cmd: cmd from ioctl<br>
- * @arg: arg from ioctl<br>
+ * @dev: DRM device<br>
+ * @data: ioctl data<br>
+ * @file_priv: DRM file info<br>
*<br>
* This attaches a user specified mode to an connector.<br>
* Called by the user via ioctl.<br>
@@ -2707,6 +2697,7 @@ int drm_mode_attachmode_ioctl(struct drm_device *dev,<br>
}<br>
<br>
drm_mode_attachmode(dev, connector, mode);<br>
+<br>
out:<br>
mutex_unlock(&dev->mode_config.mutex);<br>
return ret;<br>
@@ -2715,10 +2706,9 @@ out:<br>
<br>
/**<br>
* drm_fb_detachmode - Detach a user specified mode from an connector<br>
- * @inode: inode from the ioctl<br>
- * @filp: file * from the ioctl<br>
- * @cmd: cmd from ioctl<br>
- * @arg: arg from ioctl<br>
+ * @dev: DRM device<br>
+ * @data: ioctl data<br>
+ * @file_priv: DRM file info<br>
*<br>
* Called by the user via ioctl.<br>
*<br>
@@ -2754,6 +2744,7 @@ int drm_mode_detachmode_ioctl(struct drm_device *dev,<br>
}<br>
<br>
ret = drm_mode_detachmode(dev, connector, &mode);<br>
+<br>
out:<br>
mutex_unlock(&dev->mode_config.mutex);<br>
return ret;<br>
@@ -2790,6 +2781,7 @@ struct drm_property *drm_property_create(struct drm_device *dev, int flags,<br>
<br>
list_add_tail(&property->head, &dev->mode_config.property_list);<br>
return property;<br>
+<br>
fail:<br>
kfree(property->values);<br>
kfree(property);<br>
@@ -3078,6 +3070,7 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev,<br>
}<br>
out_resp->count_enum_blobs = blob_count;<br>
}<br>
+<br>
done:<br>
mutex_unlock(&dev->mode_config.mutex);<br>
return ret;<br>
@@ -3187,6 +3180,7 @@ static bool drm_property_change_is_valid(struct drm_property *property,<br>
{<br>
if (property->flags & DRM_MODE_PROP_IMMUTABLE)<br>
return false;<br>
+<br>
if (property->flags & DRM_MODE_PROP_RANGE) {<br>
if (value < property->values[0] || value > property->values[1])<br>
return false;<br>
@@ -3194,6 +3188,7 @@ static bool drm_property_change_is_valid(struct drm_property *property,<br>
} else if (property->flags & DRM_MODE_PROP_BITMASK) {<br>
int i;<br>
uint64_t valid_mask = 0;<br>
+<br>
for (i = 0; i < property->num_values; i++)<br>
valid_mask |= (1ULL << property->values[i]);<br>
return !(value & ~valid_mask);<br>
@@ -3326,6 +3321,7 @@ int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data,<br>
}<br>
}<br>
arg->count_props = props_count;<br>
+<br>
out:<br>
mutex_unlock(&dev->mode_config.mutex);<br>
return ret;<br>
@@ -3487,7 +3483,6 @@ int drm_mode_gamma_set_ioctl(struct drm_device *dev,<br>
out:<br>
mutex_unlock(&dev->mode_config.mutex);<br>
return ret;<br>
-<br>
}<br>
<br>
int drm_mode_gamma_get_ioctl(struct drm_device *dev,<br>
@@ -3535,6 +3530,7 @@ int drm_mode_gamma_get_ioctl(struct drm_device *dev,<br>
ret = -EFAULT;<br>
goto out;<br>
}<br>
+<br>
out:<br>
mutex_unlock(&dev->mode_config.mutex);<br>
return ret;<br>
@@ -3668,6 +3664,7 @@ int drm_mode_create_dumb_ioctl(struct drm_device *dev,<br>
<br>
if (!dev->driver->dumb_create)<br>
return -ENOSYS;<br>
+<br>
return dev->driver->dumb_create(file_priv, dev, args);<br>
}<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.9.1<br>
<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Best regards<br></div><div>Junwang Zhao</div><div>Microprocessor Research and Develop Center</div><div>Department of Computer Science &Technology</div><div>Peking University</div><div>Beijing, 100871, PRC</div></div></div>
</div>