GEM Submission: igt-gpu-tools Reference Manual

## GEM Submission GEM Submission — Helpers for determining submission method |

## Functions

unsigned | gem_submission_method ()
void | gem_submission_print_method ()
bool | gem_using_execlists ()
bool | gem_using_guc_submission ()
bool | gem_engine_has_mutable_submission ()
bool | gem_class_has_mutable_submission ()
int | gem_cmdparser_version ()
bool | gem_has_cmdparser ()
bool | gem_engine_has_cmdparser ()
bool | gem_has_blitter ()
void | gem_require_blitter ()
unsigned int | gem_submission_measure ()
void | gem_test_all_engines ()
bool | gem_has_relocations ()
bool | gem_allows_obj_alignment ()

## Types and Values

#define | GEM_SUBMISSION_RINGBUF
#define | GEM_SUBMISSION_EXECLISTS
#define | GEM_SUBMISSION_GUC

## Description

This helper library contains functions used for getting information on currently used hardware submission method. Different generations of hardware support different submission backends, currently we're distinguishing 3 different methods: legacy ringbuffer submission, execlists, GuC submission.

## Functions

### gem_submission_method ()

    unsigned
    gem_submission_method (int fd);

#### Parameters

fd | open i915 drm file descriptor |

#### Returns

Submission method bitmap.

### gem_submission_print_method ()

    void
    gem_submission_print_method (int fd);

Helper for pretty-printing currently used submission method

#### Parameters

fd | open i915 drm file descriptor |

### gem_using_execlists ()

    bool
    gem_using_execlists (int fd);

### gem_using_guc_submission ()

    bool
    gem_using_guc_submission (int fd);

### gem_engine_has_mutable_submission ()

    bool
    gem_engine_has_mutable_submission (int fd,
                                       unsigned int engine);

Returns boolean value if the engine allows batch modifications post execbuf.

#### Parameters

i915 | open i915 drm file descriptor |
engine | the engine (I915_EXEC_RING id) of target |

### gem_class_has_mutable_submission ()

    bool
    gem_class_has_mutable_submission (int fd,
                                      int class);

Returns boolean value if the engine class allows batch modifications post execbuf.

#### Parameters

i915 | open i915 drm file descriptor |
class | engine class |

### gem_cmdparser_version ()

    int
    gem_cmdparser_version (int i915);

Returns the command parser version

#### Parameters

i915 | open i915 drm file descriptor |

### gem_has_cmdparser ()

    bool
    gem_has_cmdparser (int i915);

### gem_engine_has_cmdparser ()

    bool
    gem_engine_has_cmdparser (int i915,
                              const intel_ctx_cfg_t *cfg,
                              unsigned int engine);

Returns true if the given engine has a command parser

#### Parameters

i915 | open i915 drm file descriptor |
class | an intel_ctx_cfg_t |
engine | an engine specifier |

### gem_has_blitter ()

    bool
    gem_has_blitter (int i915);

### gem_require_blitter ()

    void
    gem_require_blitter (int i915);

### gem_submission_measure ()

    unsigned int
    gem_submission_measure (int i915,
                            const intel_ctx_cfg_t *cfg,
                            unsigned int engine);

### gem_test_all_engines ()

    void
    gem_test_all_engines (int fd);

Execute a nop batch on the engine specified, or ALL_ENGINES for all, and check it executes.

#### Parameters

i915 | open i915 drm file descriptor |

### gem_has_relocations ()

    bool
    gem_has_relocations (int fd);

Feature test macro to query whether kernel allows for generation to use relocations.

#### Parameters

fd | opened i915 drm file descriptor |

#### Returns

true if we can use relocations, otherwise false

### gem_allows_obj_alignment ()

    bool
    gem_allows_obj_alignment (int fd);

Check does i915 driver allows setting object alignment in exec object to handle in kernel and adjust object offset accordingly.

#### Parameters

fd | opened i915 drm file descriptor |

#### Returns

true if kernel supports setting offset to be aligned, otherwise false.

## Types and Values

### GEM_SUBMISSION_RINGBUF

    #define GEM_SUBMISSION_RINGBUF		1

### GEM_SUBMISSION_EXECLISTS

    #define GEM_SUBMISSION_EXECLISTS 2

### GEM_SUBMISSION_GUC

    #define GEM_SUBMISSION_GUC		3