- name: Install packages
  package:
    name:
      - drm-kmod
      - vulkan-loader
      - libva-utils # for vainfo
      - vdpauinfo # for vdpauinfo
      - libvdpau-va-gl # vdpau support
      - mesa-gallium-va # Accelerated video decoding
      - mesa-gallium-vdpau # Accelerated video decoding
      - radeontop
      - vulkan-tools # For vulkaninfo
    state: present

- name: Install loader.conf
  copy:
    src: "files/{{ item }}_loader.conf"
    dest: "/boot/loader.conf.d/{{ item }}.conf"
    mode: 0644
    owner: root
    group: wheel
  loop:
    - amd_adaptive_backlight_management

- name: Install service configuration
  copy:
    src: "files/amd_{{ item }}_rc.conf"
    dest: "/etc/rc.conf.d/{{ item }}"
    mode: 0644
    owner: root
    group: wheel
  loop:
    - kld
