Skip to content
Snippets Groups Projects
Select Git revision
  • 0e9060b05282cfbf1db9afac7145e03ce6645339
  • master default protected
  • android-msm-bullhead-3.10-nougat_kgdb_less_changes
  • android-msm-bullhead-3.10-nougat_kgdb
  • android-msm-bullhead-3.10-nougat_klist
  • android-4.4
  • android-msm-vega-4.4-oreo-daydream
  • android-msm-wahoo-4.4-p-preview-5
  • android-msm-wahoo-4.4-pie
  • android-msm-marlin-3.18-p-preview-5
  • android-msm-marlin-3.18-pie
  • android-msm-wahoo-2018.07-oreo-m2
  • android-msm-wahoo-2018.07-oreo-m4
  • android-msm-wahoo-4.4-p-preview-4
  • android-msm-bullhead-3.10-oreo-m6
  • android-msm-angler-3.10-oreo-m6
  • android-msm-marlin-3.18-p-preview-4
  • android-msm-stargazer-3.18-oreo-wear-dr
  • android-msm-catshark-3.18-oreo-wear-dr
  • android-msm-wahoo-4.4-oreo-m2
  • android-msm-wahoo-4.4-oreo-m4
  • android-daydreamos-8.0.0_r0.5
  • android-8.1.0_r0.92
  • android-8.1.0_r0.91
  • android-daydreamos-8.0.0_r0.4
  • android-p-preview-5_r0.2
  • android-p-preview-5_r0.1
  • android-9.0.0_r0.5
  • android-9.0.0_r0.4
  • android-9.0.0_r0.2
  • android-9.0.0_r0.1
  • android-8.1.0_r0.81
  • android-8.1.0_r0.80
  • android-8.1.0_r0.78
  • android-8.1.0_r0.76
  • android-8.1.0_r0.75
  • android-8.1.0_r0.72
  • android-8.1.0_r0.70
  • android-p-preview-4_r0.2
  • android-p-preview-4_r0.1
  • android-wear-8.0.0_r0.30
41 results

msm.c

Blame
  • msm.c 25.23 KiB
    /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
     *
     * This program is free software; you can redistribute it and/or modify
     * it under the terms of the GNU General Public License version 2 and
     * only version 2 as published by the Free Software Foundation.
     *
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     * GNU General Public License for more details.
     */
    
    #include <linux/of.h>
    #include <linux/module.h>
    #include <linux/workqueue.h>
    #include <linux/delay.h>
    #include <linux/types.h>
    #include <linux/list.h>
    #include <linux/ioctl.h>
    #include <linux/spinlock.h>
    #include <linux/proc_fs.h>
    #include <linux/atomic.h>
    #include <linux/wait.h>
    #include <linux/videodev2.h>
    #include <linux/msm_ion.h>
    #include <linux/iommu.h>
    #include <linux/platform_device.h>
    #include <media/v4l2-fh.h>
    #include "msm.h"
    #include "msm_vb2.h"
    #include "msm_sd.h"
    
    static struct v4l2_device *msm_v4l2_dev;
    static struct list_head    ordered_sd_list;
    
    static struct msm_queue_head *msm_session_q;
    
    /* config node envent queue */
    static struct v4l2_fh  *msm_eventq;
    spinlock_t msm_eventq_lock;
    
    static struct pid *msm_pid;
    spinlock_t msm_pid_lock;
    
    #define msm_dequeue(queue, type, member) ({				\
    	unsigned long flags;					\
    	struct msm_queue_head *__q = (queue);			\
    	type *node = 0;				\
    	spin_lock_irqsave(&__q->lock, flags);			\
    	if (!list_empty(&__q->list)) {				\
    		__q->len--;					\
    		node = list_first_entry(&__q->list,		\
    				type, member);	\
    		if ((node) && (&node->member) && (&node->member.next))	\
    			list_del_init(&node->member);			\
    	}							\
    	spin_unlock_irqrestore(&__q->lock, flags);	\
    	node;							\
    })
    
    #define msm_delete_sd_entry(queue, type, member, q_node) ({		\
    	unsigned long flags;					\
    	struct msm_queue_head *__q = (queue);			\
    	type *node = 0;				\
    	spin_lock_irqsave(&__q->lock, flags);			\
    	if (!list_empty(&__q->list)) {				\
    		list_for_each_entry(node, &__q->list, member)	\
    		if (node->sd == q_node) {				\
    			__q->len--;				\
    			list_del_init(&node->member);		\