Cavity Q switching in a solid-state laser with the use of a self-generated holographic feedback