Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Revert "drm: crc: Wait for a frame before returning from open()"

This reverts commit e8fa5671183c80342d520ad81d14fa79a9d4a680.

Don't wait for first CRC during crtc_crc_open. It avoids one frame wait
during open. If application want to wait after read call, it can use
poll/read blocking read() call.

Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
Cc: dri-devel@lists.freedesktop.org
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180821083858.26275-4-mahesh1.kumar@intel.com

authored by

Mahesh Kumar and committed by
Rodrigo Vivi
ad1a56f1 c0811a7d

-16
-16
drivers/gpu/drm/drm_debugfs_crc.c
··· 228 228 if (ret) 229 229 goto err; 230 230 231 - spin_lock_irq(&crc->lock); 232 - /* 233 - * Only return once we got a first frame, so userspace doesn't have to 234 - * guess when this particular piece of HW will be ready to start 235 - * generating CRCs. 236 - */ 237 - ret = wait_event_interruptible_lock_irq(crc->wq, 238 - crtc_crc_data_count(crc), 239 - crc->lock); 240 - spin_unlock_irq(&crc->lock); 241 - 242 - if (ret) 243 - goto err_disable; 244 - 245 231 return 0; 246 232 247 - err_disable: 248 - crtc->funcs->set_crc_source(crtc, NULL); 249 233 err: 250 234 spin_lock_irq(&crc->lock); 251 235 crtc_crc_cleanup(crc);