summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
070963e)
The original KDS patches added CONFIG_DMA_SHARED_BUFFER_USES_KDS but
didn't use it to guard the kds integration into dma-bufs in a way
that would allow dma-buf to be built with KDS compiled without
requiring KDS.
Fix this by more carefully guarding the integration points, and not
unconditionally selecting KDS when dma-buf is enabled.
Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium:232913
TEST=compile kernel for x86 and arm and verify it still boots
Change-Id: I878d1313ce6b43477fd6c87d394728283ad4f9e6
Reviewed-on: https://gerrit.chromium.org/gerrit/48608
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>
bool
default n
select ANON_INODES
bool
default n
select ANON_INODES
- select KDS
- select DMA_SHARED_BUFFER_USES_KDS
depends on EXPERIMENTAL
help
This option enables the framework for buffer-sharing between
depends on EXPERIMENTAL
help
This option enables the framework for buffer-sharing between
endif
config DMA_SHARED_BUFFER_USES_KDS
endif
config DMA_SHARED_BUFFER_USES_KDS
+ bool "Add KDS resource within every dma_buf allocation"
+ depends on DMA_SHARED_BUFFER && KDS
default n
help
This option adds a KDS resource within every dma_buf allocation.
default n
help
This option adds a KDS resource within every dma_buf allocation.
#include <linux/dma-buf.h>
#include <linux/anon_inodes.h>
#include <linux/export.h>
#include <linux/dma-buf.h>
#include <linux/anon_inodes.h>
#include <linux/export.h>
+#ifdef CONFIG_DMA_SHARED_BUFFER_USES_KDS
#include <linux/poll.h>
#include <linux/sched.h>
#include <linux/poll.h>
#include <linux/sched.h>
static inline int is_dma_buf_file(struct file *);
static inline int is_dma_buf_file(struct file *);
dmabuf = file->private_data;
dmabuf->ops->release(dmabuf);
dmabuf = file->private_data;
dmabuf->ops->release(dmabuf);
+#ifdef CONFIG_DMA_SHARED_BUFFER_USES_KDS
kds_callback_term(&dmabuf->kds_cb);
kds_resource_term(&dmabuf->kds);
kds_callback_term(&dmabuf->kds_cb);
kds_resource_term(&dmabuf->kds);
kfree(dmabuf);
return 0;
}
kfree(dmabuf);
return 0;
}
return dmabuf->ops->mmap(dmabuf, vma);
}
return dmabuf->ops->mmap(dmabuf, vma);
}
+#ifdef CONFIG_DMA_SHARED_BUFFER_USES_KDS
static void dma_buf_kds_cb_fn(void *param1, void *param2)
{
struct kds_resource_set **rset_ptr = param1;
static void dma_buf_kds_cb_fn(void *param1, void *param2)
{
struct kds_resource_set **rset_ptr = param1;
static const struct file_operations dma_buf_fops = {
.release = dma_buf_release,
.mmap = dma_buf_mmap_internal,
static const struct file_operations dma_buf_fops = {
.release = dma_buf_release,
.mmap = dma_buf_mmap_internal,
+#ifdef CONFIG_DMA_SHARED_BUFFER_USES_KDS
mutex_init(&dmabuf->lock);
INIT_LIST_HEAD(&dmabuf->attachments);
mutex_init(&dmabuf->lock);
INIT_LIST_HEAD(&dmabuf->attachments);
+#ifdef CONFIG_DMA_SHARED_BUFFER_USES_KDS
init_waitqueue_head(&dmabuf->wq_exclusive);
init_waitqueue_head(&dmabuf->wq_shared);
kds_resource_init(&dmabuf->kds);
kds_callback_init(&dmabuf->kds_cb, 1, dma_buf_kds_cb_fn);
init_waitqueue_head(&dmabuf->wq_exclusive);
init_waitqueue_head(&dmabuf->wq_shared);
kds_resource_init(&dmabuf->kds);
kds_callback_init(&dmabuf->kds_cb, 1, dma_buf_kds_cb_fn);
tristate "DRM Support for Samsung SoC EXYNOS Series"
depends on DRM && PLAT_SAMSUNG
select DRM_KMS_HELPER
tristate "DRM Support for Samsung SoC EXYNOS Series"
depends on DRM && PLAT_SAMSUNG
select DRM_KMS_HELPER
+ select DMA_SHARED_BUFFER_USES_KDS
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
#include <linux/list.h>
#include <linux/dma-mapping.h>
#include <linux/fs.h>
#include <linux/list.h>
#include <linux/dma-mapping.h>
#include <linux/fs.h>
+#ifdef CONFIG_DMA_SHARED_BUFFER_USES_KDS
#include <linux/kds.h>
#include <linux/wait.h>
#include <linux/kds.h>
#include <linux/wait.h>
struct device;
struct dma_buf;
struct device;
struct dma_buf;
const struct dma_buf_ops *ops;
/* mutex to serialize list manipulation and attach/detach */
struct mutex lock;
const struct dma_buf_ops *ops;
/* mutex to serialize list manipulation and attach/detach */
struct mutex lock;
+#ifdef CONFIG_DMA_SHARED_BUFFER_USES_KDS
struct kds_resource kds;
wait_queue_head_t wq_exclusive;
wait_queue_head_t wq_shared;
struct kds_callback kds_cb;
struct kds_resource kds;
wait_queue_head_t wq_exclusive;
wait_queue_head_t wq_shared;
struct kds_callback kds_cb;
get_file(dmabuf->file);
}
get_file(dmabuf->file);
}
+#ifdef CONFIG_DMA_SHARED_BUFFER_USES_KDS
/**
* get_dma_buf_kds_resource - get a KDS resource for this dma-buf
* @dmabuf: [in] pointer to dma_buf
/**
* get_dma_buf_kds_resource - get a KDS resource for this dma-buf
* @dmabuf: [in] pointer to dma_buf
#ifdef CONFIG_DMA_SHARED_BUFFER
struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
#ifdef CONFIG_DMA_SHARED_BUFFER
struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,