Functions
Functions
Graphics » HAL GFX » GFX CMDLIST
Collaboration diagram for Functions:

## Functions
hal_gfx_cmdlist_t | hal_gfx_cl_create_prealloc (hal_gfx_buffer_t *bo)
| Create a new Command List into a preallocated space. More...
hal_gfx_cmdlist_t | hal_gfx_cl_create_sized (int size_bytes)
| Create a new, non expandable Command List of specific size. More...
hal_gfx_cmdlist_t | hal_gfx_cl_create (void)
| Create a new expandable Command List. More...
hal_gfx_cmdlist_t | hal_gfx_cl_le_create (void)
| Create a new expandable Command List with power management mode. More...
void | hal_gfx_cl_destroy (hal_gfx_cmdlist_t *cl)
| Destroy/Free a Command List. More...
void | hal_gfx_cl_le_destroy (hal_gfx_cmdlist_t *cl)
| Destroy/Free a Command List with power management mode. More...
void | hal_gfx_cl_rewind (hal_gfx_cmdlist_t *cl)
| Reset position of next command to be written to the beginning. More...
void | hal_gfx_cl_bind (hal_gfx_cmdlist_t *cl)
| Define in which Command List each subsequent commands are going to be inserted. More...
void | hal_gfx_cl_bind_circular (hal_gfx_cmdlist_t *cl)
| Define in which Command List each subsequent commands are going to be inserted. More...
void | hal_gfx_cl_unbind (void)
| Unbind current bound Command List, if any. More...
hal_gfx_cmdlist_t * | hal_gfx_cl_get_bound (void)
| Get bound Command List. More...
void | hal_gfx_cl_submit_no_irq (hal_gfx_cmdlist_t *cl)
| Push command to command list, but do not trigger interrupt. More...
void | hal_gfx_cl_submit (hal_gfx_cmdlist_t *cl)
| Enqueue Command List to the Ring Buffer for execution. More...
int | hal_gfx_cl_wait (hal_gfx_cmdlist_t *cl)
| Wait for Command List to finish. More...
void | hal_gfx_cl_add_cmd (uint32_t reg, uint32_t data)
| Add a command to the bound Command List. More...
int | hal_gfx_cl_add_multiple_cmds (int cmd_no, uint32_t *cmd)
| Add multiple commands to the bound Command List. More...
uint32_t * | hal_gfx_cl_get_space (int cmd_no)
| Request free space from command list. More...
void | hal_gfx_cl_branch (hal_gfx_cmdlist_t *cl)
| Branch from the bound Command List to a different one. More...
void | hal_gfx_cl_jump (hal_gfx_cmdlist_t *cl)
| Jump from the bound Command List to a different one. More...
void | hal_gfx_cl_return (void)
| Add an explicit return command to the bound Command List. More...
int | hal_gfx_cl_almost_full (hal_gfx_cmdlist_t *cl)
| Returns positive number if the Command List is almost full, otherwise returns 0. More...
int | hal_gfx_cl_enough_space (int cmd_no)
| Check if there is enough space or expansion can be performed for required commands. More...

## Detailed Description

## Function Documentation

## ◆ hal_gfx_cl_add_cmd()

void hal_gfx_cl_add_cmd | ( | uint32_t | reg,
|  | uint32_t | data
| ) |  |

Add a command to the bound Command List.

Parameters

  [in] | reg | Hardware register to be written
  [in] | data | Data to be written

## ◆ hal_gfx_cl_add_multiple_cmds()

int hal_gfx_cl_add_multiple_cmds | ( | int | cmd_no,
|  | uint32_t * | cmd
| ) |  |

Add multiple commands to the bound Command List.

Parameters

  [in] | cmd_no | Numbers of commands to add
  [in] | cmd | Pointer to the commands to be added

Returns
  0 if no error has occurred

## ◆ hal_gfx_cl_almost_full()

int hal_gfx_cl_almost_full | ( | hal_gfx_cmdlist_t * | cl | ) |

Returns positive number if the Command List is almost full, otherwise returns 0.

Parameters

  [in] | cl | Pointer to the Command List

## ◆ hal_gfx_cl_bind()

void hal_gfx_cl_bind | ( | hal_gfx_cmdlist_t * | cl | ) |

Define in which Command List each subsequent commands are going to be inserted.

Parameters

  [in] | cl | Pointer to the Command List

## ◆ hal_gfx_cl_bind_circular()

void hal_gfx_cl_bind_circular | ( | hal_gfx_cmdlist_t * | cl | ) |

Define in which Command List each subsequent commands are going to be inserted.

Bind this command list as Circular. It never gets full, it never expands, it may get implicitly submitted, it cannot be reused.

Parameters

  [in] | cl | Pointer to the Command List

## ◆ hal_gfx_cl_branch()

void hal_gfx_cl_branch | ( | hal_gfx_cmdlist_t * | cl | ) |

Branch from the bound Command List to a different one.

Return is implied.

Parameters

  [in] | cl | Pointer to the Command List to branch to

## ◆ hal_gfx_cl_create()

hal_gfx_cmdlist_t hal_gfx_cl_create | ( | void |  | ) |

Create a new expandable Command List.

Returns
  instance of the new Command List

## ◆ hal_gfx_cl_create_prealloc()

hal_gfx_cmdlist_t hal_gfx_cl_create_prealloc | ( | hal_gfx_buffer_t * | bo | ) |

Create a new Command List into a preallocated space.

Parameters

  [in] | bo | Command List buffer (preallocated)

Returns
  The instance of the new Command List

## ◆ hal_gfx_cl_create_sized()

hal_gfx_cmdlist_t hal_gfx_cl_create_sized | ( | int | size_bytes | ) |

Create a new, non expandable Command List of specific size.

Parameters

  [in] | size_bytes | Command List's size in bytes

Returns
  instance of the new Command List

## ◆ hal_gfx_cl_destroy()

void hal_gfx_cl_destroy | ( | hal_gfx_cmdlist_t * | cl | ) |

Destroy/Free a Command List.

Parameters

  [in] | cl | Pointer to the Command List

## ◆ hal_gfx_cl_enough_space()

int hal_gfx_cl_enough_space | ( | int | cmd_no | ) |

Check if there is enough space or expansion can be performed for required commands.

Parameters

  [in] | cmd_no | Numbers of commands to be checked if they fit

Returns
  zero is commands fit or expansion xan be performed else return negative

## ◆ hal_gfx_cl_get_bound()

hal_gfx_cmdlist_t* hal_gfx_cl_get_bound | ( | void |  | ) |

Get bound Command List.

Returns
  Pointer to the bound Command List

## ◆ hal_gfx_cl_get_space()

uint32_t* hal_gfx_cl_get_space | ( | int | cmd_no | ) |

Request free space from command list.

Parameters

  [in] | cmd_no | Number of commands to write

Returns
  Return pointer in bound_cl to directly add commands

## ◆ hal_gfx_cl_jump()

void hal_gfx_cl_jump | ( | hal_gfx_cmdlist_t * | cl | ) |

Jump from the bound Command List to a different one.

No return is implied.

Parameters

  [in] | cl | Pointer to the Command List to jump to

## ◆ hal_gfx_cl_le_create()

hal_gfx_cmdlist_t hal_gfx_cl_le_create | ( | void |  | ) |

Create a new expandable Command List with power management mode.

Returns
  instance of the new Command List

## ◆ hal_gfx_cl_le_destroy()

void hal_gfx_cl_le_destroy | ( | hal_gfx_cmdlist_t * | cl | ) |

Destroy/Free a Command List with power management mode.

Parameters

  [in] | cl | Pointer to the Command List

## ◆ hal_gfx_cl_return()

void hal_gfx_cl_return | ( | void |  | ) |

Add an explicit return command to the bound Command List.

## ◆ hal_gfx_cl_rewind()

void hal_gfx_cl_rewind | ( | hal_gfx_cmdlist_t * | cl | ) |

Reset position of next command to be written to the beginning.

Doesn't clear the List's contents.

Parameters

  [in] | cl | Pointer to the Command List

## ◆ hal_gfx_cl_submit()

void hal_gfx_cl_submit | ( | hal_gfx_cmdlist_t * | cl | ) |

Enqueue Command List to the Ring Buffer for execution.

Parameters

  [in] | cl | Pointer to the Command List

## ◆ hal_gfx_cl_submit_no_irq()

void hal_gfx_cl_submit_no_irq | ( | hal_gfx_cmdlist_t * | cl | ) |

Push command to command list, but do not trigger interrupt.

Parameters

  [in] | cl | command list

## ◆ hal_gfx_cl_unbind()

void hal_gfx_cl_unbind | ( | void |  | ) |

Unbind current bound Command List, if any.

Returns
  None

## ◆ hal_gfx_cl_wait()

int hal_gfx_cl_wait | ( | hal_gfx_cmdlist_t * | cl | ) |

Wait for Command List to finish.

Parameters

  [in] | cl | Pointer to the Command List

Returns
  0 if no error has occurred