Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 357326
b: refs/heads/master
c: 317b4ca
h: refs/heads/master
v: v3
  • Loading branch information
Kamil Debski authored and Mauro Carvalho Chehab committed Jan 6, 2013
1 parent e665cff commit 971bbf7
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 230 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ef89fff874758c0f08501bdc2932b7e77421cfc6
refs/heads/master: 317b4ca4982ea2429b75d0acd10445ec9475aa86
20 changes: 4 additions & 16 deletions trunk/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -496,15 +496,9 @@ struct s5p_mfc_codec_ops {
* flushed
* @head_processed: flag mentioning whether the header data is processed
* completely or not
* @bank1_buf: handle to memory allocated for temporary buffers from
* @bank1: handle to memory allocated for temporary buffers from
* memory bank 1
* @bank1_phys: address of the temporary buffers from memory bank 1
* @bank1_size: size of the memory allocated for temporary buffers from
* memory bank 1
* @bank2_buf: handle to memory allocated for temporary buffers from
* memory bank 2
* @bank2_phys: address of the temporary buffers from memory bank 2
* @bank2_size: size of the memory allocated for temporary buffers from
* @bank2: handle to memory allocated for temporary buffers from
* memory bank 2
* @capture_state: state of the capture buffers queue
* @output_state: state of the output buffers queue
Expand Down Expand Up @@ -584,14 +578,8 @@ struct s5p_mfc_ctx {
unsigned int dpb_flush_flag;
unsigned int head_processed;

/* Buffers */
void *bank1_buf;
size_t bank1_phys;
size_t bank1_size;

void *bank2_buf;
size_t bank2_phys;
size_t bank2_size;
struct s5p_mfc_priv_buf bank1;
struct s5p_mfc_priv_buf bank2;

enum s5p_mfc_queue_state capture_state;
enum s5p_mfc_queue_state output_state;
Expand Down
30 changes: 30 additions & 0 deletions trunk/drivers/media/platform/s5p-mfc/s5p_mfc_opr.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* published by the Free Software Foundation.
*/

#include "s5p_mfc_debug.h"
#include "s5p_mfc_opr.h"
#include "s5p_mfc_opr_v5.h"
#include "s5p_mfc_opr_v6.h"
Expand All @@ -29,3 +30,32 @@ void s5p_mfc_init_hw_ops(struct s5p_mfc_dev *dev)
}
dev->mfc_ops = s5p_mfc_ops;
}

int s5p_mfc_alloc_priv_buf(struct device *dev,
struct s5p_mfc_priv_buf *b)
{

mfc_debug(3, "Allocating priv: %d\n", b->size);

b->virt = dma_alloc_coherent(dev, b->size, &b->dma, GFP_KERNEL);

if (!b->virt) {
mfc_err("Allocating private buffer failed\n");
return -ENOMEM;
}

mfc_debug(3, "Allocated addr %p %08x\n", b->virt, b->dma);
return 0;
}

void s5p_mfc_release_priv_buf(struct device *dev,
struct s5p_mfc_priv_buf *b)
{
if (b->virt) {
dma_free_coherent(dev, b->size, b->virt, b->dma);
b->virt = 0;
b->dma = 0;
b->size = 0;
}
}

5 changes: 5 additions & 0 deletions trunk/drivers/media/platform/s5p-mfc/s5p_mfc_opr.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,10 @@ struct s5p_mfc_hw_ops {
};

void s5p_mfc_init_hw_ops(struct s5p_mfc_dev *dev);
int s5p_mfc_alloc_priv_buf(struct device *dev,
struct s5p_mfc_priv_buf *b);
void s5p_mfc_release_priv_buf(struct device *dev,
struct s5p_mfc_priv_buf *b);


#endif /* S5P_MFC_OPR_H_ */
Loading

0 comments on commit 971bbf7

Please sign in to comment.